[GRASS-dev] How to specify custom include directories

Paul Kelly paul-grass at stjohnspoint.co.uk
Wed Jul 11 19:49:52 EDT 2007


On Wed, 11 Jul 2007, David Finlayson wrote:

> First time compiling GRASS on SuSE. I do not have su privileges on this
> machine and so I am forced to build my entire tool chain in my home
> directory ($HOME)=/we/davidf).
>
> So far fftw-3.1.2, gdal-1.4.2 and proj-4.5.0 have all compiled using the
> following:
>
> ./configure --prefix=$HOME
> make
> make install
>
> Which has built a directory tree in $HOME like this:
>
> $HOME/bin
> $HOME/include
> $HOME/lib
> $HOME/man
> $HOME/share
>
> Now, trying the same with grass results in a configure error:
>
> albacore src/grass-6.2.cvs_src_snapshot_2007_07_07> ./configure
> --prefix=$HOME --enable-64bit --with-libs=/usr/lib64
> checking host system type... x86_64-unknown-linux-gnu
> checking for gcc... gcc
> checking whether the C compiler (gcc  ) works... yes
> ... etc ...
> checking for deflate in -lz... yes
> checking for location of External PROJ.4 includes...
> checking for proj_api.h... no
> configure: error: *** Unable to locate External PROJ.4 includes.
>
> However, proj_api.h is in $HOME/include
>
> I have tried adding --includedir=$HOME/include to the above but that didn't
> change anything.  I'm sure it's something simple. How do I tell configure
> where my local includes are (and why didn't --prefix=$HOME work?)

See ./configure --help
Summary:

--with-includes=$HOME/include
or if it was just PROJ there then you could use
--with-proj-includes=$HOME/include

--prefix is where GRASS will be installed when you type "make install" -
consistent with your use of it to indicate where you wanted the supporting 
libraries installed.

As Helena says you also need to specify where the libraries are too using 
--with-libs or --with-proj-libs.

That's only for compiling though; if you also want to *run* GRASS without 
installing the libraries into a system library location you will need to 
add $HOME/lib to the LD_LIBRARY_PATH environment variable 
(DYLD_LIBRARY_PATH on OS X) or (on Linux, if you have root access) adding 
it to /etc/ld.so.conf and running ldconfig after you compile the new 
libraries.

Paul




More information about the grass-dev mailing list