nwchemgit / nwchem

NWChem: Open Source High-Performance Computational Chemistry
http://nwchemgit.github.io
Other
514 stars 163 forks source link

weird MacOS issues - archive member: .libs/libga.a(libclang_rt.osx.a) fat file for cputype (7) cpusubtype (3) is not an object file (bad magic number) #171

Open jeffhammond opened 4 years ago

jeffhammond commented 4 years ago

I am putting this here for tracking purposes and in case others see it. This is new to me.

/bin/sh ./libtool  --tag=F77   --mode=link ifort   -integer-size 64     -Wl,-no_pie -Wl,-no_pie -L/usr/local/Cellar/open-mpi/4.0.2/lib -Wl,-flat_namespace -Wl,-commons,use_dylibs -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/4.0.2/lib -L/Users/jrhammon/Work/NWCHEM/github/external-armci/lib -version-info 2:0:1  -o libga.la -rpath /Users/jrhammon/Work/NWCHEM/github/src/tools/install/lib compat/random.lo ma/error.lo ma/f2c.lo ma/ma.lo ma/string-util.lo ma/table.lo ma/maf.lo LinAlg/lapack+blas/gal_cgemm.lo LinAlg/lapack+blas/gal_daxpy.lo LinAlg/lapack+blas/gal_dcabs1.lo LinAlg/lapack+blas/gal_dcopy.lo LinAlg/lapack+blas/gal_ddot.lo LinAlg/lapack+blas/gal_dgemm.lo LinAlg/lapack+blas/gal_dgemv.lo LinAlg/lapack+blas/gal_dger.lo LinAlg/lapack+blas/gal_dgetf2.lo LinAlg/lapack+blas/gal_dgetrf.lo LinAlg/lapack+blas/gal_dgetrs.lo LinAlg/lapack+blas/gal_disnan.lo LinAlg/lapack+blas/gal_dlacpy.lo LinAlg/lapack+blas/gal_dlae2.lo LinAlg/lapack+blas/gal_dlaev2.lo LinAlg/lapack+blas/gal_dlaisnan.lo LinAlg/lapack+blas/gal_dlamch.lo LinAlg/lapack+blas/gal_dlanst.lo LinAlg/lapack+blas/gal_dlansy.lo LinAlg/lapack+blas/gal_dlapy2.lo LinAlg/lapack+blas/gal_dlarfb.lo LinAlg/lapack+blas/gal_dlarf.lo LinAlg/lapack+blas/gal_dlarfg.lo LinAlg/lapack+blas/gal_dlarft.lo LinAlg/lapack+blas/gal_dlartg.lo LinAlg/lapack+blas/gal_dlascl.lo LinAlg/lapack+blas/gal_dlaset.lo LinAlg/lapack+blas/gal_dlasr.lo LinAlg/lapack+blas/gal_dlasrt.lo LinAlg/lapack+blas/gal_dlassq.lo LinAlg/lapack+blas/gal_dlaswp.lo LinAlg/lapack+blas/gal_dlatrd.lo LinAlg/lapack+blas/gal_dnrm2.lo LinAlg/lapack+blas/gal_dorg2l.lo LinAlg/lapack+blas/gal_dorg2r.lo LinAlg/lapack+blas/gal_dorgql.lo LinAlg/lapack+blas/gal_dorgqr.lo LinAlg/lapack+blas/gal_dorgtr.lo LinAlg/lapack+blas/gal_dpotf2.lo LinAlg/lapack+blas/gal_dpotrf.lo LinAlg/lapack+blas/gal_dscal.lo LinAlg/lapack+blas/gal_dsteqr.lo LinAlg/lapack+blas/gal_dsterf.lo LinAlg/lapack+blas/gal_dswap.lo LinAlg/lapack+blas/gal_dsyev.lo LinAlg/lapack+blas/gal_dsygs2.lo LinAlg/lapack+blas/gal_dsygst.lo LinAlg/lapack+blas/gal_dsygv.lo LinAlg/lapack+blas/gal_dsymm.lo LinAlg/lapack+blas/gal_dsymv.lo LinAlg/lapack+blas/gal_dsyr2.lo LinAlg/lapack+blas/gal_dsyr2k.lo LinAlg/lapack+blas/gal_dsyrk.lo LinAlg/lapack+blas/gal_dsytd2.lo LinAlg/lapack+blas/gal_dsytrd.lo LinAlg/lapack+blas/gal_dtrmm.lo LinAlg/lapack+blas/gal_dtrmv.lo LinAlg/lapack+blas/gal_dtrsm.lo LinAlg/lapack+blas/gal_dtrsv.lo LinAlg/lapack+blas/gal_idamax.lo LinAlg/lapack+blas/gal_ieeeck.lo LinAlg/lapack+blas/gal_iladlc.lo LinAlg/lapack+blas/gal_iladlr.lo LinAlg/lapack+blas/gal_ilaenv.lo LinAlg/lapack+blas/gal_iparmq.lo LinAlg/lapack+blas/gal_lsame.lo LinAlg/lapack+blas/gal_sgemm.lo LinAlg/lapack+blas/gal_xerbla.lo LinAlg/lapack+blas/gal_zaxpy.lo LinAlg/lapack+blas/gal_zgemm.lo LinAlg/lapack+blas/xgemm.lo global/src/base.lo global/src/capi.lo global/src/collect.lo global/src/datatypes.lo global/src/decomp.lo global/src/DP.lo global/src/elem_alg.lo global/src/fapi.lo global/src/ga_diag_seqc.lo global/src/ga_malloc.lo global/src/ga_solve_seq.lo global/src/ga_symmetr.lo global/src/ga_trace.lo global/src/ghosts.lo global/src/global.nalg.lo global/src/global.npatch.lo global/src/global.periodic.lo global/src/global.util.lo global/src/hsort.scat.lo global/src/iterator.lo global/src/matmul.lo global/src/matrix.lo global/src/nbutil.lo global/src/onesided.lo global/src/peigstubs.lo global/src/sclstubs.lo global/src/select.lo global/src/sparse.lo global/src/thread-safe.lo global/src/complex.lo global/src/ga_diag_seq.lo   global/src/ga_diag.lo   pario/dra/buffers.lo pario/dra/capi.lo pario/dra/disk.arrays.lo pario/dra/disk.param.lo pario/dra/env.lo pario/dra/fortran.lo pario/dra/patch.util.lo pario/eaf/eaf.lo pario/eaf/eaf_f2c.lo pario/elio/elio.lo pario/elio/stat.lo pario/sf/sf_capi.lo pario/sf/sf_fortran.lo pario/sf/shared.files.lo  gaf2c/gaf2c.lo gaf2c/drand.lo gaf2c/farg.lo tcgmsg/capi.lo tcgmsg/fapi.lo tcgmsg/tcgmsg-mpi/checkbyte.lo tcgmsg/tcgmsg-mpi/clustercheck.lo tcgmsg/tcgmsg-mpi/collect.lo tcgmsg/tcgmsg-mpi/drand48.lo tcgmsg/tcgmsg-mpi/evlog.lo tcgmsg/tcgmsg-mpi/evon.lo tcgmsg/tcgmsg-mpi/llog.lo tcgmsg/tcgmsg-mpi/misc.lo tcgmsg/tcgmsg-mpi/niceftn.lo tcgmsg/tcgmsg-mpi/nxtval-armci.lo tcgmsg/tcgmsg-mpi/p2p.lo tcgmsg/tcgmsg-mpi/pbeginf.lo tcgmsg/tcgmsg-mpi/pfilecopy.lo tcgmsg/tcgmsg-mpi/sizeof.lo      -mkl=sequential -mkl=sequential -larmci -lmpi   -L/opt/intel/compilers_and_libraries_2019.4.233/mac/ipp/lib -L/opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib -L/opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib -L/opt/intel/compilers_and_libraries_2019.4.233/mac/tbb/lib -L/opt/intel/compilers_and_libraries_2019.4.233/mac/daal/lib -L/opt/intel/compilers_and_libraries_2019.4.233/mac/daal/../tbb/lib -L/usr/lib /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifport.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifcoremt.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libimf.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libsvml.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libipgo.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libirc.a -lpthread /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a 

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifport.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifcoremt.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libimf.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libsvml.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libipgo.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libirc.a is not portable!

*** Warning: Linking the shared library libga.la against the
*** static library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a is not portable!
copying selected object files to avoid basename conflicts...
libtool: link: ln pario/dra/capi.o .libs/libga.lax/lt1-capi.o || cp pario/dra/capi.o .libs/libga.lax/lt1-capi.o
libtool: link: ln tcgmsg/capi.o .libs/libga.lax/lt2-capi.o || cp tcgmsg/capi.o .libs/libga.lax/lt2-capi.o
libtool: link: ln tcgmsg/fapi.o .libs/libga.lax/lt3-fapi.o || cp tcgmsg/fapi.o .libs/libga.lax/lt3-fapi.o
libtool: link: ln tcgmsg/tcgmsg-mpi/collect.o .libs/libga.lax/lt4-collect.o || cp tcgmsg/tcgmsg-mpi/collect.o .libs/libga.lax/lt4-collect.o
libtool: link: ar cru .libs/libga.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifport.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libifcoremt.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libimf.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libsvml.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libipgo.a /opt/intel/compilers_and_libraries_2019.4.233/mac/compiler/lib/libirc.a /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a compat/random.o ma/error.o ma/f2c.o ma/ma.o ma/string-util.o ma/table.o ma/maf.o LinAlg/lapack+blas/gal_cgemm.o LinAlg/lapack+blas/gal_daxpy.o LinAlg/lapack+blas/gal_dcabs1.o LinAlg/lapack+blas/gal_dcopy.o LinAlg/lapack+blas/gal_ddot.o LinAlg/lapack+blas/gal_dgemm.o LinAlg/lapack+blas/gal_dgemv.o LinAlg/lapack+blas/gal_dger.o LinAlg/lapack+blas/gal_dgetf2.o LinAlg/lapack+blas/gal_dgetrf.o LinAlg/lapack+blas/gal_dgetrs.o LinAlg/lapack+blas/gal_disnan.o LinAlg/lapack+blas/gal_dlacpy.o LinAlg/lapack+blas/gal_dlae2.o LinAlg/lapack+blas/gal_dlaev2.o LinAlg/lapack+blas/gal_dlaisnan.o LinAlg/lapack+blas/gal_dlamch.o LinAlg/lapack+blas/gal_dlanst.o LinAlg/lapack+blas/gal_dlansy.o LinAlg/lapack+blas/gal_dlapy2.o LinAlg/lapack+blas/gal_dlarfb.o LinAlg/lapack+blas/gal_dlarf.o LinAlg/lapack+blas/gal_dlarfg.o LinAlg/lapack+blas/gal_dlarft.o LinAlg/lapack+blas/gal_dlartg.o LinAlg/lapack+blas/gal_dlascl.o LinAlg/lapack+blas/gal_dlaset.o LinAlg/lapack+blas/gal_dlasr.o LinAlg/lapack+blas/gal_dlasrt.o LinAlg/lapack+blas/gal_dlassq.o LinAlg/lapack+blas/gal_dlaswp.o LinAlg/lapack+blas/gal_dlatrd.o LinAlg/lapack+blas/gal_dnrm2.o LinAlg/lapack+blas/gal_dorg2l.o LinAlg/lapack+blas/gal_dorg2r.o LinAlg/lapack+blas/gal_dorgql.o LinAlg/lapack+blas/gal_dorgqr.o LinAlg/lapack+blas/gal_dorgtr.o LinAlg/lapack+blas/gal_dpotf2.o LinAlg/lapack+blas/gal_dpotrf.o LinAlg/lapack+blas/gal_dscal.o LinAlg/lapack+blas/gal_dsteqr.o LinAlg/lapack+blas/gal_dsterf.o LinAlg/lapack+blas/gal_dswap.o LinAlg/lapack+blas/gal_dsyev.o LinAlg/lapack+blas/gal_dsygs2.o LinAlg/lapack+blas/gal_dsygst.o LinAlg/lapack+blas/gal_dsygv.o LinAlg/lapack+blas/gal_dsymm.o LinAlg/lapack+blas/gal_dsymv.o LinAlg/lapack+blas/gal_dsyr2.o LinAlg/lapack+blas/gal_dsyr2k.o LinAlg/lapack+blas/gal_dsyrk.o LinAlg/lapack+blas/gal_dsytd2.o LinAlg/lapack+blas/gal_dsytrd.o LinAlg/lapack+blas/gal_dtrmm.o LinAlg/lapack+blas/gal_dtrmv.o LinAlg/lapack+blas/gal_dtrsm.o LinAlg/lapack+blas/gal_dtrsv.o LinAlg/lapack+blas/gal_idamax.o LinAlg/lapack+blas/gal_ieeeck.o LinAlg/lapack+blas/gal_iladlc.o LinAlg/lapack+blas/gal_iladlr.o LinAlg/lapack+blas/gal_ilaenv.o LinAlg/lapack+blas/gal_iparmq.o LinAlg/lapack+blas/gal_lsame.o LinAlg/lapack+blas/gal_sgemm.o LinAlg/lapack+blas/gal_xerbla.o LinAlg/lapack+blas/gal_zaxpy.o LinAlg/lapack+blas/gal_zgemm.o LinAlg/lapack+blas/xgemm.o global/src/base.o global/src/capi.o global/src/collect.o global/src/datatypes.o global/src/decomp.o global/src/DP.o global/src/elem_alg.o global/src/fapi.o global/src/ga_diag_seqc.o global/src/ga_malloc.o global/src/ga_solve_seq.o global/src/ga_symmetr.o global/src/ga_trace.o global/src/ghosts.o global/src/global.nalg.o global/src/global.npatch.o global/src/global.periodic.o global/src/global.util.o global/src/hsort.scat.o global/src/iterator.o global/src/matmul.o global/src/matrix.o global/src/nbutil.o global/src/onesided.o global/src/peigstubs.o global/src/sclstubs.o global/src/select.o global/src/sparse.o global/src/thread-safe.o global/src/complex.o global/src/ga_diag_seq.o global/src/ga_diag.o pario/dra/buffers.o .libs/libga.lax/lt1-capi.o pario/dra/disk.arrays.o pario/dra/disk.param.o pario/dra/env.o pario/dra/fortran.o pario/dra/patch.util.o pario/eaf/eaf.o pario/eaf/eaf_f2c.o pario/elio/elio.o pario/elio/stat.o pario/sf/sf_capi.o pario/sf/sf_fortran.o pario/sf/shared.files.o gaf2c/gaf2c.o gaf2c/drand.o gaf2c/farg.o .libs/libga.lax/lt2-capi.o .libs/libga.lax/lt3-fapi.o tcgmsg/tcgmsg-mpi/checkbyte.o tcgmsg/tcgmsg-mpi/clustercheck.o .libs/libga.lax/lt4-collect.o tcgmsg/tcgmsg-mpi/drand48.o tcgmsg/tcgmsg-mpi/evlog.o tcgmsg/tcgmsg-mpi/evon.o tcgmsg/tcgmsg-mpi/llog.o tcgmsg/tcgmsg-mpi/misc.o tcgmsg/tcgmsg-mpi/niceftn.o tcgmsg/tcgmsg-mpi/nxtval-armci.o tcgmsg/tcgmsg-mpi/p2p.o tcgmsg/tcgmsg-mpi/pbeginf.o tcgmsg/tcgmsg-mpi/pfilecopy.o tcgmsg/tcgmsg-mpi/sizeof.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libga.a(libclang_rt.osx.a) fat file for cputype (7) cpusubtype (3) is not an object file (bad magic number)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: internal ranlib command failed
make[3]: *** [libga.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [build/.libs/libga.a] Error 1
edoapra commented 4 years ago

@jeffhammond Is the MacOs Intel Compiler compatible with the brew OpenMPI you are linking against (usr/local/Cellar/open-mpi/4.0.2/lib)?

jeffhammond commented 4 years ago

Good question. I will have to dig into this. I am going to install Intel 2020 compilers first.

edoapra commented 4 years ago

It showed up for me only when MKL is used. When I use OpenBLAS (via BUILD_OPENBLAS) the error does not show up The build was probably working earlier not because of MKL vs OpenBLAS, but I might have been using gfortran instead of ifort

edoapra commented 3 years ago

Recent changes in the GA develop branch address this issue. I have created a tarball labeled as 5.8.1 in my ga fork that contains these fixes. https://github.com/edoapra/ga/releases/download/v5.8.1/ga-5.8.1.tar.gz

edoapra commented 3 years ago

The master branch is now using ga 5.8.1 after commit https://github.com/nwchemgit/nwchem/commit/bd7baf8e7a1d80e633b623a0e782643531b37f2b A github action job is now testing ifort on macos and was subject to this bug prior to commit https://github.com/edoapra/ga/commit/d2c59ac231fccd566851cc6e2fd04d604c7bb932

guanglei1wang commented 1 year ago

Good to know that the problem is solved. But I am wondering how (as I encounter a similar problem for other program linking agains MKL static lib as well).

edoapra commented 1 year ago

Good to know that the problem is solved. But I am wondering how (as I encounter a similar problem for other program linking agains MKL static lib as well).

Could you please file a detailed bug report using the template https://github.com/nwchemgit/nwchem/issues/new?assignees=&labels=&template=bug_report.md&title=

edoapra commented 1 year ago

Good to know that the problem is solved. But I am wondering how (as I encounter a similar problem for other program linking agains MKL static lib as well).

This is the commit that should address this issue https://github.com/GlobalArrays/ga/commit/c9c174fbb52f68f0c72c9bbebd3ef88b976b7037

edoapra commented 1 year ago

The patch above now causes amdflang version 18.0.0. from AMD ROC 5.7.1 to fail to build GA.
The error is

configure: error: f2c string convention is neither after args nor after string