[MOAB-dev] MOAB on OS X

Steve Jackson sjackson at cae.wisc.edu
Tue May 11 17:14:56 CDT 2010


Herein I relate my experiences building MOAB under OS X.  Executive summary: due to (probably fixable) config issues, MOAB doesn't compile on the compiler shipped by Apple. 

My Mac runs Snow Leopard, version 10.6.3 (the latest available revision).  I have the most recent version of Xcode, version 3.2.2 (64-bit).  The gcc associated with this installation is 4.2.1:

> $ gcc --version
> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)

(I believe that Apple customizes this compiler a bit, so Apple builds of GCC may not behave identically to mainline GCC at the same version number.)

In today's Fathom meeting I claimed that MOAB's configure script failed on my computer, but in this I was apparently mistaken.  The autoconf/configure step works for me.  However, I cannot compile MOAB with the default compiler.  After compiling and linking libMOAB.a, make proceeds to compile tests, and the first one fails with a catastrophic linking error:

> Making all in perf
> CC -DHAVE_CONFIG_H -I. -I../.. -I../../src/moab -I../../src/parallel -I../../src -I../../../code3/test/perf  -DTEMPLATE_SPECIALIZATION -DTEMPLATE_FUNC_SPECIALIZATION -DHAVE_VSNPRINTF -I../../../code3/src -I../../../code3/src/io/mhdf/include -I../../src -DUNORDERED_MAP_NS=std::tr1 -DHAVE_UNORDERED_MAP=tr1/unordered_map  -Wall -pipe -O2 -DNDEBUG -MT point_in_elem.o -MD -MP -MF .deps/point_in_elem.Tpo -c -o point_in_elem.o ../../../code3/test/perf/point_in_elem.cpp
> mv -f .deps/point_in_elem.Tpo .deps/point_in_elem.Po
> /bin/sh ../../libtool --tag=CXX   --mode=link CC  -Wall -pipe -O2 -DNDEBUG   -o point_in_elem point_in_elem.o ../../src/libMOAB.la -lm
> libtool: link: CC -Wall -pipe -O2 -DNDEBUG -o point_in_elem point_in_elem.o -Wl,-bind_at_load  ../../src/.libs/libMOAB.a -lm
> Undefined symbols:
> [lists every symbol in the MOAB library: approx. 2 MB of text output! ]
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make[3]: *** [point_in_elem] Error 1
> make[2]: *** [all-recursive] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2

Althought the -Wl,-bind_at_load option looks suspicious, it's not the cause of the trouble.  I isolated the call that attempts to link point_in_elem.  The following call:

> gcc -o point_in_elem point_in_elem.o  ../../src/.libs/libMOAB.a 

produces the error.  But replacing "gcc" with "g++" allows the program to link correctly.  So it seems that if libtool could be convinced to use g++ instead of gcc as its linker command, the compilation could proceed.  I tried reconfiguring with CC=g++, but that didn't make a difference.

More version numbers: my mac has autoreconf version 2.61, and running ./libtool --version in the MOAB compilation directory produces "ltmain.sh (GNU libtool) 2.2.4"

I have attached the config.log, the terminal output of the configure script (configure.output), and the terminal output of the make command (make.output).
~S


-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.log
Type: application/octet-stream
Size: 91115 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20100511/5dffd222/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.output
Type: application/octet-stream
Size: 12906 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20100511/5dffd222/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make.output
Type: application/octet-stream
Size: 82085 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20100511/5dffd222/attachment-0005.obj>


More information about the moab-dev mailing list