all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>
To: David Elsing <david.elsing@posteo.net>, 58261@debbugs.gnu.org
Subject: [bug#58261] [PATCH 11/11] gnu: Add rdkit.
Date: Tue, 04 Oct 2022 10:13:24 +0200	[thread overview]
Message-ID: <fc735901f5cbce528db73452fe84e352cd7972b3.camel@ist.tugraz.at> (raw)
In-Reply-To: <06dceecde661574f95f3a6324285077d0bc6896a.1664725832.git.david.elsing@posteo.net>

Am Montag, dem 03.10.2022 um 00:19 +0000 schrieb David Elsing:
> * gnu/packages/chemistry.scm (rdkit): New variable.
> ---
>  gnu/packages/chemistry.scm                    | 198
> ++++++++++++++++++
>  .../rdkit-cmake-external-dependencies.patch   | 102 +++++++++
>  2 files changed, 300 insertions(+)
>  create mode 100644 gnu/packages/patches/rdkit-cmake-external-
> dependencies.patch
> 
> diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
> index a39deff4bf..869cf264e3 100644
> --- a/gnu/packages/chemistry.scm
> +++ b/gnu/packages/chemistry.scm
> @@ -34,6 +34,7 @@ (define-module (gnu packages chemistry)
>    #:use-module (gnu packages algebra)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages backup)
> +  #:use-module (gnu packages base)
>    #:use-module (gnu packages bison)
>    #:use-module (gnu packages boost)
>    #:use-module (gnu packages check)
> @@ -41,10 +42,12 @@ (define-module (gnu packages chemistry)
>    #:use-module (gnu packages cpp)
>    #:use-module (gnu packages documentation)
>    #:use-module (gnu packages flex)
> +  #:use-module (gnu packages fonts)
>    #:use-module (gnu packages fontutils)
>    #:use-module (gnu packages gcc)
>    #:use-module (gnu packages gl)
>    #:use-module (gnu packages graphviz)
> +  #:use-module (gnu packages gtk)
>    #:use-module (gnu packages gv)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages maths)
> @@ -56,6 +59,7 @@ (define-module (gnu packages chemistry)
>    #:use-module (gnu packages qt)
>    #:use-module (gnu packages serialization)
>    #:use-module (gnu packages sphinx)
> +  #:use-module (gnu packages sqlite)
>    #:use-module (gnu packages stb)
>    #:use-module (gnu packages web)
>    #:use-module (gnu packages xml)
> @@ -899,3 +903,197 @@ (define-public yaehmop-tightbind
>      (description "@code{YAeHMOP} contains a program and library for
> performing
>  extended Hückel calculations.")
>      (license license:bsd-2)))
> +
> +(define-public rdkit
> +  (package
> +    (name "rdkit")
> +    (version "2022.03.5")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/rdkit/rdkit")
> +                    (commit
> +                     (string-append
> +                      "Release_" (string-replace-substring version
> "." "_")))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "19idgilabh04cbr1qj6zgrgsfjm248mmfz6fsr0smrd68d0xnml9"))
> +              (patches
> +               (search-patches "rdkit-cmake-external-
> dependencies.patch"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               #~(begin
> +                   ;; Remove pickle files (only used in tests),
> +                   ;; as they are compiled programs
> +                   (for-each
> +                    (lambda (name)
> +                      (display (string-append name "\n"))
> +                      (delete-file name))
> +                    (find-files "." "\\.pkl(\\.gz)?$"))
> +                   ;; Remove SQLite data files (can be generated)
> +                   (delete-file "Data/RDData.sqlt")
> +                   (delete-file "Data/RDTests.sqlt")
> +                   #t))))
> +    (build-system cmake-build-system)
> +    (native-inputs
> +     `(("bison" ,bison)
> +       ("boost" ,boost)
> +       ("catch2" ,catch2)
> +       ("eigen" ,eigen)
> +       ("flex" ,flex)
> +       ("freesasa" ,freesasa)
> +       ("pkg-config" ,pkg-config)
> +       ("rapidjson" ,rapidjson)
> +       ("tar" ,tar)
> +       ("avalontoolkit-src"
> +        ,(let ((version "1.2.0"))
> +           (origin
> +             (method url-fetch)
> +             (uri (string-append
> +                  
> "http://sourceforge.net/projects/avalontoolkit/files/"
> +                   "AvalonToolkit_" (substring version 0 3)
> "/AvalonToolkit_"
> +                   version ".source.tar"))
> +             (sha256
> +              (base32
> +              
> "0rnnyy6axs2da7aa4q6l30ldavbk49v6l22llj1adn74h1i67bpv"))
> +             (modules '((guix build utils) (ice-9 ftw) (srfi srfi-
> 26)))
> +             (snippet
> +              #~(begin
> +                  (chdir "..")
> +                  (delete-file-recursively "StandardFiles")
> +                  (delete-file-recursively
> "SourceDistribution/java")
> +                  #t)))))
> +       ("ringdecomposerlib-src"
> +        ,(let ((version "1.1.3"))
> +           (origin
> +             (method git-fetch)
> +             (uri (git-reference
> +                   (url
> "https://github.com/rareylab/RingDecomposerLib")
> +                   (commit (string-append "v" version "_rdkit"))))
> +             (file-name (git-file-name name version))
> +             (sha256
> +              (base32
> +              
> "1rxzs2wpkkdi40wdzxc4sn0brk7dm7ivgqyfh38gf2f5c7pbg0wi")))))))
> +    (inputs
> +     (list cairo
> +           coordgenlibs
> +           font-comic-neue
> +           freetype
> +           inchi
> +           maeparser
> +           python
> +           sqlite
> +           yaehmop-tightbind))
> +    (propagated-inputs
> +     (list python-numpy python-cairocffi python-pillow))
> +    (arguments
> +     (list
> +      #:imported-modules (append %cmake-build-system-modules
> +                                 '((guix build python-build-
> system)))
> +      #:modules '((guix build cmake-build-system)
> +                  (guix build utils)
> +                  ((guix build python-build-system)
> +                   #:select (add-installed-pythonpath)))
> +      #:configure-flags
> +      #~(list
> +         "-DRDK_BUILD_AVALON_SUPPORT=ON"
> +         "-DRDK_BUILD_CAIRO_SUPPORT=ON"
> +         "-DRDK_BUILD_CPP_TESTS=ON"
> +         "-DRDK_BUILD_FREESASA_SUPPORT=ON"
> +         "-DRDK_BUILD_INCHI_SUPPORT=ON"
> +         "-DRDK_BUILD_YAEHMOP_SUPPORT=ON"
> +         (string-append "-DCATCH_DIR="
> +                        #$(this-package-native-input "catch2")
> +                        "/include/catch2")
> +         "-DRDK_INSTALL_DEV_COMPONENT=ON"
> +         "-DRDK_INSTALL_INTREE=OFF"
> +         "-DRDK_INSTALL_STATIC_LIBS=OFF"
> +         (string-append
> +          "-DRDK_OPTIMIZE_POPCNT="
> +          #$(let ((system (or (%current-target-system)
> +                              (%current-system))))
> +              (cond
> +               ((string-prefix? "x86_64" system) "ON")
> +               ((string-prefix? "i686" system) "ON")
> +               (else "OFF"))))
> +         "-DRDK_USE_BOOST_IOSTREAMS=ON"
> +         "-DRDK_USE_FLEXBISON=ON")
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'copy-external-dependencies
> +            (lambda _
> +              (symlink
> +               (string-append
> +                #$(this-package-input "font-comic-neue")
> +                "/share/fonts/truetype/ComicNeue-Regular.ttf")
> +               "Data/Fonts/ComicNeue-Regular.ttf")
> +              (symlink #$(this-package-native-input "rapidjson")
> +                       "External/rapidjson-1.1.0")
> +              (invoke "tar" "xvf"
> +                      #$(this-package-native-input "avalontoolkit-
> src")
> +                      "-C" "External/AvalonTools")
> +              (symlink #$(this-package-native-input
> "ringdecomposerlib-src")
> +                       "External/RingFamilies/RingDecomposerLib")
> +              #t))
You might want to try unbundling those.  Either way, you should find a
solution that doesn't depend on native-input labels.
> +          (add-after 'copy-external-dependencies 'patch-source
> +            (lambda _
> +              (with-directory-excursion "External/AvalonTools"
> +                (invoke "patch" "-p0" "-i"
> +                        "AvalonToolkit_1.2_patch.txt"))
> +              (substitute* "External/YAeHMOP/EHTTools.cpp"
> +                (("<yaehmop/tightbind/bind.h>") "<yaehmop/bind.h>"))
> +              #t))
See my comment on yaehmop.
> +          (add-after 'unpack 'create-sqlite-data-files
> +            (lambda _
> +              (invoke "sqlite3" "Data/RDData.sqlt"
> +                      ".read rdkit/Dbase/test_data/RDData.sqlite")
> +              (invoke "sqlite3" "Data/RDTests.sqlt"
> +                      ".read rdkit/Dbase/test_data/RDTests.sqlite")
> +              #t))
Do you only need this for tests?  If so, do this in a pre-check phase.
> +          (add-after 'unpack 'fix-inchi-include
> +            (lambda _
> +              (substitute* "Code/cmake/Modules/FindInchi.cmake"
> +                (("inchi_api.h.*\\)") "inchi/inchi_api.h)")
> +                (("INCHI_LIBRARY NAMES.*\\)")
> +                 "INCHI_LIBRARY NAMES inchi PATH_SUFFIXES inchi)")
> +                (("find_library" prev)
> +                 (string-append
> +                  "list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.1)\n"
> +                  prev)))
> +              (substitute* "External/INCHI-API/inchi.cpp"
> +                (("<inchi_api.h>") "<inchi/inchi_api.h>"))
> +              #t))
> +          (add-before 'build 'enable-bytecode-determinism
> +              (lambda _
> +                (setenv "PYTHONHASHSEED" "0")
> +                (setenv "PYTHONDONTWRITEBYTECODE" "1")
> +                #t))
> +          (delete 'check)
> +          (add-after 'install 'check
> +            (lambda* (#:key inputs outputs tests? parallel-tests?
> +                      #:allow-other-keys)
> +              (when tests?
> +                (let
> +                    ((job-count (number->string
> +                                 (or (and parallel-tests?
> +                                          (parallel-job-count))
> +                                     1))))
> +                  (setenv "RDBASE" (canonicalize-path "../source"))
> +                  (add-installed-pythonpath inputs outputs)
This line should also be pre-check, maybe even these two lines.
> +                  (invoke "ctest"
> +                          "-j" job-count
> +                          "-E" (string-append
> +                                ;; need pickled data
> +                                "(pyDiscreteValueVect"
> "|pySparseIntVect"
> +                                "|graphmoltestPickler"
> "|pyPartialCharges"
> +                                "|substructLibraryTest"
> "|pyFeatures"
> +                                "|pythonTestDirML"
> "|pythonTestDirChem"
> +                                ;; Catching Python exception fails
> +                                "|pyRanker)"))))
Use string-join instead.
> +              #t)))))
> +    (home-page "https://rdkit.org/")
> +    (synopsis "Open-Source Cheminformatics Software")
"Open-Source" is meaningless in Guix.
> +    (description "RDKit is a collection of cheminformatics and
> +machine-learning software written in C++ and Python.")
Not particularly descriptive, but then again, neither is rdkit itself.

Cheers

  reply	other threads:[~2022-10-04  8:34 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 22:55 [bug#58261] [PATCH 00/11] Add rdkit David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 01/11] gnu: Add fast-float David Elsing
2022-10-04  6:57   ` Liliana Marie Prikler via Guix-patches via
2022-10-07 15:08     ` David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 02/11] gnu: Add pocketfft David Elsing
2022-10-04  7:09   ` Liliana Marie Prikler
2022-10-07 15:10     ` David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 03/11] gnu: Add sajson David Elsing
2022-10-04  7:22   ` Liliana Marie Prikler
2022-10-07 15:10     ` David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 04/11] gnu: Add tinydir David Elsing
2022-10-04  7:27   ` Liliana Marie Prikler
2022-10-07 15:11     ` David Elsing
2022-10-07 15:13       ` Liliana Marie Prikler
2022-10-03  0:19 ` [bug#58261] [PATCH 05/11] gnu: Add optionparser David Elsing
2022-10-04  7:42   ` Liliana Marie Prikler
2022-10-07 15:11     ` David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 06/11] gnu: Add gemmi David Elsing
2022-10-04  7:49   ` Liliana Marie Prikler
2022-10-07 15:11     ` David Elsing
2022-10-07 15:17       ` Liliana Marie Prikler
2022-10-03  0:19 ` [bug#58261] [PATCH 07/11] gnu: Add freesasa David Elsing
2022-10-04  8:02   ` Liliana Marie Prikler
2022-10-07 15:12     ` David Elsing
2022-10-07 15:19       ` Liliana Marie Prikler
2022-10-03  0:19 ` [bug#58261] [PATCH 08/11] gnu: Add maeparser David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 09/11] gnu: Add coordgenlibs David Elsing
2022-10-03  0:19 ` [bug#58261] [PATCH 10/11] gnu: Add yaehmop-tightbind David Elsing
2022-10-04  7:54   ` Liliana Marie Prikler
2022-10-07 15:12     ` David Elsing
2022-10-07 15:25       ` Liliana Marie Prikler
2022-10-03  0:19 ` [bug#58261] [PATCH 11/11] gnu: Add rdkit David Elsing
2022-10-04  8:13   ` Liliana Marie Prikler [this message]
2022-10-07 15:12     ` David Elsing
2022-10-07 15:29       ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 00/13] Add rdkit v2 David Elsing
2022-10-09 10:02   ` Liliana Marie Prikler
2022-10-13 20:58     ` David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 00/15] Add rdkit v3 David Elsing
2022-10-15 14:37     ` bug#58261: " Liliana Marie Prikler
2022-10-17  9:55       ` [bug#58261] " David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 01/15] gnu: Add fast-float David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 02/15] gnu: Add pocketfft-cpp David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 03/15] gnu: Add sajson David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 04/15] gnu: Add cbehave David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 05/15] gnu: Add tinydir David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 06/15] gnu: Add optionparser David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 07/15] gnu: Add sajson-for-gemmi David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 08/15] gnu: Add gemmi David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 09/15] gnu: Add freesasa David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 10/15] gnu: Add maeparser David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 11/15] gnu: Add coordgenlibs David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 12/15] gnu: Add yaehmop David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 13/15] gnu: Add avalon-toolkit David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 14/15] gnu: Add ringdecomposerlib David Elsing
2022-10-13 21:04   ` [bug#58261] [PATCH v3 15/15] gnu: Add rdkit David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 01/13] gnu: Add fast-float David Elsing
2022-10-09 10:04   ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 02/13] gnu: Add pocketfft David Elsing
2022-10-09 11:42   ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 03/13] gnu: Add sajson David Elsing
2022-10-09 11:46   ` Liliana Marie Prikler
2022-10-13 20:59     ` David Elsing
2022-10-14 21:30       ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 04/13] gnu: Add tinydir David Elsing
2022-10-09 11:48   ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 05/13] gnu: Add optionparser David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 06/13] gnu: Add gemmi David Elsing
2022-10-09 11:54   ` Liliana Marie Prikler
2022-10-13 21:00     ` David Elsing
2022-10-14 21:32       ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 07/13] gnu: Add freesasa David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 08/13] gnu: Add maeparser David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 09/13] gnu: Add coordgenlibs David Elsing
2022-10-09 11:56   ` Liliana Marie Prikler
2022-10-13 21:00     ` David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 10/13] gnu: Add yaehmop-tightbind David Elsing
2022-10-09 12:02   ` Liliana Marie Prikler
2022-10-13 21:00     ` David Elsing
2022-10-14 21:33       ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 11/13] gnu: Add avalontoolkit David Elsing
2022-10-09 12:06   ` Liliana Marie Prikler
2022-10-13 21:01     ` David Elsing
2022-10-07 15:22 ` [bug#58261] [PATCH v2 12/13] gnu: Add ringdecomposerlib David Elsing
2022-10-07 15:22 ` [bug#58261] [PATCH v2 13/13] gnu: Add rdkit David Elsing
2022-10-09 12:12   ` Liliana Marie Prikler
2022-10-13 21:01     ` David Elsing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc735901f5cbce528db73452fe84e352cd7972b3.camel@ist.tugraz.at \
    --to=liliana.prikler@ist.tugraz.at \
    --cc=58261@debbugs.gnu.org \
    --cc=david.elsing@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.