openkim-v1.4.0 on mac

Hi Ryan,

My installation of kim api version 1.4.0 stalls when i try to install it on my mac. I am using gcc and gfortran 4.7.3 versions. I tried looking up in the forum but could not find anything similar. I get the following message:

Creating… KIM_Config file… KIM_API/Makefile.KIM_Config.
Creating… KIM_Config file… MODEL_DRIVERS/Makefile.KIM_Config.
Creating… KIM_Config file… MODELS/Makefile.KIM_Config.
Creating… KIM_Config file… TESTS/Makefile.KIM_Config.

HI Nikhil,

It appears that you have the wrong value for

KIM_SYSTEMLINKER

It needs to be set to "darwin" for Mac OS X.

Ryan

Hi Ryan,

Thanks (New Mac user!!). I am now having the following error. I did exactly what you suggested Ron to do in

https://groups.google.com/forum/#!searchin/openkim/openkim$20v$201.4.0$20mac/openkim/fxAAJeOC5UY/USep96FAu-EJ

The api compiles along with the models. I get following compiler error for tests:

Creating… vc_forces_delta.o.
Creating… Test executable… vc_forces_delta.
Undefined symbols for architecture i386:
“__gfortran_concat_string”, referenced from:
write_kim_descriptor in vc_forces_delta.o
"_gfortran_internal_pack", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_internal_unpack", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_os_error", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_random_r8", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_runtime_error_at", referenced from:
MAIN
in vc_forces_delta.o
“__gfortran_set_args”, referenced from:
_main in vc_forces_delta.o
“__gfortran_set_options”, referenced from:
_main in vc_forces_delta.o
"_gfortran_st_read", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_st_read_done", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_st_write", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_st_write_done", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
“__gfortran_stop_string”, referenced from:
_get_neigh in vc_forces_delta.o
__mod_neighborlist_MOD_setup_neighborlist_kim_access in vc_forces_delta.o
update_neighborlist in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_string_index", referenced from:
update_neighborlist in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_string_len_trim", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
“__gfortran_string_scan”, referenced from:
get_model_supported_types in vc_forces_delta.o
"_gfortran_string_trim", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_transfer_character", referenced from:
MAIN
in vc_forces_delta.o
"_gfortran_transfer_character_write", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_transfer_integer_write", referenced from:
write_kim_descriptor in vc_forces_delta.o
MAIN
in vc_forces_delta.o
"_gfortran_transfer_real_write", referenced from:
MAIN
in vc_forces_delta.o
ld: symbol(s) not found for architecture i386
collect2: error: ld returned 1 exit status
make: *** [vc_forces_delta] Error 1

In addition to having gfortran installed with the -multilib option, I had to have gcc also installed with the multilib option in order for the kim-api to compile.

Nikhil

Hi Nikhil,

Here is how I'm currently making my mac work:

1) use the standard g++ and gcc installed as part of Xcode command line utilities:

<501 Ryans-MacBook-Pro-3:~ >g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

<502 Ryans-MacBook-Pro-3:~ >gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

2) install gfortran via homebrew

   % brew install gfortran --enable-multilib

3) use the following in Makefile.KIM_Config

KIM_COMPILERSUITE = GCC
KIM_SYSTEMLINKER = darwin
KIM_SYSTEMARCH = 32bit
KIM_LINK = dynamic-load

LDFLAGS += -read_only_relocs suppress
LDLIBS = /usr/local/opt/gfortran/gfortran/lib/i386/libgfortran.dylib

Ryan

Hi Ryan,

Thanks for the prompt reply. I am still not sure how the api and models compile, but only tests give error messages. Following is my compiler and makefile info:

IM_COMPILERSUITE = GCC
KIM_SYSTEMLINKER = darwin
KIM_SYSTEMARCH = 32bit
KIM_LINK = dynamic-load

load default compiler options

include $(KIM_DIR)/MAKE_SYSTEM/Makefile.LoadDefaults

overwrite default variable values here

CC = gcc-4.8 -m32
CXX = g+±4.8 -m32
FC = gfortran -m32

XLANGLDLIBS = -L/usr/local/Cellar/gfortran/4.8.2/gfortran/lib/i386
LDFLAGS += -read_only_relocs suppress

gcc-4.8 and gfortran are installed using brew.

Nikhils-MacBook-Pro:openkim-api-v1.4.0 Nikhil$ gcc-4.8 -v
Using built-in specs.
COLLECT_GCC=gcc-4.8
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.2/libexec/gcc/x86_64-apple-darwin13.1.0/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13.1.0
Configured with: …/configure --build=x86_64-apple-darwin13.1.0 --prefix=/usr/local/Cellar/gcc/4.8.2 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.2 (GCC)

Nikhils-MacBook-Pro:openkim-api-v1.4.0 Nikhil$ g+±4.8 -v
Using built-in specs.
COLLECT_GCC=g+±4.8
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.2/libexec/gcc/x86_64-apple-darwin13.1.0/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13.1.0
Configured with: …/configure --build=x86_64-apple-darwin13.1.0 --prefix=/usr/local/Cellar/gcc/4.8.2 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.2 (GCC)

Nikhils-MacBook-Pro:openkim-api-v1.4.0 Nikhil$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gfortran/4.8.2/gfortran/libexec/gcc/x86_64-apple-darwin13.1.0/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13.1.0
Configured with: …/configure --prefix=/usr/local/Cellar/gfortran/4.8.2/gfortran --datarootdir=/usr/local/Cellar/gfortran/4.8.2/share --bindir=/usr/local/Cellar/gfortran/4.8.2/bin --enable-languages=fortran --with-system-zlib --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --disable-cloog-version-check --disable-isl-version-check --enable-checking=release --disable-stage1-checking --disable-libstdcxx --enable-lto --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.2 (GCC)

I will try some other alternatives to see it this can be fixed.

Hi Ryan,

Thanks for the help. The API, models and the test all compile now. I have attached my Makefile.KIM_Config file for others to refer.

Nikhil

Makefile.KIM_Config (1.57 KB)