From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id z34rG0BIr15weAAA0tVLHw (envelope-from ) for ; Sun, 03 May 2020 22:40:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UzeYGUpIr14LawAA1q6Kng (envelope-from ) for ; Sun, 03 May 2020 22:40:10 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 54C749420C8 for ; Sun, 3 May 2020 22:40:09 +0000 (UTC) Received: from localhost ([::1]:54136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVNHN-0000Lg-MX for larch@yhetil.org; Sun, 03 May 2020 18:40:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVNHG-0000Jx-Fs for guix-patches@gnu.org; Sun, 03 May 2020 18:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVNHG-0007NQ-73 for guix-patches@gnu.org; Sun, 03 May 2020 18:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVNHG-0004E1-45 for guix-patches@gnu.org; Sun, 03 May 2020 18:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40691] [PATCH] gnu: Add gromacs. References: In-Reply-To: Resent-From: Vincent Legoll Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 May 2020 22:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40691 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40691@debbugs.gnu.org Cc: Vincent Legoll Received: via spool by 40691-submit@debbugs.gnu.org id=B40691.158854559916221 (code B ref 40691); Sun, 03 May 2020 22:40:02 +0000 Received: (at 40691) by debbugs.gnu.org; 3 May 2020 22:39:59 +0000 Received: from localhost ([127.0.0.1]:58360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVNHC-0004DY-EP for submit@debbugs.gnu.org; Sun, 03 May 2020 18:39:58 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:56060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVNH9-0004DH-72 for 40691@debbugs.gnu.org; Sun, 03 May 2020 18:39:57 -0400 Received: by mail-wm1-f48.google.com with SMTP id e26so6284504wmk.5 for <40691@debbugs.gnu.org>; Sun, 03 May 2020 15:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PZk5IUMFZ8wj7A8ZIW42dAtll2zZjJGByKE4Or9As+o=; b=G6YWackgHoJAsM+lw2bQrOdsA3fM8oTd05Nq+Axq3Xgw0de85csFegemA8FZQGNQ8c d0worUIy4p1QVpOAjsnyCKbIGkt0Vz835+6H/YUiAfVbA8a9KHDepblsqJpCSC6jUu+n JOO4rl1UCuVv909mAtURVZgpkZ/jAlOgfEd0MQZ49SZ2b3YoezoyUUKUvFbCKg2YtV46 gwJuyjT9Tzr9jpUwh9SCP8mz4XLhSlXbBmvyGjf/47UOs4iWLMcRhK+LjAyN8gnfbT/C RXOycV2XyNVTEeFjcWb6NZe4GZraL99yj8q+YllmnzJN579eg4oAMeRiFaVk77a6CRSv wDxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PZk5IUMFZ8wj7A8ZIW42dAtll2zZjJGByKE4Or9As+o=; b=Uuur2jwdf0Of+TDcT2SadCe0SYb2pPxaOJ7U/XulgBdRX+j6+EKG2LoNPGj/6zeDoh nDkUzIMrTwqixxp1P0usxI4+kj293FlYy+5rG4wZ6o/Eaw4biVNnbguJD8xjdlbDD3fX QI/3+PX9fl8BmW/IBjVIiPKeNpjahjG++1iupjnN9zzrCLle9EerrbaFSb/HKiBC6HG5 BMYzqds0oaq3S70IuwMVqEnDpztc8IgzrCc34FL+9QVARycZcdz5NDv0j90ajx9qCPxm opUk8F+29GodEKL0Jx7tzO5GlLYqjUbZanoee8HJYJjQx4K2glY1BZ8Xjexke+nZxqUi pCIA== X-Gm-Message-State: AGi0PuYqql4rD64dFwkruOaGBXXqKQmf/1W8ZsevEAVlXofExVoGdcUF OfhF9TUX56/CNB0Zn76+NgbG2dVo X-Google-Smtp-Source: APiQypKr4rWO6CyLY3vBdriLEf/+sD+jwqq/sKpDm+EaES9ZmBZsh3pME4XFrktxAwNCkZX8wn7fnw== X-Received: by 2002:a7b:c456:: with SMTP id l22mr10970852wmi.148.1588545589200; Sun, 03 May 2020 15:39:49 -0700 (PDT) Received: from localhost.localdomain (se167-1-82-242-148-1.fbx.proxad.net. [82.242.148.1]) by smtp.gmail.com with ESMTPSA id l5sm10260796wmi.22.2020.05.03.15.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2020 15:39:48 -0700 (PDT) From: Vincent Legoll Date: Mon, 4 May 2020 00:39:36 +0200 Message-Id: <20200503223936.16554-1-vincent.legoll@gmail.com> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 X-Spam-Score: 4.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=G6YWackg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Scan-Result: default: False [4.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49380508937644]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; BROKEN_CONTENT_TYPE(1.50)[]; R_MISSING_CHARSET(2.50)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.14), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[vincentlegoll@gmail.com,guix-patches-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[gromacs.org:url]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[40691@debbugs.gnu.org]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: VMT0Lxk3qKra * gnu/packages/chemistry.scm (gromacs): New variable. * gnu/packages/patches/gromacs-tinyxml2.patch: New file... * gnu/local.mk (dist_patch_DATA): ...add it here. --- gnu/local.mk | 1 + gnu/packages/chemistry.scm | 90 +++++++++++++++++++++ gnu/packages/patches/gromacs-tinyxml2.patch | 67 +++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 gnu/packages/patches/gromacs-tinyxml2.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3c9a10b6bc..827e186501 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1006,6 +1006,7 @@ dist_patch_DATA = \ %D%/packages/patches/gpsbabel-qstring.patch \ %D%/packages/patches/grantlee-merge-theme-dirs.patch \ %D%/packages/patches/grep-timing-sensitive-test.patch \ + %D%/packages/patches/gromacs-tinyxml2.patch \ %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \ %D%/packages/patches/grub-efi-fat-serial-number.patch \ %D%/packages/patches/gsl-test-i686.patch \ diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 5b21e3309c..0540dfceb6 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -30,15 +30,20 @@ #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages boost) + #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) #:use-module (gnu packages gl) + #:use-module (gnu packages graphviz) #:use-module (gnu packages gv) #:use-module (gnu packages maths) + #:use-module (gnu packages mpi) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages sphinx) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) @@ -336,6 +341,91 @@ optionally velocities and the H-matrix. Coordinates and velocities are stored with user-specified precision.") (license license:bsd-3))) +(define-public gromacs + (package + (name "gromacs") + (version "2020.2") + (source (origin + (method url-fetch) + (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-" + version ".tar.gz")) + (sha256 + (base32 + "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl")) + ;; Our version of tinyxml2 is far newer than the bundled one and + ;; require fixing `testutils' code. See patch header for more info + (patches (search-patches "gromacs-tinyxml2.patch")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests + ;; Unbundling + "-DGMX_USE_LMFIT=EXTERNAL" + "-DGMX_BUILD_OWN_FFTW=off" + "-DGMX_EXTERNAL_BLAS=on" + "-DGMX_EXTERNAL_LAPACK=on" + "-DGMX_EXTERNAL_TNG=on" + "-DGMX_EXTERNAL_ZLIB=on" + "-DGMX_EXTERNAL_TINYXML2=on" + (string-append "-DTinyXML2_DIR=" + (assoc-ref %build-inputs "tinyxml2")) + ;; Workaround for cmake/FindSphinx.cmake version parsing that does + ;; not understand the guix-wrapped `sphinx-build --version' answer + (string-append "-DSPHINX_EXECUTABLE_VERSION=" + ,(package-version python-sphinx))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fixes + (lambda* (#:key inputs #:allow-other-keys) + ;; Still bundled: part of gromacs, source behind registration + ;; but free software anyways + ;;(delete-file-recursively "src/external/vmd_molfile") + ;; Still bundled: threads-based OpenMPI-compatible fallback + ;; designed to be bundled like that + ;;(delete-file-recursively "src/external/thread_mpi") + ;; Unbundling + (delete-file-recursively "src/external/lmfit") + (delete-file-recursively "src/external/clFFT") + (delete-file-recursively "src/external/fftpack") + (delete-file-recursively "src/external/build-fftw") + (delete-file-recursively "src/external/tng_io") + (delete-file-recursively "src/external/tinyxml2") + (delete-file-recursively "src/external/googletest") + (copy-recursively (assoc-ref inputs "googletest-source") + "src/external/googletest") + ;; This test warns about the build host hardware, disable + (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp" + (("TEST\\(HardwareTopologyTest, HwlocExecute\\)") + "void __guix_disabled()")) + #t))))) + (native-inputs + `(("doxygen" ,doxygen) + ("googletest-source" ,(package-source googletest)) + ("graphviz" ,graphviz) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-pygments" ,python-pygments) + ("python-sphinx" ,python-sphinx))) + (inputs + `(("fftwf" ,fftwf) + ("hwloc" ,hwloc-2 "lib") + ("lmfit" ,lmfit) + ("openblas" ,openblas) + ("perl" ,perl) + ("tinyxml2" ,tinyxml2) + ("tng" ,tng))) + (home-page "http://www.gromacs.org/") + (synopsis "Molecular dynamics software package") + (description "GROMACS is a versatile package to perform molecular dynamics, +i.e. simulate the Newtonian equations of motion for systems with hundreds to +millions of particles. It is primarily designed for biochemical molecules like +proteins, lipids and nucleic acids that have a lot of complicated bonded +interactions, but since GROMACS is extremely fast at calculating the nonbonded +interactions (that usually dominate simulations) many groups are also using it +for research on non-biological systems, e.g. polymers. GROMACS supports all the +usual algorithms you expect from a modern molecular dynamics implementation.") + (license license:lgpl2.1+))) + (define-public openbabel (package (name "openbabel") diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch new file mode 100644 index 0000000000..cc7d7459a8 --- /dev/null +++ b/gnu/packages/patches/gromacs-tinyxml2.patch @@ -0,0 +1,67 @@ +Unbundling tinyxml2 from gromacs and using our own, which is newer, broke gromacs +build. + +This patch fixes three issues: + +- cmake now errors out if using multiple target_link_libraries with mixed styles + of signatures. + +- Error handling API changed, fix the testutils/refdata_xml.cpp code by using the + new API: document.ErrorStr() & tinyxml2::XML_SUCCESS. + +Those fixes will be submitted for inclusion to upstream, but may not be suitable +there as long as they still keep the old version bundled. + +First hunk has already been requested for merging. Third is in discussion. Second +will only be sent if third is OK'ed. + +diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt +--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200 ++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200 +@@ -73,7 +73,7 @@ + + if(HAVE_TINYXML2) + include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR}) +- target_link_libraries(testutils ${TinyXML2_LIBRARIES}) ++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES}) + else() + include_directories(BEFORE SYSTEM "../external/tinyxml2") + endif() +diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp +--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200 ++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200 +@@ -206,21 +206,12 @@ + document.LoadFile(path.c_str()); + if (document.Error()) + { +- const char* errorStr1 = document.GetErrorStr1(); +- const char* errorStr2 = document.GetErrorStr2(); ++ const char* errorStr = document.ErrorStr(); + std::string errorString("Error was "); +- if (errorStr1) +- { +- errorString += errorStr1; +- } +- if (errorStr2) +- { +- errorString += errorStr2; +- } +- if (!errorStr1 && !errorStr2) +- { ++ if (errorStr) ++ errorString += errorStr; ++ else + errorString += "not specified."; +- } + GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n." + + errorString + "\n")); + } +@@ -371,7 +362,7 @@ + XMLElementPtr rootElement = createRootElement(&document); + createChildElements(rootElement, rootEntry); + +- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR) ++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS) + { + GMX_THROW(TestException("Reference data saving failed in " + path)); + } -- 2.26.0