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 SDGFONtGr17/YQAA0tVLHw (envelope-from ) for ; Sun, 03 May 2020 22:34:03 +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 QmQ3N+VGr16XZwAA1q6Kng (envelope-from ) for ; Sun, 03 May 2020 22:34:13 +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 C6C2E943705 for ; Sun, 3 May 2020 22:34:12 +0000 (UTC) Received: from localhost ([::1]:52298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVNBd-0007Zx-2D for larch@yhetil.org; Sun, 03 May 2020 18:34:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVNBS-0007ZN-Mk for guix-patches@gnu.org; Sun, 03 May 2020 18:34:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVNBS-0001Rd-DZ for guix-patches@gnu.org; Sun, 03 May 2020 18:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVNBS-00044t-Ax for guix-patches@gnu.org; Sun, 03 May 2020 18:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40691] [PATCH 3/3] gnu: Add gromacs. Resent-From: Vincent Legoll Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 May 2020 22:34: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.158854518515591 (code B ref 40691); Sun, 03 May 2020 22:34:02 +0000 Received: (at 40691) by debbugs.gnu.org; 3 May 2020 22:33:05 +0000 Received: from localhost ([127.0.0.1]:58344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVNAW-00043P-WE for submit@debbugs.gnu.org; Sun, 03 May 2020 18:33:05 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:42862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVNAS-00042N-C6 for 40691@debbugs.gnu.org; Sun, 03 May 2020 18:33:03 -0400 Received: by mail-wr1-f51.google.com with SMTP id s8so8393654wrt.9 for <40691@debbugs.gnu.org>; Sun, 03 May 2020 15:33:00 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=NwzvYY8MBDjsuRwKGsq2DZkFlH8CcjnFj+UehJdDCKY=; b=WK02JJGuDzaX9YSFePPPLs9zIXRrlh5syZ7uWHb7cTcmrBpMK2cELED0D2z9pAOlzp yYr83WXkVYrVRaemy5MBfMkl29ani841WQgbrDBF0dAa6s22tfIXfgaWYWQ1RAqiVSTF jLURYuR71pI86Qth2Q/Dlew/v3uElv2nLHK7IbUbw3Ino6ufYdR0NSN9Lo8waJ3SYhi7 YNhVRLxuM4zF7qMgVL2arVb6xLoz9dob95dzr1jc0JzFnzo/Ha+IjO6o8I0k382pyUNs jnPWYa0YnBak2uUcXCpILCNCgbzRgKegmM5PGGhSjW+zpGw7wJqbFdQLgqCG7v61jzkE FtDQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NwzvYY8MBDjsuRwKGsq2DZkFlH8CcjnFj+UehJdDCKY=; b=VehVr+cefg0PsLnbIX/zM4rZ2in+83nzFUtFNaOSAJT/jsrRAgJDNwboS0DC+Gpju8 p3uRFg94L5OuCwxhI9PBmcuWk4897sH87z2swel3JbYkAhpjiIxF4464uVYYrF7u3TZo pwiv9PXrNdk7YAFpFBrIAaN2uJdtbW0Us1ZTzEuTB+B1mFLgW4fsN1AshEKcSAiKysHG JvWnuY9gL++qDSGFaTqYFKvrGK1hgKapEEHZ6xRqlisskLr//06heFDGCwHSgOhc5zCn iy2dMyXe7bYXvY2Suy3eJImiuw/xElg63aQJ5Wfjmz+c7cLrm487Q0nE5MhzoTyPBrMy K6Nw== X-Gm-Message-State: AGi0PuaNDLA3yDvcb14LXk/Lx/uphGA+GJPYm8Wh73wIJufNBzQbbWJM GWUt+q4inp98CU1VUDcEohXsQdPG X-Google-Smtp-Source: APiQypJjEOPIE9x3nxdoiVFZqQEpeUOnsmMWiMbhVhnN3CvSeRTvozL38Qb7GSxcrRm5BrJafFiz3w== X-Received: by 2002:a5d:414f:: with SMTP id c15mr6917668wrq.61.1588545174356; Sun, 03 May 2020 15:32:54 -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 a205sm11211970wmh.29.2020.05.03.15.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2020 15:32:53 -0700 (PDT) From: Vincent Legoll Date: Mon, 4 May 2020 00:32:40 +0200 Message-Id: <20200503223240.16408-3-vincent.legoll@gmail.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200503223240.16408-1-vincent.legoll@gmail.com> References: <20200503223240.16408-1-vincent.legoll@gmail.com> 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=WK02JJGu; 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.49381292358086]; 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: brxuUryHmjJA * 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 | 86 +++++++++++++++++++++ gnu/packages/patches/gromacs-tinyxml2.patch | 67 ++++++++++++++++ 3 files changed, 154 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..42368cb482 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -33,6 +33,7 @@ #: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 pkg-config) @@ -336,6 +337,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