ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

adios does not compile/link on Apple Mac OS(Undefined symbols for architecture x86_64) #156

Open burlen opened 6 years ago

burlen commented 6 years ago

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 6 years ago

@mw70 have you had success building adios on apple?

burlen commented 6 years ago

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 6 years ago

Kevin Huck has a fix for this...

khuck commented 6 years ago

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 6 years ago

@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 6 years ago

OK, I removed the check for __clang__ for the weak definition, it should always be defined as a weak symbol now.

jychoi-hpc commented 6 years ago

Is this fix merged yet? I am getting the same error on my mac.