Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions easybuild/easyconfigs/p/PSI4/PSI4-1.5-foss-2021b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This is hopefully a signifcant improvement over the existing way of installing it.
# It does not rely on downloading the packages any more, they are build with EasyBuild
# and thus can be tested separately. It also has more modules enabled per default.
# Finally, a ctest -j 4 -L quick will run in 251.59 sec
# Note: The PCMSolver is disabled as the Green test is failing
# Author: J. Sassmannshausen (Imperial College London)

easyblock = 'EB_PSI'

name = 'PSI4'
version = '1.5'

homepage = 'https://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}

source_urls = ['https://github.com/psi4/psi4/archive']
sources = ['v%(version)s.tar.gz']
patches = [
'PSI4-%(version)s_fix_cmake_release.patch',
'psi4-pythonpath.patch',
]
checksums = [
'e1f1446c553e6dddf0f19216c2cfbae49d939196022c55c89226ee047cfa0d34', # v1.5.tar.gz
'f89081e09c16f4ddba0e4a53ae389d99330754f575e18e00128cb74cd33de43b', # PSI4-1.5_fix_cmake_release.patch
'e8eeb1413b733fd10a487997066195e2fe8de90a32fb77cb7d84a6e7c550b29b', # psi4-pythonpath.patch
]

builddependencies = [
('CMake', '3.21.1'),
('Boost', '1.79.0'),
('Eigen', '3.4.0'),
('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'),
('pylibefp', '0.6.1', '-qcengine-0.24.1'),
('dkh', '1.2', '-psi4'),
('Libint2', '5-4-3-6-5-4_1', '-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'),
]


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=OFF -DENABLE_adcc=OFF -DENABLE_ecpint=ON -DENABLE_libefp=ON '
configopts += '-Dlibefp_DIR=${EBROOTLIBEFP} -Dambit_DIR=${EBROOTAMBIT} '

# 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'
107 changes: 107 additions & 0 deletions easybuild/easyconfigs/p/PSI4/PSI4-1.5_fix_cmake_release.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# 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 <C3><85>ke Sandgren, HPC2N
# Adopted to v1.5 by J. Sassmannshausen
diff --git a/psi4-1.5.orig/cmake/autocmake_safeguards.cmake b/psi4-1.5/cmake/autocmake_safeguards.cmake
index 7c0a2a9..9a5f6ab 100644
--- a/psi4-1.5.orig/cmake/autocmake_safeguards.cmake
+++ b/psi4-1.5/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.5.orig/external/upstream/dkh/CMakeLists.txt b/psi4-1.5/external/upstream/dkh/CMakeLists.txt
index 180a405..3f5e83b 100644
--- a/psi4-1.5.orig/external/upstream/dkh/CMakeLists.txt
+++ b/psi4-1.5/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.5.orig/external/upstream/gau2grid/CMakeLists.txt b/psi4-1.5/external/upstream/gau2grid/CMakeLists.txt
index 9a592e6..7ef8c37 100644
--- a/psi4-1.5.orig/external/upstream/gau2grid/CMakeLists.txt
+++ b/psi4-1.5/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.5.orig/external/upstream/gdma/CMakeLists.txt b/psi4-1.5/external/upstream/gdma/CMakeLists.txt
index 7b217ce..a4189b3 100644
--- a/psi4-1.5.orig/external/upstream/gdma/CMakeLists.txt
+++ b/psi4-1.5/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.5.orig/external/upstream/libefp/CMakeLists.txt b/psi4-1.5/external/upstream/libefp/CMakeLists.txt
index b3cf147..3998857 100644
--- a/psi4-1.5.orig/external/upstream/libefp/CMakeLists.txt
+++ b/psi4-1.5/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.5.orig/external/upstream/libint/CMakeLists.txt b/psi4-1.5/external/upstream/libint/CMakeLists.txt
index 3e735d2..9a5325e 100644
--- a/psi4-1.5.orig/external/upstream/libint/CMakeLists.txt
+++ b/psi4-1.5/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.5.orig/external/upstream/libint2/CMakeLists.txt b/psi4-1.5/external/upstream/libint2/CMakeLists.txt
index 212b404..91421f9 100644
--- a/psi4-1.5.orig/external/upstream/libint2/CMakeLists.txt
+++ b/psi4-1.5/external/upstream/libint2/CMakeLists.txt
@@ -73,6 +73,7 @@ else()

ExternalProject_Add(libint2_external
URL ${_url_l2_tarball}
+ PATCH_COMMAND sed -e "s/debug/easybuildrelease/" -i cmake/autocmake_safeguards.cmake
CMAKE_ARGS -GNinja
-DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
diff --git a/psi4-1.5.orig/external/upstream/libxc/CMakeLists.txt b/psi4-1.5/external/upstream/libxc/CMakeLists.txt
index 27ac507..b6352e2 100644
--- a/psi4-1.5.orig/external/upstream/libxc/CMakeLists.txt
+++ b/psi4-1.5/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}
27 changes: 27 additions & 0 deletions easybuild/easyconfigs/p/PSI4/psi4-pythonpath.patch
Original file line number Diff line number Diff line change
@@ -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})