I have been attempting to install the KIM API for use with LAMMPS for the past few days, but have run into the following issue:
One of the MEAM_2NN files throws a linker error about illegal text re-allocation:
ld: illegal text-relocation to ‘_reinit’ in libkim-api-model-driver-v1.7.3+GCC.darwin.64bit.dynamic-load.a(MEAM_2NN.o) from ‘anon’ in libkim-api-model-driver-v1.7.3+GCC.darwin.64bit.dynamic-load.a(MEAM_2NN.o) for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [libkim-api-model-driver-v1.7.3+GCC.darwin.64bit.dynamic-load.so] Error 1
rm driver_init_wrapper.cpp export-list.txt
make: *** [MEAM_2NN__MD_111291751625_001-all] Error 2
I have tried this with gcc/g++ v4.8 and v6 (from homebrew, the latter actually reads 6.2.0 from --version), because the default compiler had a difficulty with fortran.
I have tried this with both dynamic-load and dynamic-link on 4.8. The same error results.
I have tried this after artificially changing the Makefile.KIM_Config file to 32 bit architecture (-m32 flags included…this throws a different error, but still errors):
ld: warning: ignoring file build-config.o, file was built for x86_64 which is not the architecture being linked (i386): build-config.o
Undefined symbols for architecture i386:
“_main”, referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
collect2: error: ld returned 1 exit status
make[1]: *** [kim-api-v1-build-config] Error 1
The makefile I use for compiling with gcc-6 is attached. Is this a known issue? Are there any workarounds?
Thank you for your help,
-Colin Campbell
Makefile.KIM_Config (365 Bytes)