[GRASSLIST:1908] RE: configuring Grass5.03 on Debian - includes locations

Thanks Glynn and Holger for the input.

My problem with zlib was that the development package was not installed
correctly. It was originally installed from a tar ball so the parts were
mostly there, but not all. Overwriting with
   apt-get zlib1g-dev
solved that problem.

   After Googling for the Debian version of package names of other needed
headers and libs I now have the compile going.The Debian people must have
already solved the links problem that Holger had.

  TWO QUIRKS OF NOTE for maintainers

  Debian put some headers in sub-directories.

  TCL headers ended up in /usr/include/tcl8.0
  postgresql headers are in /usr/include/postgresql

  I simply copied the contents into /usr/include to get the compile going.

  Please include these as alternate linux locations in future versions of
configure for fellow Debian users. Thanks.

  For those compiling on Debian Woody in the future, here is a partial list of
the debian "apt-get" names for the packages based on what I still needed:

   zlib1g-dev
   libjpeg-dev
   libtiff-dev
   libpng-dev
   libgd-dev
   libtcl8.3-dev
   pg-dev
   postgresql-dev
   mesag3-dev OR xlibmesa3-dev
   unixodbc-dev
   fftw-dev ( & sfftw-dev ?)

  Thanks again for the feedback.

                      Jim

===== Original Message From Holger Zebner <holgerzebner@gmx.de> =====

There should be a file (or symlink to one) called either libz.a or
libz.so. The usual situation on Linux is that libz.so is a symlink to
the actual file, and the actual file includes the version number,
e.g.:

$ ls -l /usr/lib/libz.so
lrwxrwxrwx 1 root root 13 Apr 2 2002 /usr/lib/libz.so ->
libz.so.1.1.3

There will normally be another symlink which only contains the major
version number, e.g.:

$ ls -l /usr/lib/libz.so.?
lrwxrwxrwx 1 root root 13 Apr 2 2002 /usr/lib/libz.so.1
-> libz.so.1.1.3

The unversioned link (libz.so) is needed for compilation. FWIW, RedHat
puts these links in the *-devel (development) packages (e.g.
zlib-devel), along with the headers. The versioned link (libz.so.1) is
needed at run-time. The actual file (e.g. libz.so.1.1.3) is needed for
both.

I don't know how Debian organises packages. If, like RedHat, it has
separate development packages, you will need these in order to compile
GRASS.

I don't know either how they organize the packages, yet. Sometimes in a
non-conventional manner regarding the problems when installing from source.

I did kinda workaround:
I made a directory called links-for-install
Then I made all symlinks needed by GRASS in that dir. Like if you need
libtiff.a and this isn't found by configure link it there and specify it in
the ./configure --with-libtiff=/thedir

my link dir:

ls /usr/links-for-install/
insgesamt 8,0K
drwxr-xr-x 2 root root 4,0K 2003-11-25 00:16 .
drwxr-xr-x 15 root root 4,0K 2003-11-25 00:13 ..
lrwxrwxrwx 1 root root 18 2003-11-25 00:15 libproj.a ->

/usr/

lib/libproj.a
lrwxrwxrwx 1 root root 19 2003-11-25 00:15 libproj.la -> /
usr/lib/libproj.la
lrwxrwxrwx 1 root root 21 2003-11-25 00:15 libproj.so.0 -> /
usr/lib/libproj.so.0
lrwxrwxrwx 1 root root 25 2003-11-25 00:15 libproj.so.0.4.1
-> /usr/lib/libproj.so.0.4.1
lrwxrwxrwx 1 root root 18 2003-11-25 00:11 libtiff.a ->

/usr/

lib/libtiff.a
lrwxrwxrwx 1 root root 19 2003-11-25 00:11 libtiff.so -> /
usr/lib/libtiff.so
lrwxrwxrwx 1 root root 21 2003-11-25 00:11 libtiff.so.3 -> /
usr/lib/libtiff.so.3
lrwxrwxrwx 1 root root 25 2003-11-25 00:12 libtiff.so.3.5.7
-> /usr/lib/libtiff.so.3.5.7
lrwxrwxrwx 1 root root 23 2003-11-25 00:16 projects.h -> /
usr/include/projects.h
lrwxrwxrwx 1 root root 21 2003-11-25 00:12 tiffio.h -> /usr/
include/tiffio.h

Donno if this is a good manner of system administartion but I got GRASS
installed through this.

Greetings
Holger

Jim Browne wrote:

My problem with zlib was that the development package was not installed
correctly. It was originally installed from a tar ball so the parts were
mostly there, but not all. Overwriting with
   apt-get zlib1g-dev
solved that problem.

   After Googling for the Debian version of package names of other needed
headers and libs I now have the compile going.The Debian people must have
already solved the links problem that Holger had.

  TWO QUIRKS OF NOTE for maintainers

  Debian put some headers in sub-directories.

  TCL headers ended up in /usr/include/tcl8.0
  postgresql headers are in /usr/include/postgresql

Those are fairly common, particularly the latter.

  I simply copied the contents into /usr/include to get the compile going.

The correct solution is to use:

  --with-tcltk-includes=/usr/include/tcl8.0
and:
  --with-postgres-includes=/usr/include/postgresql

That's why those switches exist.

[Actually, the "real" solution is for the authors of substantial
middleware packages such as Tcl/Tk and PostgreSQL to use a prefix
directory for headers, as is the case for OpenGL and X11.]

  Please include these as alternate linux locations in future versions of
configure for fellow Debian users. Thanks.

configure does not attempt to guess which directories you want the
compiler/linker to look in; you have to tell it. If you don't use any
--with-*-includes or --with-*-libs switches, the only directories
which will be used are those in the compiler's/linker's default search
paths.

This is intentional, and won't change. It used to do path-guessing;
that was removed for a reason, and that reason is still valid.

[Specifically: on some systems, it would break the build, and no
combination of switches would fix it. When it does the right thing,
path-guessing provides a minor convenience (i.e. it saves you from
typing a couple of switches). When it does the wrong thing, you simply
cannot build GRASS.]

The only exception is for X, where the configure test attempts to
determine the appropriate switches via Imake, but allows them to be
(partially) overridden via the --x-includes= and --x-libraries=
switches. This behaviour is built into autoconf.

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

The correct solution is to use:

  --with-tcltk-includes=/usr/include/tcl8.0
and:
  --with-postgres-includes=/usr/include/postgresql

That's why those switches exist.

I first tryied to compile with these switches as stated in "./configure
--help" but it failded. I _had_ the files on the system and specified the
path through --with-*-dir=*/*/ but it didn't find it.

That's why I used the workaround.
Holger

--
Debian testing/unstable, build from Knoppix 3.3
GRASS 5.0.3 (October 2003)

  For those compiling on Debian Woody in the future, here is a partial
list of the debian "apt-get" names for the packages based on what I still
needed:

   zlib1g-dev
   libjpeg-dev
   libtiff-dev
   libpng-dev
   libgd-dev
   libtcl8.3-dev
   pg-dev
   postgresql-dev
   mesag3-dev OR xlibmesa3-dev
   unixodbc-dev
   fftw-dev ( & sfftw-dev ?)

moreover, a ./configure line for Debian 3.0 (Woody)

CFLAGS="-O3 -march=i686 -Wall" LDFLAGS="-s" ./configure \
        --with-tcltk-includes=/usr/include/tcl8.3 \
        --with-postgres-includes=/usr/include/postgresql \
        --with-motif --with-motif-includes=/usr/X11R6/include \
        --with-freetype --with-freetype-includes=/usr/include/freetype2 \
        --with-blas --with-blas-libs=/usr/lib/gcc-lib/i386-linux/3.0.4 \
        --with-lapack --with-glw \
        --with-readline \
        2>&1 | tee config_log.txt

$> make
#> make install

The following gets pretty much everthing config'd in for me with a stock
installation of the current (feb 2002) Debian Woody 3.0. Any packages I
already had installed, well add them too- but I don't know what they are.
I have not shifted any files or set up any special links that I can think
of. Some of these packages may not really be needed..

apt-file was used for most of this discovery. It's a great utility!

.deb Package Provides..
---------------------------------
libncurses5-dev curses.h
zlib1g-dev zip fn's
libjpegb2-dev \
libtiff3g-dev |- graphics
# superseded libpng2-dev /
libpng-dev /
# superseded libgd-dev gif/png support
libgd2-dev gif/png support

# no longer exists task-tcltk-dev Tcl/Tk widgets 8.3
tk8.3-dev Tcl/Tk 8.3 development files. As of 5.0.0, Tk8.4 breaks NVIZ
# tk8.4-dev Tcl/Tk 8.4 Development Files. Depends on needed Tcl bits.
fftw-dev FFT Libraries

postgresql-dev PostgreSQL
libsqlxx-dev ODBC ? conflicts with unixodbc-dev?
libgdbm-dev DBM (Use libgdbmg1-dev for Woody)
unixodbc-dev ODBC
libfreetype6-dev Freetype
libmotif-dev Motif
blas-dev BLAS
lapack-dev LAPACK
g77-3.0 for BLAS (& lapack as well??)
f2c for BLAS (libf2c) unneeded?

optional:
proj PROJ.4 projection
gdal-bin (soon) GDAL data imports (use --with-gdal)