Problems with CMake when building models.

53 views
Skip to first unread message

Jakob Schiøtz

unread,
Mar 12, 2019, 5:32:08 AM3/12/19
to OpenKIM Mailing List
Dear all,

I am trying to make an EasyBuild configuration for the OpenKIM models. It downloads the models, and tries to build them with cmake. I am having a strange problem, and my lack of experience with CMake makes it hard for me to figure out what is going on.

Apparently, cmake cannot find the compilers, since it somehow gets the idea that they are placed in the build directory:



== 2019-03-11 11:07:25,450 run.py:192 INFO running cmd: cmake -DCMAKE_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b -DCMAKE_C_COMPILER='icc' -DCMAKE_Fortran_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_CXX_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_CXX_COMPILER='icpc' -DCMAKE_Fortran_COMPILER='ifort' -DCMAKE_C_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_VERBOSE_MAKEFILE=ON -DKIM_API_INSTALL_COLLECTION=SYSTEM -DKIM_API_MODEL_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b/lib/kim-api-v2/models -DKIM_API_MODEL_DRIVER_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b/lib/kim-api-v2/model-drivers /home/niflheim/schiotz/easybuild/broadwell/build/OpenKIMModels/20190221/intel-2018b/OpenKIM-Models-v2-2019-02-21/
== 2019-03-11 11:07:26,976 build_log.py:162 ERROR EasyBuild crashed with an error (at ?:124 in __init__): cmd " cmake -DCMAKE_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b -DCMAKE_C_COMPILER='icc' -DCMAKE_Fortran_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_CXX_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_CXX_COMPILER='icpc' -DCMAKE_Fortran_COMPILER='ifort' -DCMAKE_C_FLAGS='-O2 -xHost -ftz -fp-speculation=safe -fp-model source' -DCMAKE_VERBOSE_MAKEFILE=ON -DKIM_API_INSTALL_COLLECTION=SYSTEM -DKIM_API_MODEL_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b/lib/kim-api-v2/models -DKIM_API_MODEL_DRIVER_INSTALL_PREFIX=/home/niflheim/schiotz/easybuild/broadwell/software/OpenKIM-Models/20190221-intel-2018b/lib/kim-api-v2/model-drivers /home/niflheim/schiotz/easybuild/broadwell/build/OpenKIMModels/20190221/intel-2018b/OpenKIM-Models-v2-2019-02-21/" exited with exit code 1 and output:
-- Found KIM-API-V2: kim-api-v2 (Required is at least version "2.0")
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The Fortran compiler identification is unknown
CMake Error at CMakeLists.txt:37 (project):
The CMAKE_CXX_COMPILER:

/home/niflheim/schiotz/easybuild/broadwell/build/OpenKIMModels/20190221/intel-2018b/easybuild_obj/icpc

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

and the same for the C and Fortran compilers.

And in that folder, there is a CMakeCache.txt file, and it contains lines like:

CMAKE_CXX_COMPILER:FILEPATH=/home/niflheim/schiotz/easybuild/broadwell/build/OpenKIMModels/20190221/intel-2018b/easybuild_obj/icpc

I have no idea where it gets that idea from. Has anybody seen something like that before, or have any hint as to where I should be looking?



Best regards

Jakob


--
Jakob Schiøtz, professor, Ph.D.
Department of Physics
Technical University of Denmark
DK-2800 Kongens Lyngby, Denmark
http://www.fysik.dtu.dk/~schiotz/



Ryan S. Elliott

unread,
Mar 12, 2019, 8:00:58 AM3/12/19
to ope...@googlegroups.com
Jakob,

The kim-api remembers the compilers used to build it and uses those same values to build models (ignoring what cmake is told to use). So, I expect this is the root of the problem.

You can use a special build argument to override this for the kim-api. Similar to what I have done for homebrew:


Let me know if you need further pointers.


Ryan

Sent from my iPhone
--

---
You received this message because you are subscribed to the Google Groups "openkim" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openkim+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jakob Schiøtz

unread,
Mar 13, 2019, 10:31:11 AM3/13/19
to OpenKIM Mailing List
Hi again,

Problem solved!

Adding -DKIM_API_CMAKE_C_COMPILER and friends when compiling the API did not help. However, adding -DCMAKE_C_COMPILER=`which icc` and similar when configuring the models did work.

https://github.com/easybuilders/easybuild-easyconfigs/pull/7569

Thanks for your help!

Jakob

Ryan S. Elliott

unread,
Mar 13, 2019, 10:57:24 AM3/13/19
to 'Jakob Schiøtz' via openkim
Hi Jakob,

Interesting.... I don't quite understand how that's all working, but if it
works, great!

Thanks!

Ryan
--
Ryan S. Elliott, Ph.D. and Professor
Aerospace Engineering & Mechanics, University of Minnesota
(612) 624-2376 (626-1558 fax)
https://z.umn.edu/relliott
download vCard <https://z.umn.edu/relliott_vcf>
----------
If you live to be one hundred, you've got it made. Very few people die past
that age.

George Burns
----------
Reply all
Reply to author
Forward
0 new messages