openmolcas: 24.10 -> 25.02 (#399186)

authored by Markus Kowalewski and committed by GitHub d5b441b8 31505d13

+131 -62
+22
pkgs/by-name/op/openmolcas/nevpt2.patch
··· 1 + diff --git a/src/gctime.c b/src/gctime.c 2 + index 34fcb6f..832459c 100644 3 + --- a/src/gctime.c 4 + +++ b/src/gctime.c 5 + @@ -1,14 +1,15 @@ 6 + +#include <string.h> 7 + typedef long f77_int; /* Fortran integer type */ 8 + typedef char * f77_char; /* Fortran character argument */ 9 + #define CH_F2C(X) ((char *) (X)) /* How to get char ptr from F77 argument */ 10 + -gctime (fstr, lstr) f77_char *fstr; int lstr; { 11 + +int gctime (fstr, lstr) f77_char *fstr; int lstr; { 12 + long time(), t; 13 + char *ctime(); 14 + t = time ( (long *) 0); 15 + strcpy(CH_F2C(fstr),ctime(&t)); 16 + return (0); 17 + } 18 + -gctime_(fstr, lstr) f77_char *fstr; int lstr; { 19 + +int gctime_(fstr, lstr) f77_char *fstr; int lstr; { 20 + long time(), t; 21 + char *ctime(); 22 + t = time ( (long *) 0);
-12
pkgs/by-name/op/openmolcas/openblasPath.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 276ae4e2..db13e6e3 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -1507,7 +1507,6 @@ if (LINALG STREQUAL "OpenBLAS") 6 - NAMES openblas 7 - PATHS ${OPENBLASROOT} 8 - PATH_SUFFIXES lib 9 - - NO_DEFAULT_PATH 10 - ) 11 - 12 - if (NOT LIBOPENBLAS)
+54 -50
pkgs/by-name/op/openmolcas/package.nix
··· 7 7 gfortran, 8 8 perl, 9 9 blas-ilp64, 10 + lapack-ilp64, 10 11 hdf5-cpp, 11 12 python3, 12 13 texliveMinimal, ··· 16 17 gsl, 17 18 boost, 18 19 autoPatchelfHook, 19 - enableQcmaquis ? false, 20 + enableQcmaquis ? true, 20 21 # Note that the CASPT2 module is broken with MPI 21 22 # See https://gitlab.com/Molcas/OpenMolcas/-/issues/169 22 23 enableMpi ? false, ··· 25 26 }: 26 27 27 28 assert blas-ilp64.isILP64; 28 - assert lib.elem blas-ilp64.passthru.implementation [ 29 - "openblas" 30 - "mkl" 31 - ]; 32 - assert enableQcmaquis -> lib.elem blas-ilp64.passthru.implementation "mkl"; 29 + assert lapack-ilp64.isILP64; 33 30 34 31 let 35 32 python = python3.withPackages ( ··· 46 43 rev = "release-3.1.4"; # Must match tag in cmake/custom/qcmaquis.cmake 47 44 hash = "sha256-vhC5k+91IPFxdCi5oYt1NtF9W08RxonJjPpA0ls4I+o="; 48 45 }; 49 - nevtp2Src = fetchFromGitHub { 50 - owner = "qcscine"; 51 - repo = "nevpt2"; 52 - rev = "e1484fd"; # Must match tag in cmake/custom/nevpt2.cmake 53 - hash = "sha256-Vl+FhwhJBbD/7U2CwsYE9BClSQYLJ8DKXV9EXxQUmz0="; 46 + 47 + # NEVPT2 sources must be patched to be valid C code in gctime.c 48 + nevpt2Src = stdenv.mkDerivation { 49 + pname = "nevpt2-src"; 50 + version = "unstable"; 51 + phases = [ 52 + "unpackPhase" 53 + "patchPhase" 54 + "installPhase" 55 + ]; 56 + src = fetchFromGitHub { 57 + owner = "qcscine"; 58 + repo = "nevpt2"; 59 + rev = "e1484fd"; # Must match tag in cmake/custom/nevpt2.cmake 60 + hash = "sha256-Vl+FhwhJBbD/7U2CwsYE9BClSQYLJ8DKXV9EXxQUmz0="; 61 + }; 62 + patches = [ ./nevpt2.patch ]; 63 + installPhase = '' 64 + mkdir $out 65 + cp -r * $out/. 66 + ''; 54 67 }; 55 68 56 69 in 57 70 stdenv.mkDerivation rec { 58 71 pname = "openmolcas"; 59 - version = "24.10"; 72 + version = "25.02"; 60 73 61 74 src = fetchFromGitLab { 62 75 owner = "Molcas"; 63 76 repo = "OpenMolcas"; 64 77 rev = "v${version}"; 65 - hash = "sha256-LXxr/xqBHG7a0rOBrb8IMZ4IjZak3NsBw40Qf+z1fic="; 78 + hash = "sha256-Ty7C7zj1lQixuUzeKLcwQCmcPexZXtIGDzp1wUMKDi0="; 66 79 }; 67 80 68 81 patches = [ 69 - # Required to handle openblas multiple outputs 70 - ./openblasPath.patch 71 - 72 - # Required for a local QCMaquis build 82 + # Required for a local QCMaquis build. Also sanitises QCMaquis BLAS/LAPACK handling 73 83 ./qcmaquis.patch 74 84 ]; 75 85 ··· 83 93 --subst-var-by "qcmaquis_src_url" "file://${qcmaquisSrc}" 84 94 85 95 substituteInPlace cmake/custom/nevpt2.cmake \ 86 - --subst-var-by "nevpt2_src_url" "file://${nevtp2Src}" 96 + --subst-var-by "nevpt2_src_url" "file://${nevpt2Src}" 87 97 ''; 88 98 89 99 nativeBuildInputs = [ ··· 97 107 98 108 buildInputs = 99 109 [ 100 - blas-ilp64.passthru.provider 101 110 hdf5-cpp 102 111 python 103 112 armadillo 104 113 libxc 105 114 gsl.dev 106 115 boost 116 + blas-ilp64 117 + lapack-ilp64 107 118 ] 108 119 ++ lib.optionals enableMpi [ 109 120 mpi ··· 112 123 113 124 passthru = lib.optionalAttrs enableMpi { inherit mpi; }; 114 125 115 - cmakeFlags = 116 - [ 117 - "-DOPENMP=ON" 118 - "-DTOOLS=ON" 119 - "-DHDF5=ON" 120 - "-DFDE=ON" 121 - "-DEXTERNAL_LIBXC=${lib.getDev libxc}" 122 - (lib.strings.cmakeBool "DMRG" enableQcmaquis) 123 - (lib.strings.cmakeBool "NEVPT2" enableQcmaquis) 124 - "-DCMAKE_SKIP_BUILD_RPATH=ON" 125 - (lib.strings.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic) 126 - (lib.strings.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) 127 - ] 128 - ++ lib.optionals (blas-ilp64.passthru.implementation == "openblas") [ 129 - "-DOPENBLASROOT=${blas-ilp64.passthru.provider.dev}" 130 - "-DLINALG=OpenBLAS" 131 - ] 132 - ++ lib.optionals (blas-ilp64.passthru.implementation == "mkl") [ 133 - "-DMKLROOT=${blas-ilp64.passthru.provider}" 134 - "-DLINALG=MKL" 135 - ] 136 - ++ lib.optionals enableMpi [ 137 - "-DGA=ON" 138 - "-DMPI=ON" 139 - ]; 140 - 141 - preConfigure = lib.optionalString enableMpi '' 142 - export GAROOT=${globalarrays}; 143 - ''; 126 + preConfigure = 127 + '' 128 + cmakeFlagsArray+=( 129 + "-DOPENMP=ON" 130 + "-DTOOLS=ON" 131 + "-DHDF5=ON" 132 + "-DFDE=ON" 133 + "-DEXTERNAL_LIBXC=${lib.getDev libxc}" 134 + ${lib.strings.cmakeBool "DMRG" enableQcmaquis} 135 + ${lib.strings.cmakeBool "NEVPT2" enableQcmaquis} 136 + "-DCMAKE_SKIP_BUILD_RPATH=ON" 137 + ${lib.strings.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic} 138 + ${lib.strings.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)} 139 + "-DLINALG=Manual" 140 + "-DLINALG_LIBRARIES=-lblas -llapack" 141 + ${lib.strings.cmakeBool "DGA" enableMpi} 142 + ${lib.strings.cmakeBool "MPI" enableMpi} 143 + ) 144 + '' 145 + + lib.optionalString enableMpi '' 146 + export GAROOT=${globalarrays}; 147 + ''; 144 148 149 + # The Makefile will install pymolcas during the build grrr. 145 150 postConfigure = '' 146 - # The Makefile will install pymolcas during the build grrr. 147 151 mkdir -p $out/bin 148 152 export PATH=$PATH:$out/bin 149 153 ''; ··· 158 162 # removed by autopatchelf 159 163 noAuditTmpdir = true; 160 164 165 + # Wrong store path in shebang (bare Python, no Python pkgs), force manual re-patching 161 166 postFixup = '' 162 - # Wrong store path in shebang (bare Python, no Python pkgs), force manual re-patching 163 167 for exe in $(find $out/bin/ -type f -name "*.py"); do 164 168 sed -i "1s:.*:#!${python}/bin/python:" "$exe" 165 169 done
+55
pkgs/by-name/op/openmolcas/qcmaquis.patch
··· 45 45 SOURCE_SUBDIR dmrg 46 46 CMAKE_ARGS ${EP_CMAKE_ARGS} 47 47 CMAKE_CACHE_ARGS ${EP_CMAKE_CACHE_ARGS} 48 + diff --git a/cmake/custom/qcmaquis.cmake b/cmake/custom/qcmaquis.cmake 49 + index 5fd1ef207..4291ec3d7 100644 50 + --- a/cmake/custom/qcmaquis.cmake 51 + +++ b/cmake/custom/qcmaquis.cmake 52 + @@ -94,47 +94,9 @@ if (NOT MAQUIS_DMRG_FOUND) # Does the opposite work? 53 + ) 54 + endif (BOOST_ROOT) 55 + 56 + - if (LINALG STREQUAL "Manual") 57 + - target_files (LINALG_LIBRARIES_FILES ${LINALG_LIBRARIES}) 58 + - list (APPEND LINALG_LIBRARIES_FILES ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) 59 + - string (REPLACE ";" '\' LINALG_LIBRARIES_FILES "${LINALG_LIBRARIES_FILES}") 60 + - list (APPEND QCMaquisCMakeArgs 61 + - "-DBLAS_LAPACK_SELECTOR=manual" 62 + - "-DMAQUISLapack_LIBRARIES=${LINALG_LIBRARIES_FILES}" 63 + - ) 64 + - elseif (LINALG STREQUAL "MKL") 65 + - list (APPEND QCMaquisCMakeArgs 66 + - "-DBLAS_LAPACK_SELECTOR=mkl_sequential" 67 + - ) 68 + - elseif (LINALG STREQUAL "OpenBLAS") 69 + - list (APPEND QCMaquisCMakeArgs 70 + - "-DBLAS_LAPACK_SELECTOR=openblas" 71 + - "-DOPENBLASROOT=${OPENBLASROOT}" 72 + - ) 73 + - elseif (LINALG STREQUAL "Accelerate") 74 + - list (APPEND QCMaquisCMakeArgs 75 + - "-DBLAS_LAPACK_SELECTOR:STRING=veclib" 76 + - ) 77 + - elseif (LINALG STREQUAL "Internal") 78 + - 79 + - # To link QCMaquis with Fortran static libraries, we 80 + - # need to add -lgfortran for gfortran 81 + - # It seems that ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES} 82 + - # is not suited for this because it contains also other unnecessary libraries 83 + - 84 + - # for some reason, the list does not work if the generator expression -lgfortran is not first 85 + - # but for correct linking it needs to be last AND with a prepended "-l" 86 + - if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") 87 + - set (Fortran_RUNTIME_LIBRARY "gfortran") 88 + - endif () 89 + - 90 + - list (APPEND QCMaquisCMakeArgs 91 + - "-DBLAS_LAPACK_SELECTOR=manual" 92 + - "-DMAQUISLapack_LIBRARIES=$<$<BOOL:Fortran_RUNTIME_LIBRARY>:${Fortran_RUNTIME_LIBRARY}\ >$<TARGET_FILE:blas>\ $<TARGET_FILE:lapack>\ $<TARGET_FILE:blas>\ -l$<$<BOOL:Fortran_RUNTIME_LIBRARY>:${Fortran_RUNTIME_LIBRARY}>" 93 + - ) 94 + - else () 95 + - message (FATAL_ERROR "LINALG=${LINALG} is not supported by QCMaquis") 96 + - endif () 97 + + list (APPEND QCMaquisCMakeArgs 98 + + "-DBLAS_LAPACK_SELECTOR=auto" 99 + + ) 100 + 101 + # Enabling source changes to keep ExternalProject happy 102 + set (CMAKE_DISABLE_SOURCE_CHANGES OFF