From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#32691: OpenMolcas Date: Mon, 17 Sep 2018 22:58:22 +0200 Message-ID: <875zz36du9.fsf@gnu.org> References: <87d0tkk6gh.fsf@fastmail.com> <87h8isjund.fsf@gnu.org> <87bm90uo09.fsf@fastmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g20bn-000721-NI for bug-guix@gnu.org; Mon, 17 Sep 2018 16:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g20bm-00044m-4n for bug-guix@gnu.org; Mon, 17 Sep 2018 16:59:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39154) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g20bl-00044Q-VG for bug-guix@gnu.org; Mon, 17 Sep 2018 16:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g20bl-0001Jy-Tu for bug-guix@gnu.org; Mon, 17 Sep 2018 16:59:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87bm90uo09.fsf@fastmail.com> (Eric Brown's message of "Fri, 14 Sep 2018 09:55:50 -0500") 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: Eric Brown Cc: 32691@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Eric, We=E2=80=99re almost there! :-) Eric Brown skribis: > Thank you for your fixes! I've attached a revised patch. I'm well beyond > my comfort zone, so I hope it applies cleanly and works. > > The default location of pymolcas is a little sketchy, being placed in > the first writable location in PATH, and I believe will not be fixed > upstream: > > https://gitlab.com/Molcas/OpenMolcas/issues/70 > > I have added comments to the chemistry.scm file. I made small changes (moved comments about the patch at the top of the patch; switch to =E2=80=98texlive-union=E2=80=99, which is much smaller tha= n =E2=80=98texlive=E2=80=99), leading to the attached patch. It=E2=80=99s all good, except that the file layout really doesn=E2=80=99t m= atch the usual conventions: --8<---------------cut here---------------start------------->8--- $ find /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09 /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09 /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/basis_library /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/basis_library/= TZ /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/basis_library/= AUG-PC-4 [...] /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/sbin /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/sbin/help_basis /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/sbin/help_doc /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/lib /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/lib/libmolcas.a /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/bin /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/bin/ffpt.exe /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/bin/loprop.exe [...] /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/data/quater.pr= gm /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/data/rasscf.pr= gm /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/.molcasversion /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/molcas.rte /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/CONTRIBUTORS.md /gnu/store/6cj9n2rwsxwk582xqz2hxzlk520ghvm9-openmolcas-18.09/LICENSE --8<---------------cut here---------------end--------------->8--- Ideally basis_library/ and data/ would go under share/openmolcas, while CONTRIBUTORS.md and LICENSE would go to share/doc/openmolcas. Also, it would be nice to remove the =E2=80=98.exe=E2=80=99 extension. Do you think you could easily fiddle with CMake to fix these and/or report it upstream? I could apply the patch as is but I think users may not be pleased by this. WDYT? Thank you for your time, and sorry for the extra round trip! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-openmolcas.patch Content-Transfer-Encoding: quoted-printable Content-Description: the patch >From b4caef67aaae349e0aa77fc22517872ff8ca79cb Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Fri, 14 Sep 2018 09:27:35 -0500 Subject: [PATCH] gnu: Add openmolcas. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/chemistry.scm (openmolcas): New variable. * gnu/packages/patches/openmolcas-pymolcas-openblas.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Court=C3=A8s --- gnu/local.mk | 1 + gnu/packages/chemistry.scm | 51 ++++++++++ .../openmolcas-pymolcas-openblas.patch | 92 +++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 gnu/packages/patches/openmolcas-pymolcas-openblas.patch diff --git a/gnu/local.mk b/gnu/local.mk index d37a193ad..4c5a1fbd4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1006,6 +1006,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ %D%/packages/patches/openldap-CVE-2017-9287.patch \ + %D%/packages/patches/openmolcas-pymolcas-openblas.patch \ %D%/packages/patches/openocd-nrf52.patch \ %D%/packages/patches/opensmtpd-fix-crash.patch \ %D%/packages/patches/openssl-runpath.patch \ diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 03120aaee..bdb17c30d 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,49 @@ 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 + `(#:build-type "Release" + #: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) + ("ghostscript" ,ghostscript) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-pyparsing" ,python-pyparsing) + ("python-six" ,python-six) + ("texlive" ,(texlive-union)))) + (inputs + `(("hdf5" ,hdf5) + ("blas" ,openblas-ilp64))) + (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/patches/openmolcas-pymolcas-openblas.patch b/gnu/= packages/patches/openmolcas-pymolcas-openblas.patch new file mode 100644 index 000000000..84f348721 --- /dev/null +++ b/gnu/packages/patches/openmolcas-pymolcas-openblas.patch @@ -0,0 +1,92 @@ +By default, pymolcas is installed in the first writable directory in the +user's PATH. This patch places it in the bin/ directory alongside the oth= er +OpenMolcas binaries. + +The default search for the OpenBLAS library is obviated and the directory = name +is supplied as an argument to CMake. + +diff --git OpenMolcas-v18.09/CMakeLists.txt OpenMolcas-v18.09/CMakeLists.t= xt +index a4071fd..53d8df5 100644 +--- OpenMolcas-v18.09/CMakeLists.txt ++++ OpenMolcas-v18.09/CMakeLists.txt +@@ -1338,42 +1338,8 @@ 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}) ++ set (LINALG_LIBRARIES ${LINALG_LIBRARIES}) + else () + mark_as_advanced(FORCE OPENBLASROOT) + endif () +@@ -3167,11 +3168,10 @@ 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})") + endif () +=20 + if (DEFINED EXTRA_DIR) +@@ -3188,9 +3189,5 @@ if (DEFINED EXTRA_DIR) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + ) +=20 +- install (CODE "execute_process(COMMAND ${OPENMOLCAS_DIR}/sbin/ins= tall_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 () +diff --git OpenMolcas-v18.09/Tools/pymolcas/CMakeLists.txt OpenMolcas-v18.= 09/Tools/pymolcas/CMakeLists.txt +index 0d576fa..f9ba6d7 100644 +--- OpenMolcas-v18.09/Tools/pymolcas/CMakeLists.txt ++++ OpenMolcas-v18.09/Tools/pymolcas/CMakeLists.txt +@@ -52,9 +52,5 @@ if (PYTHONINTERP_FOUND) + DEPENDS ${PYMOLCAS_TARGET} + ) +=20 +- add_custom_command (TARGET pymolcas +- POST_BUILD +- COMMAND ${OPENMOLCAS_DIR}/sbin/install_pymolcas.s= h ${PYMOLCAS_TARGET} +- ) +=20 + endif () --=20 2.18.0 --=-=-=--