From 65d31dfeb16de563f825dd0eb5c3135fb58b21df Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 1 Dec 2021 16:49:00 -0600 Subject: [PATCH] Adjustments to lib/kim/Install.py and docs --- doc/src/Build_extras.rst | 12 ++++++++++++ lib/kim/Install.py | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 994fdf2e5c..dad8f5dacc 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -341,6 +341,18 @@ minutes to hours) to build. Of course you only need to do that once.) $ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location $ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver + When using the "-b " option, the KIM library is built using its native + cmake build system. The ``lib/kim/Install.py`` script supports a + ``CMAKE`` environment variable if the cmake executable is named other + than ``cmake`` on your system. Additional environment variables may be + provided for use by camke on the command line. For example, to use the + ``cmake3`` executable and tell it to use the gnu version 11 compilers + to build KIM, one could use the following command line. + + .. code-block:: bash + + $ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models + Settings for debugging OpenKIM web queries discussed below need to be applied by adding them to the ``LMP_INC`` variable through editing the ``Makefile.machine`` you are using. For example: diff --git a/lib/kim/Install.py b/lib/kim/Install.py index ae4b356ba9..da0a4296d6 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -17,6 +17,8 @@ parser = ArgumentParser(prog='Install.py', # settings +CMAKE = os.environ.get('CMAKE') or 'cmake' + thisdir = fullpath('.') version = "2.2.1" @@ -141,7 +143,7 @@ if buildflag: # configure kim-api print("Configuring kim-api ...") - cmd = 'cd "%s/kim-api-%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (thisdir,version,kimdir) + cmd = 'cd "%s/kim-api-%s" && mkdir build && cd build && %s .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (thisdir,version,CMAKE,kimdir) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print(txt.decode("UTF-8"))