From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Brown Subject: bug#32691: OpenMolcas Date: Mon, 10 Sep 2018 23:23:42 -0500 Message-ID: <87d0tkk6gh.fsf@fastmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzaEd-0005HZ-Vc for bug-guix@gnu.org; Tue, 11 Sep 2018 00:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzaEZ-0007eH-EE for bug-guix@gnu.org; Tue, 11 Sep 2018 00:25:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzaEZ-0007eD-6c for bug-guix@gnu.org; Tue, 11 Sep 2018 00:25:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzaEZ-0004Z6-0w for bug-guix@gnu.org; Tue, 11 Sep 2018 00:25:03 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzaDd-0004fA-Ij for bug-guix@gnu.org; Tue, 11 Sep 2018 00:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzaDS-0006fU-Ju for bug-guix@gnu.org; Tue, 11 Sep 2018 00:24:02 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzaDK-0006bY-Tq for bug-guix@gnu.org; Tue, 11 Sep 2018 00:23:49 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4CA1D21F05 for ; Tue, 11 Sep 2018 00:23:44 -0400 (EDT) Received: from localhost (c-24-12-214-32.hsd1.il.comcast.net [24.12.214.32]) by mail.messagingengine.com (Postfix) with ESMTPA id BAE7E102A2 for ; Tue, 11 Sep 2018 00:23:43 -0400 (EDT) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 32691@debbugs.gnu.org --=-=-= Content-Type: text/plain Dear Guix: I am pleased to submit a patch that adds OpenMolcas to Guix. Also included in this submission is a new variable called `openblas-ilp64' which OpenMolcas needs to compile and run. I would like to point out that I have already submitted the openblas-ilp64 patch to the list for approval, and I am aware that this submission may need to be revised to include just the program of immediate interest. Best regards, Eric --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-openmolcas-and-openblas-ilp64.patch Content-Transfer-Encoding: quoted-printable >From 784cb74747adcc513b75b16b9247bd3dc9a484a3 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Mon, 10 Sep 2018 23:12:51 -0500 Subject: [PATCH] gnu: Add openmolcas and openblas-ilp64. * gnu/packages/chemistry.scm (openmolcas): New variable. * gnu/packages/maths.scm (openblas-ilp64): New variable. --- gnu/packages/chemistry.scm | 55 ++++++++ gnu/packages/maths.scm | 71 ++++++++++ .../openmolcas-pymolcas-openblas.patch | 131 ++++++++++++++++++ 3 files changed, 257 insertions(+) create mode 100644 gnu/packages/patches/openmolcas-pymolcas-openblas.patch diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 03120aaee..b4064ee8c 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2018 Konrad Hinsen ;;; Copyright =C2=A9 2018 Kei Kebreau +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,12 +27,16 @@ #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) + #:use-module (gnu packages gcc) + #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) #:use-module (gnu packages gv) #:use-module (gnu packages maths) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages qt) + #:use-module (gnu packages tex) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) @@ -322,3 +327,53 @@ chemical data. It's a collaborative project allowing = anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas.") (license license:gpl2))) + +(define-public openmolcas + (package + (name "openmolcas") + (version "18.09") + (source (origin + (method url-fetch) + (uri (string-append "https://gitlab.com/Molcas/OpenMolcas" + "/-/archive/v" version "/OpenMolcas-v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1krrkff5b4zp9ii1m9v3zzw8d99k72fcwwv3rif8cp10cpxi1wxl")) + (patches (search-patches "openmolcas-pymolcas-openblas.patch= ")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #t + #:tests? #f + #:build-type "Release" + #:parallel-build? #t + #:configure-flags + (list "-DLINALG=3DOpenBLAS" + (string-append "-DOPENBLASROOT=3D" + (assoc-ref %build-inputs "blas")) + (string-append "-DLINALG_LIBRARIES=3D" + (assoc-ref %build-inputs "blas") + "/lib/libopenblas_ilp64.so")))) + (native-inputs + `(("fortran" ,gfortran) + ("gcc" ,gcc) + ("ghostscript" ,ghostscript) + ("hdf5" ,hdf5) + ("blas" ,openblas-ilp64) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-pyparsing" ,python-pyparsing) + ("python-six" ,python-six) + ("texlive" ,texlive))) + (inputs + `()) + (home-page "https://gitlab.com/Molcas/OpenMolcas") + (synopsis "Multi-reference electronic structure theory program") + (description "OpenMolcas is a quantum chemistry software package devel= oped +by scientists and intended to be used by scientists. It includes programs = to +apply many different electronic structure methods to chemical systems, but= its +key feature is the multiconfigurational approach, with methods like CASSCF= and +CASPT2.") + (license license:lgpl2.1))) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 01bd03c60..5f1dfec8a 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -27,6 +27,7 @@ ;;; Copyright =C2=A9 2018 Nadya Voronova ;;; Copyright =C2=A9 2018 Adam Massmann ;;; Copyright =C2=A9 2018 Marius Bakke +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -2909,6 +2910,76 @@ parts of it.") "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n.") (license license:bsd-3))) =20 +(define-public openblas-ilp64 + (package + (name "openblas-ilp64") + (version "0.3.2") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/openblas/v" version "/Ope= nBLAS%20" + version "%20version.tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "test" + ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and = no + ;; TARGET is specified, OpenBLAS will tune itself to the build host= , so + ;; we need to disable substitutions. + #:substitutable? + ,(let ((system (or (%current-target-system) (%current-system)))) + (or (string-prefix? "x86_64" system) + (string-prefix? "i686" system) + (string-prefix? "mips" system) + (string-prefix? "aarch64" system))) + #:make-flags + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out")) + "SHELL=3Dbash" + ;; Build the library for all supported CPUs. This allows + ;; switching CPU targets at runtime with the environment vari= able + ;; OPENBLAS_CORETYPE=3D, where "type" is a supported CP= U type. + ;; Unfortunately, this is not supported on non-x86 architectu= res, + ;; where it leads to failed builds. + ,@(let ((system (or (%current-target-system) (%current-system= )))) + (cond + ((or (string-prefix? "x86_64" system) + (string-prefix? "i686" system)) + '("DYNAMIC_ARCH=3D1" "INTERFACE64=3D1" "LIBNAMESUFFIX= =3Dilp64")) + ;; On MIPS we force the "SICORTEX" TARGET, as for the ot= her + ;; two available MIPS targets special extended instructi= ons + ;; for Loongson cores are used. + ((string-prefix? "mips" system) + '("TARGET=3DSICORTEX" "INTERFACE64=3D1" "LIBNAMESUFFIX= =3Dilp64")) + ;; On aarch64 force the generic 'armv8-a' target + ((string-prefix? "aarch64" system) + '("TARGET=3DARMV8" "INTERFACE64=3D1" "LIBNAMESUFFIX=3Di= lp64")) + (else '("INTERFACE64=3D1" "LIBNAMESUFFIX=3Dilp64"))))) + ;; no configure script + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-extralib + (lambda* (#:key inputs #:allow-other-keys) + ;; Get libgfortran found when building in utest. + (setenv "FEXTRALIB" + (string-append "-L" (assoc-ref inputs "fortran-lib") + "/lib")) + #t))))) + (inputs + `(("fortran-lib" ,gfortran "lib"))) + (native-inputs + `(("cunit" ,cunit) + ("fortran" ,gfortran) + ("perl" ,perl))) + (home-page "http://www.openblas.net/") + (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") + (description + "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n. (ILP64 version)") + (license license:bsd-3))) + (define* (make-blis implementation #:optional substitutable?) "Return a BLIS package with the given IMPLEMENTATION (see config/ in the source tree for a list of implementations.) diff --git a/gnu/packages/patches/openmolcas-pymolcas-openblas.patch b/gnu/= packages/patches/openmolcas-pymolcas-openblas.patch new file mode 100644 index 000000000..2c7feade6 --- /dev/null +++ b/gnu/packages/patches/openmolcas-pymolcas-openblas.patch @@ -0,0 +1,131 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a4071fd..53d8df5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1338,42 +1338,43 @@ if (LINALG STREQUAL "OpenBLAS") + endif () +=20 + # search for the OpenBLAS library +- find_library (LIBOPENBLAS +- NAMES openblas +- PATHS ${OPENBLASROOT} +- PATH_SUFFIXES lib +- NO_DEFAULT_PATH) +- +- if (NOT LIBOPENBLAS) +- message (FATAL_ERROR +- "OpenBLAS library not found, please check that " +- "the OPENBLASROOT variable is set and points to " +- "a valid OpenBLAS installation directory." +- ) +- endif () +- +- # here we check if LIBOPENBLAS has changed after it was processed +- # succesfully, if not we do not need to rerun anything here. +- if (NOT LIBOPENBLAS STREQUAL LIBOPENBLAS_LAST) +- # check if the OpenBLAS library contains LAPACK functiona= lity +- message ("-- Checking OpenBLAS for LAPACK functionality..= .") +- include(CheckFortranFunctionExists) +- set (CMAKE_REQUIRED_LIBRARIES ${LIBOPENBLAS}) +- unset (OPENBLAS_WITH_LAPACK CACHE) +- check_fortran_function_exists("dsyev" OPENBLAS_WITH_LAPAC= K) +- if (NOT OPENBLAS_WITH_LAPACK) +- unset (LIBOPENBLAS CACHE) +- message (FATAL_ERROR +- "LAPACK functionality missing from OpenBL= AS library, " +- "please build OpenBLAS with NO_LAPACK=3D0= defined." +- ) +- endif () +- # save the last location to check if it changed between c= onfigurations +- set (LIBOPENBLAS_LAST ${LIBOPENBLAS} CACHE INTERNAL "last= value." FORCE) +- endif () +- +- add_definitions (-D_OPENBLAS_) +- set (LINALG_LIBRARIES ${LIBOPENBLAS}) ++# find_library (LIBOPENBLAS ++# NAMES openblas ++# PATHS ${OPENBLASROOT} ++# PATH_SUFFIXES lib ++# NO_DEFAULT_PATH) ++# ++# if (NOT LIBOPENBLAS) ++# message (FATAL_ERROR ++# "OpenBLAS library not found, please check that " ++# "the OPENBLASROOT variable is set and points to " ++# "a valid OpenBLAS installation directory." ++# ) ++# endif () ++# ++# # here we check if LIBOPENBLAS has changed after it was processed ++# # succesfully, if not we do not need to rerun anything here. ++# if (NOT LIBOPENBLAS STREQUAL LIBOPENBLAS_LAST) ++# # check if the OpenBLAS library contains LAPACK function= ality ++# message ("-- Checking OpenBLAS for LAPACK functionality.= ..") ++# include(CheckFortranFunctionExists) ++# set (CMAKE_REQUIRED_LIBRARIES ${LIBOPENBLAS}) ++# unset (OPENBLAS_WITH_LAPACK CACHE) ++# check_fortran_function_exists("dsyev" OPENBLAS_WITH_LAPA= CK) ++# if (NOT OPENBLAS_WITH_LAPACK) ++# unset (LIBOPENBLAS CACHE) ++# message (FATAL_ERROR ++# "LAPACK functionality missing from OpenB= LAS library, " ++# "please build OpenBLAS with NO_LAPACK=3D= 0 defined." ++# ) ++# endif () ++# # save the last location to check if it changed between = configurations ++# set (LIBOPENBLAS_LAST ${LIBOPENBLAS} CACHE INTERNAL "las= t value." FORCE) ++# endif () ++# ++ add_definitions (-D_OPENBLAS_) ++# set (LINALG_LIBRARIES ${LIBOPENBLAS}) ++ set (LINALG_LIBRARIES ${LINALG_LIBRARIES}) + else () + mark_as_advanced(FORCE OPENBLASROOT) + endif () +@@ -3167,11 +3168,11 @@ install (PROGRAMS + if (DEFINED PYMOLCAS_TARGET) + install (PROGRAMS + ${PYMOLCAS_TARGET} +- DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + RENAME pymolcas + ) +=20 +- install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/ins= tall_pymolcas.sh ${PYMOLCAS_TARGET})") ++# install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/in= stall_pymolcas.sh ${PYMOLCAS_TARGET})") + endif () +=20 + if (DEFINED EXTRA_DIR) +@@ -3188,9 +3189,9 @@ if (DEFINED EXTRA_DIR) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + ) +=20 +- install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/ins= tall_driver.sh ${MOLCAS_DRIVER})") ++# install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/in= stall_driver.sh ${MOLCAS_DRIVER})") + endif () +=20 +-if (IS_DIRECTORY "$ENV{HOME}/.Molcas") +- install (CODE "execute_process(COMMAND sh \"-c\" \"cd ${CMAKE_INS= TALL_PREFIX}; echo `pwd` > $HOME/.Molcas/molcas 2> /dev/null\")") +-endif () ++#if (IS_DIRECTORY "$ENV{HOME}/.Molcas") ++# install (CODE "execute_process(COMMAND sh \"-c\" \"cd ${CMAKE_IN= STALL_PREFIX}; echo `pwd` > $HOME/.Molcas/molcas 2> /dev/null\")") ++#endif () +diff --git a/Tools/pymolcas/CMakeLists.txt b/Tools/pymolcas/CMakeLists.txt +index 0d576fa..f9ba6d7 100644 +--- a/Tools/pymolcas/CMakeLists.txt ++++ b/Tools/pymolcas/CMakeLists.txt +@@ -52,9 +52,9 @@ if (PYTHONINTERP_FOUND) + DEPENDS ${PYMOLCAS_TARGET} + ) +=20 +- add_custom_command (TARGET pymolcas +- POST_BUILD +- COMMAND ${OPENMOLCAS_DIR}/sbin/install_pymolcas.s= h ${PYMOLCAS_TARGET} +- ) ++# add_custom_command (TARGET pymolcas ++# POST_BUILD ++# COMMAND ${OPENMOLCAS_DIR}/sbin/install_pymolcas.= sh ${PYMOLCAS_TARGET} ++# ) +=20 + endif () + --=20 2.18.0 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-openmolcas-and-openblas-ilp64.patch Content-Transfer-Encoding: quoted-printable >From 784cb74747adcc513b75b16b9247bd3dc9a484a3 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Mon, 10 Sep 2018 23:12:51 -0500 Subject: [PATCH] gnu: Add openmolcas and openblas-ilp64. * gnu/packages/chemistry.scm (openmolcas): New variable. * gnu/packages/maths.scm (openblas-ilp64): New variable. --- gnu/packages/chemistry.scm | 55 ++++++++ gnu/packages/maths.scm | 71 ++++++++++ .../openmolcas-pymolcas-openblas.patch | 131 ++++++++++++++++++ 3 files changed, 257 insertions(+) create mode 100644 gnu/packages/patches/openmolcas-pymolcas-openblas.patch diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 03120aaee..b4064ee8c 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2018 Konrad Hinsen ;;; Copyright =C2=A9 2018 Kei Kebreau +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,12 +27,16 @@ #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) + #:use-module (gnu packages gcc) + #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) #:use-module (gnu packages gv) #:use-module (gnu packages maths) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages qt) + #:use-module (gnu packages tex) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) @@ -322,3 +327,53 @@ chemical data. It's a collaborative project allowing = anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas.") (license license:gpl2))) + +(define-public openmolcas + (package + (name "openmolcas") + (version "18.09") + (source (origin + (method url-fetch) + (uri (string-append "https://gitlab.com/Molcas/OpenMolcas" + "/-/archive/v" version "/OpenMolcas-v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1krrkff5b4zp9ii1m9v3zzw8d99k72fcwwv3rif8cp10cpxi1wxl")) + (patches (search-patches "openmolcas-pymolcas-openblas.patch= ")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #t + #:tests? #f + #:build-type "Release" + #:parallel-build? #t + #:configure-flags + (list "-DLINALG=3DOpenBLAS" + (string-append "-DOPENBLASROOT=3D" + (assoc-ref %build-inputs "blas")) + (string-append "-DLINALG_LIBRARIES=3D" + (assoc-ref %build-inputs "blas") + "/lib/libopenblas_ilp64.so")))) + (native-inputs + `(("fortran" ,gfortran) + ("gcc" ,gcc) + ("ghostscript" ,ghostscript) + ("hdf5" ,hdf5) + ("blas" ,openblas-ilp64) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-pyparsing" ,python-pyparsing) + ("python-six" ,python-six) + ("texlive" ,texlive))) + (inputs + `()) + (home-page "https://gitlab.com/Molcas/OpenMolcas") + (synopsis "Multi-reference electronic structure theory program") + (description "OpenMolcas is a quantum chemistry software package devel= oped +by scientists and intended to be used by scientists. It includes programs = to +apply many different electronic structure methods to chemical systems, but= its +key feature is the multiconfigurational approach, with methods like CASSCF= and +CASPT2.") + (license license:lgpl2.1))) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 01bd03c60..5f1dfec8a 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -27,6 +27,7 @@ ;;; Copyright =C2=A9 2018 Nadya Voronova ;;; Copyright =C2=A9 2018 Adam Massmann ;;; Copyright =C2=A9 2018 Marius Bakke +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -2909,6 +2910,76 @@ parts of it.") "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n.") (license license:bsd-3))) =20 +(define-public openblas-ilp64 + (package + (name "openblas-ilp64") + (version "0.3.2") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/openblas/v" version "/Ope= nBLAS%20" + version "%20version.tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "test" + ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and = no + ;; TARGET is specified, OpenBLAS will tune itself to the build host= , so + ;; we need to disable substitutions. + #:substitutable? + ,(let ((system (or (%current-target-system) (%current-system)))) + (or (string-prefix? "x86_64" system) + (string-prefix? "i686" system) + (string-prefix? "mips" system) + (string-prefix? "aarch64" system))) + #:make-flags + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out")) + "SHELL=3Dbash" + ;; Build the library for all supported CPUs. This allows + ;; switching CPU targets at runtime with the environment vari= able + ;; OPENBLAS_CORETYPE=3D, where "type" is a supported CP= U type. + ;; Unfortunately, this is not supported on non-x86 architectu= res, + ;; where it leads to failed builds. + ,@(let ((system (or (%current-target-system) (%current-system= )))) + (cond + ((or (string-prefix? "x86_64" system) + (string-prefix? "i686" system)) + '("DYNAMIC_ARCH=3D1" "INTERFACE64=3D1" "LIBNAMESUFFIX= =3Dilp64")) + ;; On MIPS we force the "SICORTEX" TARGET, as for the ot= her + ;; two available MIPS targets special extended instructi= ons + ;; for Loongson cores are used. + ((string-prefix? "mips" system) + '("TARGET=3DSICORTEX" "INTERFACE64=3D1" "LIBNAMESUFFIX= =3Dilp64")) + ;; On aarch64 force the generic 'armv8-a' target + ((string-prefix? "aarch64" system) + '("TARGET=3DARMV8" "INTERFACE64=3D1" "LIBNAMESUFFIX=3Di= lp64")) + (else '("INTERFACE64=3D1" "LIBNAMESUFFIX=3Dilp64"))))) + ;; no configure script + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-extralib + (lambda* (#:key inputs #:allow-other-keys) + ;; Get libgfortran found when building in utest. + (setenv "FEXTRALIB" + (string-append "-L" (assoc-ref inputs "fortran-lib") + "/lib")) + #t))))) + (inputs + `(("fortran-lib" ,gfortran "lib"))) + (native-inputs + `(("cunit" ,cunit) + ("fortran" ,gfortran) + ("perl" ,perl))) + (home-page "http://www.openblas.net/") + (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") + (description + "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n. (ILP64 version)") + (license license:bsd-3))) + (define* (make-blis implementation #:optional substitutable?) "Return a BLIS package with the given IMPLEMENTATION (see config/ in the source tree for a list of implementations.) diff --git a/gnu/packages/patches/openmolcas-pymolcas-openblas.patch b/gnu/= packages/patches/openmolcas-pymolcas-openblas.patch new file mode 100644 index 000000000..2c7feade6 --- /dev/null +++ b/gnu/packages/patches/openmolcas-pymolcas-openblas.patch @@ -0,0 +1,131 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a4071fd..53d8df5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1338,42 +1338,43 @@ if (LINALG STREQUAL "OpenBLAS") + endif () +=20 + # search for the OpenBLAS library +- find_library (LIBOPENBLAS +- NAMES openblas +- PATHS ${OPENBLASROOT} +- PATH_SUFFIXES lib +- NO_DEFAULT_PATH) +- +- if (NOT LIBOPENBLAS) +- message (FATAL_ERROR +- "OpenBLAS library not found, please check that " +- "the OPENBLASROOT variable is set and points to " +- "a valid OpenBLAS installation directory." +- ) +- endif () +- +- # here we check if LIBOPENBLAS has changed after it was processed +- # succesfully, if not we do not need to rerun anything here. +- if (NOT LIBOPENBLAS STREQUAL LIBOPENBLAS_LAST) +- # check if the OpenBLAS library contains LAPACK functiona= lity +- message ("-- Checking OpenBLAS for LAPACK functionality..= .") +- include(CheckFortranFunctionExists) +- set (CMAKE_REQUIRED_LIBRARIES ${LIBOPENBLAS}) +- unset (OPENBLAS_WITH_LAPACK CACHE) +- check_fortran_function_exists("dsyev" OPENBLAS_WITH_LAPAC= K) +- if (NOT OPENBLAS_WITH_LAPACK) +- unset (LIBOPENBLAS CACHE) +- message (FATAL_ERROR +- "LAPACK functionality missing from OpenBL= AS library, " +- "please build OpenBLAS with NO_LAPACK=3D0= defined." +- ) +- endif () +- # save the last location to check if it changed between c= onfigurations +- set (LIBOPENBLAS_LAST ${LIBOPENBLAS} CACHE INTERNAL "last= value." FORCE) +- endif () +- +- add_definitions (-D_OPENBLAS_) +- set (LINALG_LIBRARIES ${LIBOPENBLAS}) ++# find_library (LIBOPENBLAS ++# NAMES openblas ++# PATHS ${OPENBLASROOT} ++# PATH_SUFFIXES lib ++# NO_DEFAULT_PATH) ++# ++# if (NOT LIBOPENBLAS) ++# message (FATAL_ERROR ++# "OpenBLAS library not found, please check that " ++# "the OPENBLASROOT variable is set and points to " ++# "a valid OpenBLAS installation directory." ++# ) ++# endif () ++# ++# # here we check if LIBOPENBLAS has changed after it was processed ++# # succesfully, if not we do not need to rerun anything here. ++# if (NOT LIBOPENBLAS STREQUAL LIBOPENBLAS_LAST) ++# # check if the OpenBLAS library contains LAPACK function= ality ++# message ("-- Checking OpenBLAS for LAPACK functionality.= ..") ++# include(CheckFortranFunctionExists) ++# set (CMAKE_REQUIRED_LIBRARIES ${LIBOPENBLAS}) ++# unset (OPENBLAS_WITH_LAPACK CACHE) ++# check_fortran_function_exists("dsyev" OPENBLAS_WITH_LAPA= CK) ++# if (NOT OPENBLAS_WITH_LAPACK) ++# unset (LIBOPENBLAS CACHE) ++# message (FATAL_ERROR ++# "LAPACK functionality missing from OpenB= LAS library, " ++# "please build OpenBLAS with NO_LAPACK=3D= 0 defined." ++# ) ++# endif () ++# # save the last location to check if it changed between = configurations ++# set (LIBOPENBLAS_LAST ${LIBOPENBLAS} CACHE INTERNAL "las= t value." FORCE) ++# endif () ++# ++ add_definitions (-D_OPENBLAS_) ++# set (LINALG_LIBRARIES ${LIBOPENBLAS}) ++ set (LINALG_LIBRARIES ${LINALG_LIBRARIES}) + else () + mark_as_advanced(FORCE OPENBLASROOT) + endif () +@@ -3167,11 +3168,11 @@ install (PROGRAMS + if (DEFINED PYMOLCAS_TARGET) + install (PROGRAMS + ${PYMOLCAS_TARGET} +- DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + RENAME pymolcas + ) +=20 +- install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/ins= tall_pymolcas.sh ${PYMOLCAS_TARGET})") ++# install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/in= stall_pymolcas.sh ${PYMOLCAS_TARGET})") + endif () +=20 + if (DEFINED EXTRA_DIR) +@@ -3188,9 +3189,9 @@ if (DEFINED EXTRA_DIR) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + ) +=20 +- install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/ins= tall_driver.sh ${MOLCAS_DRIVER})") ++# install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/in= stall_driver.sh ${MOLCAS_DRIVER})") + endif () +=20 +-if (IS_DIRECTORY "$ENV{HOME}/.Molcas") +- install (CODE "execute_process(COMMAND sh \"-c\" \"cd ${CMAKE_INS= TALL_PREFIX}; echo `pwd` > $HOME/.Molcas/molcas 2> /dev/null\")") +-endif () ++#if (IS_DIRECTORY "$ENV{HOME}/.Molcas") ++# install (CODE "execute_process(COMMAND sh \"-c\" \"cd ${CMAKE_IN= STALL_PREFIX}; echo `pwd` > $HOME/.Molcas/molcas 2> /dev/null\")") ++#endif () +diff --git a/Tools/pymolcas/CMakeLists.txt b/Tools/pymolcas/CMakeLists.txt +index 0d576fa..f9ba6d7 100644 +--- a/Tools/pymolcas/CMakeLists.txt ++++ b/Tools/pymolcas/CMakeLists.txt +@@ -52,9 +52,9 @@ if (PYTHONINTERP_FOUND) + DEPENDS ${PYMOLCAS_TARGET} + ) +=20 +- add_custom_command (TARGET pymolcas +- POST_BUILD +- COMMAND ${OPENMOLCAS_DIR}/sbin/install_pymolcas.s= h ${PYMOLCAS_TARGET} +- ) ++# add_custom_command (TARGET pymolcas ++# POST_BUILD ++# COMMAND ${OPENMOLCAS_DIR}/sbin/install_pymolcas.= sh ${PYMOLCAS_TARGET} ++# ) +=20 + endif () + --=20 2.18.0 --=-=-=--