undefined reference to `main`

The

make

succeeded in producing the libkim.a

but failed on the TESTs section

g++44 -O3 -I/usr/local/apps/openkim/gcc44/openkim-api-v1.0.1/
KIM_API/ -Wno-write-strings -D KIM_DIR_MODELS=\"/usr/local/apps/
openkim/gcc44/openkim-api-v1.0.1/MODELs/\" -D KIM_DIR_API=\"/usr/local/
apps/openkim/gcc44/openkim-api-v1.0.1/KIM_API/\" -D KIM_DIR_TESTS=\"/
usr/local/apps/openkim/gcc44/openkim-api-v1.0.1/TESTs/\" -D
KIM_DIR_MODEL_DRIVERS=\"/usr/local/apps/openkim/gcc44/openkim-api-
v1.0.1/MODEL_DRIVERs/\" -D SYSTEM64 -lgfortran
ex_test_Al_FCCcohesive_MI_OPBC.o -L/usr/local/apps/openkim/gcc44/
openkim-api-v1.0.1/KIM_API/ -lkim -o ex_test_Al_FCCcohesive_MI_OPBC
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.0/../../../../lib64/crt1.o: In
function `_start':
(.text+0x20): undefined reference to `main'

so I went ahead with my lammps install -- but would have been more
comfortable if had had some indication that tests were successful

Regards,
Gary Howell

Hello,

Thanks for posting your question to the list.

I see that you are using the 4.4 version of the gnu compiler suite.

We have found that, with this version, it is best to link executable programs using the gfortran compiler as opposed to using g++.

So, you should change lines 57-60 of KIM_API/GNU_compiler_settings.mk from

    CPPLIBFLAG = -lgfortran #if GNU version 4.5 and up. tested on suse
    LINKCOMPILER = \(CPPCOMPILER\) \#if GNU version 4\.5 and up\. tested on suse     \#CPPLIBFLAG = \-lstdc\+\+ \#if GNU version 4\.4\.1\. tested on suse     \#LINKCOMPILER = (FORTRANCOMPILER) #if GNU version 4.4.1. tested on suse

to

    #CPPLIBFLAG = -lgfortran #if GNU version 4.5 and up. tested on suse
    #LINKCOMPILER = \(CPPCOMPILER\) \#if GNU version 4\.5 and up\. tested on suse     CPPLIBFLAG = \-lstdc\+\+ \#if GNU version 4\.4\.1\. tested on suse     LINKCOMPILER = (FORTRANCOMPILER) #if GNU version 4.4.1. tested on suse

Hope that works. Let us know.

Cheers,

Ryan Elliott