Problems compiling v.1.2.3 on 32bit Scientific linux with gcc

Our linux cluster is running 32 bit Scientific Linux.
When I try to compile v1.2.3 of the API it starts well, but then make fails.
I’ve attached the output below.
It may or may not be relevant that adding -lgfortranstart to LDFLAGS ( as suggested in the install instructions ) throws a link error
/usr/bin/ld: cannot find -lgfortranstart
at the end of make examples, so I have removed that library from the following.

Any help appreciated,

Daniel

[[email protected] openkim-api-v1.2.3]$ cat /proc/version
Linux version 2.6.32-431.1.2.el6.i686 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu Dec 12 13:59:21 CST 2013

[[email protected] openkim-api-v1.2.3]$ gcc -v
Using built-in specs.
Target: i686-redhat-linux
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)

[[email protected] openkim-api-v1.2.3]$ grep “LDFLAGS” Makefile.KIM_Config
LDFLAGS = -lgfortran

[[email protected] openkim-api-v1.2.3]$ make examples
Makefile:42: Makefile.ModelsList: No such file or directory
Makefile:42: Makefile.ModelDriversList: No such file or directory
Makefile:42: Makefile.TestsList: No such file or directory
Creating… Makefile.TestsList.
Creating… Makefile.ModelDriversList.
Creating… Makefile.ModelsList.
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.

  • installing… EXAMPLES.README … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODEL_DRIVERS
  • installing… ex_model_driver_P_Morse … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODEL_DRIVERS
  • installing… ex_model_driver_P_LJ … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODEL_DRIVERS
  • installing… ex_model_Ar_P_MLJ_NEIGH_RVEC_F … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_LJ … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_C … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ne_P_MLJ_NEIGH_RVEC_H … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… EXAMPLES.README … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_F90 … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ne_P_fastLJ … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_CLUSTER_C … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_NEIGH_PURE_H_F … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Al_PF_ErcolessiAdams … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_Morse … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ne_P_LJ_NEIGH_PURE_H … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_ArNe_P_MLJ_NEIGH_RVEC_F … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ne_P_LJ … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Cu_PF_Johnson … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_CLUSTER_F90 … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ar_P_MLJ_MI_OPBC_H_F … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_model_Ne_P_Morse … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/MODELS
  • installing… ex_test_Ar_free_cluster_CLUSTER_C … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_free_cluster_CLUSTER_memory_F90 … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_FCCcohesiveCutoff_NEIGH_RVEC … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_multiple_models … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_ArNe_B2cohesive_NEIGH_RVEC … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ne_free_cluster … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ne_free_cluster_stiff … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ne_free_cluster_SI … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… EXAMPLES.README … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… run_forces_numer_deriv_for_all_models … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_free_cluster … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_free_cluster_CLUSTER_F90 … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… vc_forces_delta … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Al_free_cluster … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_FCCcohesive_NEIGH_RVEC … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… vc_forces_numer_deriv … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_FCCcohesive_NEIGH_PURE … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Al_FCCcohesive_MI_OPBC … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… vc_config_ener_forces … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Cu_free_cluster … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… ex_test_Ar_FCCcohesive_MI_OPBC … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS
  • installing… run_all_ex_tests … copied to /home/dmason/Programs/KIM/openkim-api-v1.2.3/TESTS

[[email protected] openkim-api-v1.2.3]$ make
Creating… Makefile.TestsList.
Creating… Makefile.ModelDriversList.
Creating… Makefile.ModelsList.
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 Daniel,

OK. I've managed to create a virtualbox version of scientific linux 6.5.
I don't, however, reproduce this problem...

The error is some sort of make error. Can you verify that you are using verson 3.82 of gnu make?

Ryan

Hi,

No, not 3.82, we only have 3.81 here.

[[email protected] ~]$ make -v
GNU Make 3.81
Copyright © 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-redhat-linux-gnu

Daniel

OK! I think I can tell you how to fix this. Please perform the following commands to edit the file openkim-api-v1.2.3/Makefile

cd openkim\-api\-v1\.2\.3 sed -i 'bak' -e 's|\.\\ |\[email protected]|g' Makefile

I believe this will allow the build to run and complete.

This fix (actually a somewhat better, but more complicated one) will be in the next release of the openkim-api package...

Cheers,

Ryan

This seems to make a lot of progress!
If I use
sed -i.bak -e 's|\.\\ |[email protected]%|g’ Makefile

(note slight difference)

I get down to

[[email protected] openkim-api-v1.2.3]$ make

Great! OK, I think I know how to fix this too!

Instead of:

LDFLAGS = -lgfortran -lgfortranbegin

try

LD = $(FC)
LDFLAGS = -lstdc++

See if that works....

Ryan

This seems to have done the trick. I’ve run the example in TESTS and get
% echo “ex_model_Ar_P_MLJ_CLUSTER_C” | ./ex_test_Ar_free_cluster_CLUSTER_F90
Please enter a valid KIM model name:

Great!!!! It was my pleasure. I'm glad we worked it out!

Cheers,

Ryan