1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
3 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
4 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
7 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages chemistry)
25 #:use-module (guix packages)
26 #:use-module (guix utils)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages graphviz)
38 #:use-module (gnu packages gv)
39 #:use-module (gnu packages maths)
40 #:use-module (gnu packages mpi)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages python-xyz)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages sphinx)
47 #:use-module (gnu packages xml)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system python))
52 (define-public avogadro
60 (url "https://github.com/cryos/avogadro")
63 (base32 "0258py3lkba85qhs5ynancinyym61vlp0zaq9yrfs3hhnhpzv9n2"))
64 (file-name (git-file-name name version))
66 (search-patches "avogadro-eigen3-update.patch"
67 "avogadro-python-eigen-lib.patch"
68 "avogadro-boost148.patch"))))
69 (build-system cmake-build-system)
73 (list "-DENABLE_GLSL=ON"
74 (string-append "-DPYTHON_LIBRARIES="
75 (assoc-ref %build-inputs "python")
77 (string-append "-DPYTHON_INCLUDE_DIRS="
78 (assoc-ref %build-inputs "python")
81 (package-version python))))
83 (modify-phases %standard-phases
84 (add-after 'unpack 'patch-python-lib-path
85 (lambda* (#:key outputs #:allow-other-keys)
86 ;; This is necessary to install the Python module in the correct
88 (substitute* "libavogadro/src/python/CMakeLists.txt"
89 (("^EXECUTE_PROCESS.*$") "")
90 (("^.*from sys import stdout.*$") "")
91 (("^.*OUTPUT_VARIABLE.*")
92 (string-append "set(PYTHON_LIB_PATH \""
93 (assoc-ref outputs "out")
96 (package-version python))
97 "/site-packages\")")))
99 (add-after 'install 'wrap-program
100 (lambda* (#:key inputs outputs #:allow-other-keys)
101 ;; Make sure 'avogadro' runs with the correct PYTHONPATH.
102 (let* ((out (assoc-ref outputs "out")))
105 (assoc-ref outputs "out")
107 ,(version-major+minor
108 (package-version python))
110 (getenv "PYTHONPATH")))
111 (wrap-program (string-append out "/bin/avogadro")
112 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
115 `(("doxygen" ,doxygen)
116 ("pkg-config" ,pkg-config)))
121 ("openbabel" ,openbabel)
123 ("python-numpy" ,python2-numpy)
124 ("python-pyqt" ,python2-pyqt-4)
125 ("python-sip" ,python2-sip)
128 (home-page "https://avogadro.cc")
129 (synopsis "Advanced molecule editor")
131 "Avogadro is an advanced molecule editor and visualizer designed for use
132 in computational chemistry, molecular modeling, bioinformatics, materials
133 science, and related areas. It offers flexible high quality rendering and a
134 powerful plugin architecture.")
135 (license license:gpl2+)))
137 (define-public domainfinder
139 (name "domainfinder")
144 (uri (string-append "https://bitbucket.org/khinsen/"
145 "domainfinder/downloads/DomainFinder-"
149 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
150 (build-system python-build-system)
152 `(("python-mmtk" ,python2-mmtk)))
157 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder.html")
158 (synopsis "Analysis of dynamical domains in proteins")
159 (description "DomainFinder is an interactive program for the determination
160 and characterization of dynamical domains in proteins. It can infer dynamical
161 domains by comparing two protein structures, or from normal mode analysis on a
162 single structure. The software is currently not actively maintained and works
163 only with Python 2 and NumPy < 1.9.")
164 (license license:cecill-c)))
172 (uri (string-append "http://www.inchi-trust.org/download/"
173 (string-join (string-split version #\.) "")
177 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
178 (file-name (string-append name "-" version ".zip"))))
179 (build-system gnu-build-system)
181 '(#:tests? #f ; no check target
183 (modify-phases %standard-phases
184 (delete 'configure) ; no configure script
185 (add-before 'build 'chdir-to-build-directory
186 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
187 (add-after 'build 'build-library
189 (chdir "../../../INCHI_API/libinchi/gcc")
192 (lambda* (#:key inputs outputs #:allow-other-keys)
193 (let* ((out (assoc-ref outputs "out"))
194 (bin (string-append out "/bin"))
195 (doc (string-append out "/share/doc/inchi"))
196 (include-dir (string-append out "/include/inchi"))
197 (lib (string-append out "/lib/inchi"))
198 (inchi-doc (assoc-ref inputs "inchi-doc"))
199 (unzip (string-append (assoc-ref inputs "unzip")
203 (with-directory-excursion "INCHI_EXE/bin/Linux"
204 (rename-file "inchi-1" "inchi")
205 (install-file "inchi" bin))
206 ;; Install libraries.
207 (with-directory-excursion "INCHI_API/bin/Linux"
208 (for-each (lambda (file)
209 (install-file file lib))
210 (find-files "." "libinchi\\.so\\.1\\.*")))
211 ;; Install header files.
212 (with-directory-excursion "INCHI_BASE/src"
213 (for-each (lambda (file)
214 (install-file file include-dir))
215 (find-files "." "\\.h$")))
216 ;; Install documentation.
218 (invoke unzip "-j" "-d" doc inchi-doc)
225 (uri (string-append "http://www.inchi-trust.org/download/"
226 (string-join (string-split version #\.) "")
230 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
231 (file-name (string-append name "-" version ".zip"))))))
232 (home-page "https://www.inchi-trust.org")
233 (synopsis "Utility for manipulating machine-readable chemical structures")
235 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
236 chemical structures into machine-readable strings of information. InChIs are
237 unique to the compound they describe and can encode absolute stereochemistry
238 making chemicals and chemistry machine-readable and discoverable. A simple
239 analogy is that InChI is the bar-code for chemistry and chemical structures.")
240 (license (license:non-copyleft
242 "See LICENCE in the distribution."))))
244 (define with-numpy-1.8
245 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
247 (define-public nmoldyn
255 (url "https://github.com/khinsen/nMOLDYN3")
256 (commit (string-append "v" version))))
257 (file-name (git-file-name name version))
260 "016h4bqg419p6s7bcx55q5iik91gqmk26hbnfgj2j6zl0j36w51r"))))
261 (build-system python-build-system)
263 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
264 ("python-scientific" ,python2-scientific)
268 `(("python-mmtk" ,python2-mmtk)))
271 #:tests? #f ; No test suite
273 (modify-phases %standard-phases
274 (add-before 'build 'create-linux2-directory
276 (mkdir-p "nMOLDYN/linux2")))
277 (add-before 'build 'change-PDF-viewer
278 (lambda* (#:key inputs #:allow-other-keys)
279 (substitute* "nMOLDYN/Preferences.py"
280 ;; Set the paths for external executables, substituting
282 ;; There is also vmd_path, but VMD is not free software
283 ;; and Guix contains currently no free molecular viewer that
284 ;; could be substituted.
285 (("PREFERENCES\\['acroread_path'\\] = ''")
286 (format #f "PREFERENCES['acroread_path'] = '~a'"
288 (("PREFERENCES\\['ncdump_path'\\] = ''")
289 (format #f "PREFERENCES['ncdump_path'] = '~a'"
291 (("PREFERENCES\\['ncgen_path'\\] = ''")
292 (format #f "PREFERENCES['ncgen_path'] = '~a'"
294 (("PREFERENCES\\['task_manager_path'\\] = ''")
295 (format #f "PREFERENCES['task_manager_path'] = '~a'"
296 (which "task_manager")))
297 ;; Show documentation as PDF
298 (("PREFERENCES\\['documentation_style'\\] = 'html'")
299 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
300 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN.html")
301 (synopsis "Analysis software for Molecular Dynamics trajectories")
302 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
303 simulations. It is especially designed for the computation and decomposition of
304 neutron scattering spectra, but also computes other quantities. The software
305 is currently not actively maintained and works only with Python 2 and
307 (license license:cecill)))
316 (url "https://github.com/gromacs/tng")
317 (commit (string-append "v" version))))
318 (file-name (git-file-name name version))
321 "1apf2n8nb34z09xarj7k4jgriq283l769sakjmj5aalpbilvai4q"))))
322 (build-system cmake-build-system)
327 (modify-phases %standard-phases
328 (add-after 'unpack 'remove-bundled-zlib
330 (delete-file-recursively "external")
334 (invoke "../build/bin/tests/tng_testing")
336 (home-page "https://github.com/gromacs/tng")
337 (synopsis "Trajectory Next Generation binary format manipulation library")
338 (description "TRAJNG (Trajectory next generation) is a program library for
339 handling molecular dynamics (MD) trajectories. It can store coordinates, and
340 optionally velocities and the H-matrix. Coordinates and velocities are
341 stored with user-specified precision.")
342 (license license:bsd-3)))
344 (define-public gromacs
350 (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
354 "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
355 ;; Our version of tinyxml2 is far newer than the bundled one and
356 ;; require fixing `testutils' code. See patch header for more info
357 (patches (search-patches "gromacs-tinyxml2.patch"))))
358 (build-system cmake-build-system)
361 (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
363 "-DGMX_USE_LMFIT=EXTERNAL"
364 "-DGMX_BUILD_OWN_FFTW=off"
365 "-DGMX_EXTERNAL_BLAS=on"
366 "-DGMX_EXTERNAL_LAPACK=on"
367 "-DGMX_EXTERNAL_TNG=on"
368 "-DGMX_EXTERNAL_ZLIB=on"
369 "-DGMX_EXTERNAL_TINYXML2=on"
370 (string-append "-DTinyXML2_DIR="
371 (assoc-ref %build-inputs "tinyxml2"))
372 ;; Workaround for cmake/FindSphinx.cmake version parsing that does
373 ;; not understand the guix-wrapped `sphinx-build --version' answer
374 (string-append "-DSPHINX_EXECUTABLE_VERSION="
375 ,(package-version python-sphinx)))
377 (modify-phases %standard-phases
378 (add-after 'unpack 'fixes
379 (lambda* (#:key inputs #:allow-other-keys)
380 ;; Still bundled: part of gromacs, source behind registration
381 ;; but free software anyways
382 ;;(delete-file-recursively "src/external/vmd_molfile")
383 ;; Still bundled: threads-based OpenMPI-compatible fallback
384 ;; designed to be bundled like that
385 ;;(delete-file-recursively "src/external/thread_mpi")
387 (delete-file-recursively "src/external/lmfit")
388 (delete-file-recursively "src/external/clFFT")
389 (delete-file-recursively "src/external/fftpack")
390 (delete-file-recursively "src/external/build-fftw")
391 (delete-file-recursively "src/external/tng_io")
392 (delete-file-recursively "src/external/tinyxml2")
393 (delete-file-recursively "src/external/googletest")
394 (copy-recursively (assoc-ref inputs "googletest-source")
395 "src/external/googletest")
396 ;; This test warns about the build host hardware, disable
397 (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
398 (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
399 "void __guix_disabled()"))
402 `(("doxygen" ,doxygen)
403 ("googletest-source" ,(package-source googletest))
404 ("graphviz" ,graphviz)
405 ("pkg-config" ,pkg-config)
407 ("python-pygments" ,python-pygments)
408 ("python-sphinx" ,python-sphinx)))
411 ("hwloc" ,hwloc-2 "lib")
413 ("openblas" ,openblas)
415 ("tinyxml2" ,tinyxml2)
417 (home-page "http://www.gromacs.org/")
418 (synopsis "Molecular dynamics software package")
419 (description "GROMACS is a versatile package to perform molecular dynamics,
420 i.e. simulate the Newtonian equations of motion for systems with hundreds to
421 millions of particles. It is primarily designed for biochemical molecules like
422 proteins, lipids and nucleic acids that have a lot of complicated bonded
423 interactions, but since GROMACS is extremely fast at calculating the nonbonded
424 interactions (that usually dominate simulations) many groups are also using it
425 for research on non-biological systems, e.g. polymers. GROMACS supports all the
426 usual algorithms you expect from a modern molecular dynamics implementation.")
427 (license license:lgpl2.1+)))
429 (define-public openbabel
435 (uri (string-append "mirror://sourceforge/" name "/" name "/"
436 version "/" name "-" version ".tar.gz"))
439 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
441 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
442 (build-system cmake-build-system)
445 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
446 (string-append "-DINCHI_LIBRARY="
447 (assoc-ref %build-inputs "inchi")
448 "/lib/inchi/libinchi.so.1")
449 (string-append "-DINCHI_INCLUDE_DIR="
450 (assoc-ref %build-inputs "inchi") "/include/inchi"))
451 #:test-target "test"))
453 `(("pkg-config" ,pkg-config)))
459 (home-page "http://openbabel.org/wiki/Main_Page")
460 (synopsis "Chemistry data manipulation toolbox")
462 "Open Babel is a chemical toolbox designed to speak the many languages of
463 chemical data. It's a collaborative project allowing anyone to search, convert,
464 analyze, or store data from molecular modeling, chemistry, solid-state
465 materials, biochemistry, or related areas.")
466 (license license:gpl2)))