[GRASS5] GRASS 5.1: MacOSX compilation?

Markus Neteler neteler at itc.it
Thu Aug 21 06:12:00 EDT 2003


A followup:

it seems to be a problem of the libraries, not the modules.

file /Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_raster.dylib
/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_raster.dylib: Mach-O executable ppc

This is certainly wrong, obviously due to the use of
 gcc -dylib
instead of
 gcc -dynamiclib

(defined as: SHLIB_LD in aclocal.m4)

Changing this, I arrive at (tried with libgis):

[timonchiotwin:~/grass51exp/lib/gis] markus% make
gcc -L/sw/lib -L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib
        -dynamiclib -flat_namespace -fno_common -undefined suppress
        -L/sw/lib
        -L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib \
[...]
OBJ.powerpc-apple-darwin6.6/zone.o OBJ.powerpc-apple-darwin6.6/G_dump.o -o
/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gis.dylib
ld: common symbols not allowed with MH_DYLIB output format
OBJ.powerpc-apple-darwin6.6/gisinit.o definition of common _G__ (size 142472)
OBJ.powerpc-apple-darwin6.6/geo_init.o definition of common _TABLE (size 86592)
OBJ.powerpc-apple-darwin6.6/gisinit.o definition of common _CELL_NODATA (size 4)
/usr/bin/libtool: internal link edit command failed
make: *** [/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gis.dylib] Error 1

The parameters I was guessing from PROJ4 which compiles on Mac OSX, but
PROJ4 is using 'libtool'.

Still in the dark,

 Markus

On Thu, Aug 21, 2003 at 11:00:46AM +0200, Markus Neteler wrote:
> Currently I try to compile GRASS 5.1 on Mac OSX.
> 
> Thanks to the recent update of 'aclocal.m4' by Paul the
> 'configure' runs well now, using following parameters:
> http://grass.itc.it/grass51/source/conf_scripts/macosx/
> -> conf51_macOSX.sh
> 
> All libraries compile as well, but there is a problem
> compiling modules (as well as some 'test' programs within
> the libraries and the 'form' program). The compiler line
> for linking modules seems to be wrong:
> 
> Example:
> 
> [timonchiotwin:~/grass51exp/raster/r.average] markus% make
> gcc -I/Users/markus/grass51exp/include -I/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/include -I/usr/X11R6/include -I/sw/include -g -O2  -Wall -Wconversion -Wno-implicit-int  -I/usr/X11R6/include -I/sw/include    -I/Users/markus/grass51exp/include -I/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/include \
>         -o OBJ.powerpc-apple-darwin6.6/main.o -c main.c
> main.c: In function `main':
> main.c:78: warning: suggest parentheses around assignment used as truth value
> main.c:92: warning: suggest parentheses around assignment used as truth value
> main.c:108: warning: passing arg 2 of `out' as floating rather than integer due to prototype
> main.c:108: warning: passing arg 3 of `out' as floating rather than integer due to prototype
> /usr/include/stdio.h: At top level:
> /Users/markus/grass51exp/include/gis.h:36: warning: `GRASS_copyright' defined but not used
> gcc -L/sw/lib -L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib   -o /Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/etc/bin/cmd/r.average OBJ.powerpc-apple-darwin6.6/main.o -lgrass_gis -lgrass_datetime  -lintl  -lz
> ld: /Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gis.dylib is input for the dynamic link editor, is not relocatable by the static link editor again
> ld: /Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_datetime.dylib is input for the dynamic link editor, is not relocatable by the static link editor again
> make: *** [/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/etc/bin/cmd/r.average] Error 1
> 
> Knowing almost nothing about Mac OSX I would like to ask here for help.
> Some 'gcc' flags seem to be missing.
> 
> Thanks
> 
>  Markus
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list