[GRASS5] GRASS 5.1: MacOSX compilation?
Markus Neteler
neteler at itc.it
Thu Aug 21 11:38:32 EDT 2003
On Thu, Aug 21, 2003 at 11:32:58AM +0100, Paul Kelly wrote:
> Hello Markus
>
> On Thu, 21 Aug 2003, Markus Neteler wrote:
>
> ...
> > 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
>
> What about deleting the '-fno-common' in the SHLIB_LD line? Perhaps this
> is some kind of extra-strict warning that is not needed. But there might
> be other consequences.
I tried (sorry for the typo above in my message -fno-common was misspelled),
but omitting -fno-common does not change the result:
cd lib/gis
make clean
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/zone.o -c zone.c /Users/markus/grass51exp/include/gis.h:36: warning: 'GRASS_copyright' defined but not used
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/G_dump.o -c G_dump.c
/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
-dynamiclib -flat_namespace -undefined suppress -L/sw/lib
-L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib \
OBJ.powerpc-apple-darwin6.6/adj_cellhd.o
OBJ.powerpc-apple-darwin6.6/align_window.o
OBJ.powerpc-apple-darwin6.6/alloc.o
[...]
OBJ.powerpc-apple-darwin6.6/zero_cell.o 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
However, using -fno-common works e.g. for 'libgrass_datetime':
cd lib/datetime/
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/values.o -c values.c
gcc -L/sw/lib -L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib
-dynamiclib -fno-common -flat_namespace
-undefined suppress -L/sw/lib
-L/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib \
OBJ.powerpc-apple-darwin6.6/between.o
OBJ.powerpc-apple-darwin6.6/copy.o OBJ.powerpc-apple-darwin6.6/same.o
OBJ.powerpc-apple-darwin6.6/diff.o OBJ.powerpc-apple-darwin6.6/error.o
OBJ.powerpc-apple-darwin6.6/format.o OBJ.powerpc-apple-darwin6.6/incr1.o
OBJ.powerpc-apple-darwin6.6/incr2.o OBJ.powerpc-apple-darwin6.6/incr3.o
OBJ.powerpc-apple-darwin6.6/local.o OBJ.powerpc-apple-darwin6.6/misc.o
OBJ.powerpc-apple-darwin6.6/change.o OBJ.powerpc-apple-darwin6.6/scan.o
OBJ.powerpc-apple-darwin6.6/sign.o OBJ.powerpc-apple-darwin6.6/type.o
OBJ.powerpc-apple-darwin6.6/tz1.o OBJ.powerpc-apple-darwin6.6/tz2.o
OBJ.powerpc-apple-darwin6.6/values.o -o
/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_datetime.dylib
Also fails libgrass_gmath.dylib
ld: common symbols not allowed with MH_DYLIB output format
OBJ.powerpc-apple-darwin6.6/del2g.o definition of common _g (size 8)
/usr/bin/libtool: internal link edit command failed
make: *** [/Users/markus/grass51exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gmath.dylib]
Error 1
OK are:
- libgrass_bitmap.dylib
- libgrass_datetime.dylib
- libgrass_btree.dylib
- libgrass_gproj.dylib
and more, the modules also link successfully against these libs.
So probably the compilation flags are right, but something wrong in libgis?
Or another flag missing or a flag in the wrong position?
Markus
More information about the grass-dev
mailing list