adios does not compile/link on Apple Mac OS(Undefined symbols for architecture x86_64)
Opened this issue · 7 comments
burlen commented
the full error is:
libtool: link: /usr/bin/clang -O2 -g -fPIC -o bpdump bpdump-bpdump.o ../../src/libadios_internal_nompi.a
Undefined symbols for architecture x86_64:
"_adiost_tool", referenced from:
_adiost_pre_init in libadios_internal_nompi.a(libcoreonce_a-adiost_callback_internal.o)
(maybe you meant: _my_adiost_tool, _default_adiost_tool )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
don't know if it's related but I see numerous warning above about .a files with no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libadiosreadf.a(adiosf_defs_mod.o) has no symbols
burlen commented
compiler version
$gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
eisenhauer commented
Kevin Huck has a fix for this...
khuck commented
I made a patch in my fork: https://github.com/khuck/ADIOS but I have to test it on other platforms before making the pull request.
burlen commented
@khuck Thank you! your patch fixed the mac build. You mentioned you hadn't tested on linux, so I gave it run. it breaks the linux build. error looks familiar.
make[3]: Entering directory '/work/SENSEI/adios-master/utils/gpp'
test "../../../ADIOS/utils/gpp" = "." || cp ../../../ADIOS/utils/gpp/ad_config.py ../../../ADIOS/utils/gpp/type_mapper.py .; chmod a+x *.py
make[3]: Leaving directory '/work/SENSEI/adios-master/utils/gpp'
Making all in bpdump
make[3]: Entering directory '/work/SENSEI/adios-master/utils/bpdump'
/bin/sh ../../libtool --tag=CC --mode=link gcc -fPIC -g -fPIC -o bpdump bpdump-bpdump.o ../../src/libadios_internal_nompi.a -lnetcdf -lpthread -lm
libtool: link: gcc -fPIC -g -fPIC -o bpdump bpdump-bpdump.o ../../src/libadios_internal_nompi.a -lnetcdf -lpthread -lm
../../src/libadios_internal_nompi.a(libcoreonce_a-adiost_callback_internal.o): In function `adiost_pre_init':
/work/SENSEI/adios-master/src/../../ADIOS/src/core/adiost_callback_internal.c:73: undefined reference to `adiost_tool'
collect2: error: ld returned 1 exit status
Makefile:592: recipe for target 'bpdump' failed
make[3]: *** [bpdump] Error 1
khuck commented
OK, I removed the check for __clang__
for the weak definition, it should always be defined as a weak symbol now.
jychoi-hpc commented
Is this fix merged yet? I am getting the same error on my mac.