[GRASSLIST:1713] configure problems on OSX

I'm working on getting grass compiled on OSX (Panther) and am having trouble with jpeg libs. I have already compiled gdal without python, and am using:

  ./configure --with-gdal --with-jpeg-includes=/sw/include/

To get grass configured (I needed to specify the jpeg-includes so that they could be found). But now I'm getting the following error:

checking for location of JPEG includes... /sw/include/
checking for jpeglib.h... yes
checking for location of JPEG library...
checking for jpeg_start_compress in -ljpeg... no
configure: error: *** Unable to locate JPEG library.

Any tips?

Thanks,

Kirk

Kirk R. Wythers wrote:

I'm working on getting grass compiled on OSX (Panther) and am having
trouble with jpeg libs. I have already compiled gdal without python,
and am using:

  ./configure --with-gdal --with-jpeg-includes=/sw/include/

To get grass configured (I needed to specify the jpeg-includes so that
they could be found). But now I'm getting the following error:

checking for location of JPEG includes... /sw/include/
checking for jpeglib.h... yes
checking for location of JPEG library...
checking for jpeg_start_compress in -ljpeg... no
checking for jpeg_start_compress in -ljpeg... no
configure: error: *** Unable to locate JPEG library.

Any tips?

Look at the config.log file. Specifically, search for the text
"checking for jpeg_start_compress". Any error messages will follow
shortly afterwards.

--
Glynn Clements <glynn.clements@virgin.net>

On Nov 9, 2003, at 8:36 PM, Glynn Clements wrote:

Look at the config.log file. Specifically, search for the text
"checking for jpeg_start_compress". Any error messages will follow
shortly afterwards.

I'm not seeing any reference to "checking for jpeg_start_includes". Here is the error log...

(attachments)

config.log (15.6 KB)

Kirk R. Wythers wrote:

> Look at the config.log file. Specifically, search for the text
> "checking for jpeg_start_compress". Any error messages will follow
> shortly afterwards.

I'm not seeing any reference to "checking for jpeg_start_includes".
Here is the error log...

  configure:5503: checking for jpeg_start_compress in -ljpeg
  configure:5520: gcc -o conftest -g -O2 conftest.c -ljpeg 1>&5
  ld: can't locate file for: -ljpeg
  configure: failed program was:
  [snipped]
  configure:5539: checking for jpeg_start_compress in -ljpeg
  configure:5556: gcc -o conftest -g -O2 conftest.c -ljpeg -lz 1>&5
  ld: can't locate file for: -ljpeg
  configure: failed program was:
  [snipped]

OK; it really is failing because it can't find the JPEG library
(library failures are often more involved, e.g. a library may need
other libraries which can't be found).

You probably need something like:

  --with-jpeg-libs=/sw/lib

The file in question will probably be called libjpeg.a or
libjpeg.dylib; you need to specify the directory in which that file
resides.

If a lot of the external dependencies are in /sw/include and /sw/lib,
it may be better to just use e.g.:

  --with-includes=/sw/include --with-libs=/sw/lib

so that those directories are searched for every dependency.

--
Glynn Clements <glynn.clements@virgin.net>

This is my configure file, for a MacX powerbook. You must check where are your libraries, and if you do not find some libraries install they by source using for example Fink Commander.

I hope this helps. Giacomo

./configure --prefix=/sw/share \
--with-postgres-includes=/usr/local/pgsql/include \
--with-postgres-libs=/usr/local/pgsql/lib \
--with-includes=/sw/include \
--with-libs=/sw/lib \
--with-tiff-includes=/sw/include \
--with-tiff-libs=/sw/lib \
--with-tcltk-includes=/sw/include \
--with-proj \
--with-tcltk-libs=/sw/lib/tcl8.4 \
--with-gd-includes=/sw/include \
--with-opengl-includes=/usr/X11R6/include \
--with-fftw-includes=/sw/include \
--with-gdal=/usr/local/bin/gdal-config \
--without-odbc

On Lunedì, nov 10, 2003, at 13:43 US/Pacific, Glynn Clements wrote:

Kirk R. Wythers wrote:

Look at the config.log file. Specifically, search for the text
"checking for jpeg_start_compress". Any error messages will follow
shortly afterwards.

I'm not seeing any reference to "checking for jpeg_start_includes".
Here is the error log...

  configure:5503: checking for jpeg_start_compress in -ljpeg
  configure:5520: gcc -o conftest -g -O2 conftest.c -ljpeg 1>&5
  ld: can't locate file for: -ljpeg
  configure: failed program was:
  [snipped]
  configure:5539: checking for jpeg_start_compress in -ljpeg
  configure:5556: gcc -o conftest -g -O2 conftest.c -ljpeg -lz 1>&5
  ld: can't locate file for: -ljpeg
  configure: failed program was:
  [snipped]

OK; it really is failing because it can't find the JPEG library
(library failures are often more involved, e.g. a library may need
other libraries which can't be found).

You probably need something like:

  --with-jpeg-libs=/sw/lib

The file in question will probably be called libjpeg.a or
libjpeg.dylib; you need to specify the directory in which that file
resides.

If a lot of the external dependencies are in /sw/include and /sw/lib,
it may be better to just use e.g.:

  --with-includes=/sw/include --with-libs=/sw/lib

so that those directories are searched for every dependency.

--
Glynn Clements <glynn.clements@virgin.net>

Giacomo wrote:

This is my configure file, for a MacX powerbook. You must check where
are your libraries, and if you do not find some libraries install they
by source using for example Fink Commander.

These two:

--with-includes=/sw/include \
--with-libs=/sw/lib \

should eliminate the need for all of these:

--with-tiff-includes=/sw/include \
--with-tiff-libs=/sw/lib \
--with-tcltk-includes=/sw/include \
--with-gd-includes=/sw/include \
--with-fftw-includes=/sw/include \

If configure fails without the above five switches, I'd like to see
the error messages from config.log.

I was about to say that this:

--with-opengl-includes=/usr/X11R6/include \

shouldn't be necessary either, but it probably is (that's a bug on our
part). The checks for the OpenGL headers ought to use $X_CFLAGS (the
checks for the libraries *do* use $X_LIBS etc).

--
Glynn Clements <glynn.clements@virgin.net>

This is my configure file, for a MacX powerbook. You must check where
are your libraries, and if you do not find some libraries install they
by source using for example Fink Commander.

I hope this helps. Giacomo

./configure --prefix=/sw/share \
--with-postgres-includes=/usr/local/pgsql/include \
--with-postgres-libs=/usr/local/pgsql/lib \
--with-includes=/sw/include \
--with-libs=/sw/lib \
--with-tiff-includes=/sw/include \
--with-tiff-libs=/sw/lib \
--with-tcltk-includes=/sw/include \
--with-proj \
--with-tcltk-libs=/sw/lib/tcl8.4 \
--with-gd-includes=/sw/include \
--with-opengl-includes=/usr/X11R6/include \
--with-fftw-includes=/sw/include \
--with-gdal=/usr/local/bin/gdal-config \
--without-odbc

Does anyone have a list of what Fink packages should be installed for a
successful MacOSX build?

thanks,
Hamish

On Nov 12, 2003, at 2:50 PM, Glynn Clements wrote:

Giacomo wrote:

This is my configure file, for a MacX powerbook. You must check where
are your libraries, and if you do not find some libraries install they
by source using for example Fink Commander.

These two:

--with-includes=/sw/include \
--with-libs=/sw/lib \

should eliminate the need for all of these:

--with-tiff-includes=/sw/include \
--with-tiff-libs=/sw/lib \
--with-tcltk-includes=/sw/include \
--with-gd-includes=/sw/include \
--with-fftw-includes=/sw/include \

That makes sense to me... but I've got a couple o questions about other --with(s)

I am using the following switches:
./configure \
--with-gdal=/usr/local/bin/gdal-config \
--with-includes=/sw/include \
--with-libs=/sw/lib --with \
--with-opengl-includes=/usr/X11R6/include \
--without-odbc

but need to straighten out postgresql. I'm getting the following error when when I run ./congigure:

checking for location of PostgreSQL includes...
checking for libpq-fe.h... no
configure: error: *** Unable to locate PostgreSQL includes.

A 'find' does not come up with libpq-fe.h. I built postgresql with fink using the /10.3/unstable tree. However, I'm having a bogger of a time figuring out where it put the postgresql includes...

If configure fails without the above five switches, I'd like to see
the error messages from config.log.

I was about to say that this:

--with-opengl-includes=/usr/X11R6/include \

shouldn't be necessary either, but it probably is (that's a bug on our
part). The checks for the OpenGL headers ought to use $X_CFLAGS (the
checks for the libraries *do* use $X_LIBS etc).

--
Glynn Clements <glynn.clements@virgin.net>

------------------------------------------------------------------------
Kirk R. Wythers tel: 612.625.2261
Dept. of Forest Resources fax: 612.625.5212
University of Minnesota email: kwythers@umn.edu
------------------------------------------------------------------------

Kirk R. Wythers wrote:

That makes sense to me... but I've got a couple o questions about other
--with(s)

I am using the following switches:
./configure \
--with-gdal=/usr/local/bin/gdal-config \
--with-includes=/sw/include \
--with-libs=/sw/lib --with \
--with-opengl-includes=/usr/X11R6/include \
--without-odbc

but need to straighten out postgresql. I'm getting the following error
when when I run ./congigure:

checking for location of PostgreSQL includes...
checking for libpq-fe.h... no
configure: error: *** Unable to locate PostgreSQL includes.

A 'find' does not come up with libpq-fe.h. I built postgresql with fink
using the /10.3/unstable tree. However, I'm having a bogger of a time
figuring out where it put the postgresql includes...

I'm not sure that I can help there. libpq-fe.h is essential for the
PostgreSQL modules; all of them include it, so if it really isn't
present, there's no way that the PostgreSQL modules can be built.

Looking at:

  http://fink.sourceforge.net/pdb/package.php/postgresql

shows:

  SplitOffs:
    postgresql-dev PostgreSQL development headers and libraries
    postgresql-shlibs PostgreSQL shared libraries
    postgresql73-dev PostgreSQL development headers and libraries
    postgresql73-shlibs PostgreSQL shared libraries

The headers would probably be part of the -dev package.

--
Glynn Clements <glynn.clements@virgin.net>

On Nov 13, 2003, at 11:25 AM, Glynn Clements wrote:

The headers would probably be part of the -dev package.

You were right Glynn, they were in the -dev package. Also (per earlier post to list) the switch --with-opengl-includes=/usr/X11R6/include \
was necessary.

Lastly I want to ask if I am setting myself up for a re-build if I go ahead without the following:

GRASS is now configured for powerpc-apple-darwin7.0.0

   Source directory: /Users/kirkw/tmp/grass5.0.2
   Build directory: /Users/kirkw/tmp/grass5.0.2
   Installation directory: /usr/local/grass5
   C compiler: gcc -g -O2
   FORTRAN compiler: g77

   NVIZ: yes

   X11 support: yes
   DBM support: no
   JPEG support: yes
   TIFF support: yes
   PNG support: yes
   GD support: yes
   Tcl/Tk support: yes
   PostgreSQL support: yes
   OpenGL(R) support: yes
   ODBC support: no
   FFTW support: yes
   BLAS support: no
   LAPACK support: no
   Motif support: no
   FreeType support: no
   GLw support: no
   NLS support: no
   Readline support: no

Specifically I am wondering about freetype, and ODBC

--
Glynn Clements <glynn.clements@virgin.net>

------------------------------------------------------------------------
Kirk R. Wythers tel: 612.625.2261
Dept. of Forest Resources fax: 612.625.5212
University of Minnesota email: kwythers@umn.edu
------------------------------------------------------------------------

Kirk R. Wythers wrote:

> The headers would probably be part of the -dev package.

You were right Glynn, they were in the -dev package. Also (per earlier
post to list) the switch --with-opengl-includes=/usr/X11R6/include \
was necessary.

Lastly I want to ask if I am setting myself up for a re-build if I go
ahead without the following:

GRASS is now configured for powerpc-apple-darwin7.0.0

   Source directory: /Users/kirkw/tmp/grass5.0.2
   Build directory: /Users/kirkw/tmp/grass5.0.2
   Installation directory: /usr/local/grass5
   C compiler: gcc -g -O2
   FORTRAN compiler: g77

   NVIZ: yes

   X11 support: yes
   DBM support: no
   JPEG support: yes
   TIFF support: yes
   PNG support: yes
   GD support: yes
   Tcl/Tk support: yes
   PostgreSQL support: yes
   OpenGL(R) support: yes
   ODBC support: no
   FFTW support: yes
   BLAS support: no
   LAPACK support: no
   Motif support: no
   FreeType support: no
   GLw support: no
   NLS support: no
   Readline support: no

Specifically I am wondering about freetype, and ODBC

FreeType is only used by d.text.freetype.

ODBC is only relevant to the DBMI modules, which don't seem
particularly useful (does anyone know if they are actually relevant to
GRASS?). It isn't relevant to the PostgreSQL modules.

None of the other disabled options are particularly important either.
BLAS/LAPACK are effectively unused, Motif is only used by xganim and
r3.showdspf.openGL, GLw is only used by r3.showdspf.openGL, readline
is an optional extension to r.mapcalc, and NLS (Native Language
Support) is only useful if you want certain text displayed in Russian.

--
Glynn Clements <glynn.clements@virgin.net>

My apologies if I have responded to this request earlier. But a quick check of the archives does not turn my response up so I will repost.

On Nov 14, 2003, at 10:59 AM, John Chesnut wrote:

Can you post a summary of:
1) a "clean" version of your OSX configure command.

My configure command was fairly straight forward:

./configure \
--with-postgres-includes=/sw/include/postgresql \
--with-postgres-libs=/sw/lib/postgresql \
--with-gdal=/usr/local/bin/gdal-config \
--with-includes=/sw/include \
--with-libs=/sw/lib \
--with-opengl-includes=/usr/X11R6/include \
--without-odbc \
--with-proj \

2) note on your directory structure for a grass build

I left the directory structure as the defaults. Therefor Grass got installed into /usr/local

truffula:/usr/local/grass5 kirkw$ ls
bin documents fonts locale scripts
bwidget driver include locks tcltkgrass
dev etc lib man txt

3) Notes to the source of the libraries and headers which you had to troubleshoot.

As you can see in the configure script, I installed everything from fink with the exception of gdal (here I used 1.1.9 and configured with the switch --without-python... which I saw as a recommendation in the archives... from Hamish, I think), and grass (which for I used the new stable 5.0.3, configured with the above switches).

The only trouble I had was getting postresql installed with fink. And once I realized that I needed to be installing all of its dependencies from the same unstable tree, that went smoothly as well. Here is what I copied into my local/main/finkinfo directory:

truffula:/sw/fink/dists/local/main/finkinfo kirkw$ ls
passwd.info postgresql-libpqpp.patch
passwd.patch postgresql.info
postgresql-libpgeasy.patch postgresql.patch

Reason: I have been unable to configure/ make the OSX binary, and hope to benefit from your troubleshooting.

john chesnut

If you have any more questions feel free to ask away...

Kirk