diff --git a/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1-foss-2021b.eb b/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1-foss-2021b.eb new file mode 100644 index 000000000000..4c8ebae75f93 --- /dev/null +++ b/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1-foss-2021b.eb @@ -0,0 +1,97 @@ +# Using the foss toolchain, not downloading any packages as they are coming +# from EasyBuild and thus can be tested which the download version does not do +# Tests enabled, default is the continuous integration checks testset +# J. Sassmannshausen (Imperial College London/UK) + +easyblock = 'EB_PSI' + +name = 'PSI4' +version = '1.6.1' + +homepage = 'http://www.psicode.org/' +description = """PSI4 is an open-source suite of ab initio quantum chemistry programs designed for + efficient, high-accuracy simulations of a variety of molecular properties. We can routinely perform + computations with more than 2500 basis functions running serially or in parallel.""" + +toolchain = {'name': 'foss', 'version': '2021b'} +toolchainopts = {'usempi': True} + +github_account = 'psi4' +source_urls = [GITHUB_LOWER_SOURCE] +sources = ['v%(version)s.tar.gz'] +patches = [ + 'PSI4-%(version)s_fix_cmake_release.patch', + 'psi4-pythonpath.patch', +] +checksums = [ + 'bdcb9f9a433b5cf8410c7bed006f81fce5b71649bdb1d5b5fac8c8f64829173c', # v1.6.1.tar.gz + '819e40468c5159992a102868c2308079acacdad03d395fed7e98653c3e85cd42', # PSI4-1.6.1_fix_cmake_release.patch + 'e8eeb1413b733fd10a487997066195e2fe8de90a32fb77cb7d84a6e7c550b29b', # psi4-pythonpath.patch +] + +builddependencies = [ + ('CMake', '3.22.1'), + ('Boost', '1.77.0'), + ('Eigen', '3.4.0'), + ('Ninja', '1.10.2'), + ('pytest', '7.1.3'), +] + +dependencies = [ + ('Python', '3.9.6'), + ('libxc', '5.1.6'), + # PCMSolver version 1.3.0 fails Green spherical diffuse test. + # See in more details: https://github.com/PCMSolver/pcmsolver/issues/159 + # ('PCMSolver', '1.3.0'), + ('CheMPS2', '1.8.11'), + ('networkx', '2.6.3'), + ('deepdiff', '5.7.0'), + ('MPFR', '4.1.0'), + ('pydantic', '1.10.2'), + ('Pint', '0.19.2'), + ('py-cpuinfo', '8.0.0'), + ('qcengine', '0.24.1'), + ('libefp', '1.5.0', '-psi4'), + ('cppe', '0.3.1'), + ('pylibefp', '0.6.1', '-qcengine-0.24.1'), + ('dkh', '1.2', '-psi4'), + ('Libint2', '5-4-3-6-5-4_mm4f12ob2', '-lmax-5-psi4'), + ('libecpint', '1.0.7', '-psi4'), + ('gau2grid', '2.0.7', '-lmax-5-psi4'), + ('ambit', '733c529', '-psi4'), + ('gdma', '2.2.6'), + ('simint', '0.7', '-lmax-5-vec-avx-psi4'), + ('cppe', '0.3.1'), + # snsmp2 does not seem to work during the build but it is a runtime option + # so that needs to be loaded after PSI4 is build +] + +configopts = '-DENABLE_MPI=ON -DENABLE_PLUGINS=ON -DENABLE_XHOST=OFF ' +# We are using FlexiBLAS: +configopts += '-DBLAS_TYPE=FLEXIBLAS -DLAPACK_TYPE=FLEXIBLAS ' +# We use libxc etc from EasyBuild: +configopts += '-DLibxc_DIR=${EBROOTLIBXC} -DENABLE_CheMPS2=ON -DENABLE_PCMSolver=OFF ' +# Add packages, coming from EasyBuild and not downloaded +# -DENABLE_simint=ON does not work with intel/2018, so have to make with GCCcore +configopts += '-DENABLE_dkh=ON -DENABLE_gdma=ON -DENABLE_resp=ON -DENABLE_snsmp2=OFF -DENABLE_simint=ON ' +configopts += '-DENABLE_ambit=ON -DENABLE_cppe=ON -DENABLE_adcc=OFF -DENABLE_ecpint=ON -DENABLE_libefp=ON ' +configopts += '-Dlibefp_DIR=${EBROOTLIBEFP} -Dambit_DIR=${EBROOTAMBIT} ' +configopts += '-DENABLE_libint2=OFF ' + +# Install python module to the standard location instead of lib +configopts += '-DPYMOD_INSTALL_LIBDIR=/python%(pyshortver)s/site-packages ' + +# All important testing. The suggtested 'quick' runs 177 test, 'smoke' only 20 +# The full test would be 509 +# Short test of 20 test cases: +# runtest = ' -L smoke' +# Full test of 509 test cases +# runtest = ' ' +# Medium test (continuous integration checks) +runtest = '-L quick' + +modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'} + +sanity_check_commands = ["python -c 'import psi4'"] + +moduleclass = 'chem' diff --git a/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1_fix_cmake_release.patch b/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1_fix_cmake_release.patch new file mode 100644 index 000000000000..242c5f5c517e --- /dev/null +++ b/easybuild/easyconfigs/p/PSI4/PSI4-1.6.1_fix_cmake_release.patch @@ -0,0 +1,95 @@ +# remove CMAKE_BUILD_TYPE check (beacuse it is set to EasyBuildRelease to avoid -O3 optimization flag) +# November 02nd 2018 by B. Hajgato - (Free University Brussels - VUB) +# Adopted to v1.3.2 by Åke Sandgren, HPC2N +# Adopted to v1.6.1 by J. Sassmannshausen (Imperial College London/UK) + +diff --git a/psi4-1.6.1.orig/cmake/autocmake_safeguards.cmake b/psi4-1.6.1/cmake/autocmake_safeguards.cmake +index 7c0a2a9..441080d 100644 +--- a/psi4-1.6.1.orig/cmake/autocmake_safeguards.cmake ++++ b/psi4-1.6.1/cmake/autocmake_safeguards.cmake +@@ -19,8 +19,8 @@ endif() + string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) + string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) + +-if(NOT cmake_build_type_tolower STREQUAL "debug" AND +- NOT cmake_build_type_tolower STREQUAL "release" AND +- NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") +- message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") +-endif() ++#if(NOT cmake_build_type_tolower STREQUAL "debug" AND ++# NOT cmake_build_type_tolower STREQUAL "release" AND ++# NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") ++# message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") ++#endif() +diff --git a/psi4-1.6.1.orig/external/upstream/dkh/CMakeLists.txt b/psi4-1.6.1/external/upstream/dkh/CMakeLists.txt +index a42709f..754c918 100644 +--- a/psi4-1.6.1.orig/external/upstream/dkh/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/dkh/CMakeLists.txt +@@ -15,6 +15,7 @@ if(${ENABLE_dkh}) + ExternalProject_Add(dkh_external + URL https://github.com/psi4/dkh/archive/v1.2.tar.gz + UPDATE_COMMAND "" ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +diff --git a/psi4-1.6.1.orig/external/upstream/gau2grid/CMakeLists.txt b/psi4-1.6.1/external/upstream/gau2grid/CMakeLists.txt +index 6e80ff3..8ca37f3 100644 +--- a/psi4-1.6.1.orig/external/upstream/gau2grid/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/gau2grid/CMakeLists.txt +@@ -15,6 +15,7 @@ else() + DEPENDS pybind11_external + URL https://github.com/dgasmith/gau2grid/archive/v2.0.7.tar.gz + UPDATE_COMMAND "" ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +diff --git a/psi4-1.6.1.orig/external/upstream/gdma/CMakeLists.txt b/psi4-1.6.1/external/upstream/gdma/CMakeLists.txt +index fb003a8..b8d0439 100644 +--- a/psi4-1.6.1.orig/external/upstream/gdma/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/gdma/CMakeLists.txt +@@ -15,6 +15,7 @@ if(${ENABLE_gdma}) + ExternalProject_Add(gdma_external + URL https://github.com/psi4/gdma/archive/9d607d7.tar.gz # v2.2.6-2-g9d607d7 + UPDATE_COMMAND "" ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +diff --git a/psi4-1.6.1.orig/external/upstream/libefp/CMakeLists.txt b/psi4-1.6.1/external/upstream/libefp/CMakeLists.txt +index 2b4d047..8270404 100644 +--- a/psi4-1.6.1.orig/external/upstream/libefp/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/libefp/CMakeLists.txt +@@ -16,6 +16,7 @@ if(${ENABLE_libefp}) + DEPENDS lapack_external + URL https://github.com/ilyak/libefp/archive/15cd7ce.tar.gz # v1.5.0 + 10 (docs and a cmake lapack patch) + UPDATE_COMMAND "" ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +diff --git a/psi4-1.6.1.orig/external/upstream/libint/CMakeLists.txt b/psi4-1.6.1/external/upstream/libint/CMakeLists.txt +index 3e735d2..9a5325e 100644 +--- a/psi4-1.6.1.orig/external/upstream/libint/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/libint/CMakeLists.txt +@@ -15,6 +15,7 @@ else() + ExternalProject_Add(libint_external + # "git checkout" fails on Windows, because of "*" in filenames (e.g. basis set files) + URL https://github.com/loriab/libint/archive/libint_t.tar.gz ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} +diff --git a/psi4-1.6.1.orig/external/upstream/libxc/CMakeLists.txt b/psi4-1.6.1/external/upstream/libxc/CMakeLists.txt +index 9e9b827..ada9c55 100644 +--- a/psi4-1.6.1.orig/external/upstream/libxc/CMakeLists.txt ++++ b/psi4-1.6.1/external/upstream/libxc/CMakeLists.txt +@@ -19,6 +19,7 @@ else() + #GIT_REPOSITORY https://gitlab.com/libxc/libxc.git + #GIT_TAG 5.1.5 + #UPDATE_COMMAND "" ++ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} diff --git a/easybuild/easyconfigs/p/PSI4/psi4-pythonpath.patch b/easybuild/easyconfigs/p/PSI4/psi4-pythonpath.patch new file mode 100644 index 000000000000..314a21567894 --- /dev/null +++ b/easybuild/easyconfigs/p/PSI4/psi4-pythonpath.patch @@ -0,0 +1,27 @@ +Adds the environment PYTHONPATH so modules like numpy get found +Author: J. Sassmannshausen (Imperial College London/UK) +diff --git a/psi4-1.6.1.orig/cmake/TestingMacros.cmake b/psi4-1.6.1/cmake/TestingMacros.cmake +index 07074a7..9498db7 100644 +--- a/psi4-1.6.1.orig/cmake/TestingMacros.cmake ++++ b/psi4-1.6.1/cmake/TestingMacros.cmake +@@ -46,7 +46,7 @@ macro(add_regression_test _name _labels) + ) + set_tests_properties("${_name}" + PROPERTIES +- ENVIRONMENT PYTHONPATH=${PSILIB}) ++ ENVIRONMENT PYTHONPATH=${PSILIB}:$ENV{PYTHONPATH}) + + if(labels) + set_tests_properties(${_name} PROPERTIES LABELS "${labels}") +diff --git a/psi4-1.6.1.orig/tests/pytests/CMakeLists.txt b/psi4-1.6.1/tests/pytests/CMakeLists.txt +index 39a92e3..15b6993 100644 +--- a/psi4-1.6.1.orig/tests/pytests/CMakeLists.txt ++++ b/psi4-1.6.1/tests/pytests/CMakeLists.txt +@@ -14,6 +14,6 @@ endif() + + # A single command to remake and run the pytest smoke tests + add_custom_target(pytest +- COMMAND PYTHONPATH=${STAGED_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${PYMOD_INSTALL_LIBDIR} ++ COMMAND PYTHONPATH=${STAGED_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${PYMOD_INSTALL_LIBDIR}:$ENV{PYTHONPATH} + ${Python_EXECUTABLE} -m pytest -rws -v -m smoke --capture=sys ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})