#30 Build fails on x86 OS X

open
nobody
None
5
2007-09-20
2007-09-20
Ross Nelson
No

/usr/local/mpich/bin/mpicc -g -O2 -g -O2 -o pyMPI pyMPI.o -L. libpyMPI.a -lm -L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -lpython2.5 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -u _PyMac_Error -ldl
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning pyMPI.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning libpyMPI.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning /usr/local/mpich/lib/libpmpich.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning /usr/local/mpich/lib/libmpich.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: warning multiple definitions of symbol _Py_GetVersion
libpyMPI.a(pyMPI_sysmods.o) definition of _Py_GetVersion in section (__TEXT,__text)
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/libpython2.5.a(single module) definition of _Py_GetVersion
lipo: can't open input file: /var/tmp//cccZ4UhN.out (No such file or directory)
make[1]: *** [pyMPI] Error 1
make: *** [all] Error 2

When configure runs, it picks up a few global build options (I don't know where they're set; I didn't do it) that tell it to build a Universal Binary. As my MPI implementation (MPICH2 from hpc.sf.net) is native x86, the build fails. This happened for my professor with OpenMPI as well.

rnelson@deepthought:~/Desktop/pyMPI-2.4b4% ./configure | grep ppc
checking Python CFLAGS... -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
checking Python LDFLAGS... -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
checking Python LDSHARED... gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup
checking Python BLDSHARED... gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup
checking Python library options... -L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -lpython2.5 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -u _PyMac_Error -ldl
configure: WARNING: MPI must need some more libraries... Look at config.log. You may need to add --with-libs info
rnelson@deepthought:~/Desktop/pyMPI-2.4b4%

Discussion

  • Ross Nelson
    Ross Nelson
    2007-09-20

    Logged In: YES
    user_id=299086
    Originator: YES

    Note: removing "-arch ppc" from the Makefile will cause it to build perfectly on my x86 OS X laptop as well as the one running OpenMPI.