[GRASS-dev] 64 bit compiling of GRASS 7 on Mac - /lib/vector/diglib fails

I tried again to compile GRASSS 7 in 64 bit mode on the Mac. Thanks to various fixes of the past few weeks, I had only one error and was able to make a functioning app. Here is the error. If it can be fixed, then we can run GRASS in 64 bit on the Mac (without nviz of course).

Finished compilation: Tue Jan 13 18:15:15 MST 2009
make: *** [default] Error 1
cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/vector/diglib
cmb-MBP-2:diglib cmbarton$ make
if [ “” != “” -a -f “”.html ] ; then make html ; fi
make OBJ.i386-apple-darwin9.6.0/test
echo “==============TEST=============”
==============TEST=============
gcc -L/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib -arch i386 -arch i386 -Os -arch i386 -arch i386 -Os -arch i386 -arch x86_64 -Os -I/Library/Frameworks/GDAL.framework/Versions/1.6/Headers -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/include -o OBJ.i386-apple-darwin9.6.0/test test.c -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_rtree
-lgrass_gis -lgrass_datetime -lz -lgrass_datetime -lz
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_dig2.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_gis.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_datetime.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_rtree.dylib, file is not of required architecture
Undefined symbols for architecture x86_64:
“_dig_fflush”, referenced from:
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
“_dig_set_cur_port”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_C”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_D”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_F”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_I”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_L”, referenced from:
_main in ccA94H4H.o
“_dig__fread_port_S”, referenced from:
_main in ccA94H4H.o
“_dig_fseek”, referenced from:
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
_main in ccA94H4H.o
“_dig__fwrite_port_C”, referenced from:
_main in ccA94H4H.o
“_dig__fwrite_port_D”, referenced from:
_main in ccA94H4H.o
“_dig__fwrite_port_F”, referenced from:
_main in ccA94H4H.o
“_dig__fwrite_port_I”, referenced from:
_main in ccA94H4H.o
“_dig__fwrite_port_L”, referenced from:
_main in ccA94H4H.o
“_dig__fwrite_port_S”, referenced from:
_main in ccA94H4H.o
“_dig_init_portable”, referenced from:
_main in ccA94H4H.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
lipo: can’t open input file: /var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//ccnRDjhL.out (No such file or directory)
make[1]: *** [OBJ.i386-apple-darwin9.6.0/test] Error 1
make: *** [default] Error 2


C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Jan 13, 2009, at 9:34 PM, Michael Barton wrote:

I tried again to compile GRASSS 7 in 64 bit mode on the Mac. Thanks to various fixes of the past few weeks, I had only one error and was able to make a functioning app. Here is the error. If it can be fixed, then we can run GRASS in 64 bit on the Mac (without nviz of course).

Well, the problem I had when I last tried 64bits wasn't the compilation, but at runtime. Some of the vector modules would crash, and the closest I could track it down was (I think) somewhere in the diglib... And as I write this it connects in my brain that your compilation error is in diglib...

Finished compilation: Tue Jan 13 18:15:15 MST 2009
make: *** [default] Error 1
cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/vector/diglib
cmb-MBP-2:diglib cmbarton$ make
if [ "" != "" -a -f "".html ] ; then make html ; fi
make OBJ.i386-apple-darwin9.6.0/test
echo "==============TEST============="
==============TEST=============
gcc -L/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib -arch i386 -arch i386 -Os -arch i386 -arch i386 -Os -arch i386 -arch x86_64 -Os -I/Library/Frameworks/GDAL.framework/Versions/1.6/Headers -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/include -o OBJ.i386-apple-darwin9.6.0/test test.c -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_rtree \
        -lgrass_gis -lgrass_datetime -lz -lgrass_datetime -lz
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_dig2.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_gis.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_datetime.dylib, file is not of required architecture
ld warning: in /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib/libgrass_rtree.dylib, file is not of required architecture
Undefined symbols for architecture x86_64:
  "_dig_fflush", referenced from:

...

It looks like the error was really back in those 4 libraries - they didn't compile with x86_64 for some reason.

Try make clean in those folders and make again, and check that -arch x86_64 is in all compile commands and the final link command.

I'll give it a try myself...

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy

On Jan 13, 2009, at 9:34 PM, Michael Barton wrote:

gcc -L/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.6.0/lib -arch i386 -arch i386 -Os -arch i386 -arch i386 -Os -arch i386 -arch x86_64 -Os -

Ah, here could be the problem - either your CFLAGS or LDFLAGS export has 2 i386 flags, missing x86_64.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war