chemistry.scm 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
  3. ;;; Copyright © 2018, 2021 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>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  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.
  15. ;;;
  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.
  20. ;;;
  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/>.
  23. (define-module (gnu packages chemistry)
  24. #:use-module (guix packages)
  25. #:use-module (guix utils)
  26. #:use-module ((guix licenses) #:prefix license:)
  27. #:use-module (guix download)
  28. #:use-module (guix git-download)
  29. #:use-module (gnu packages)
  30. #:use-module (gnu packages algebra)
  31. #:use-module (gnu packages autotools)
  32. #:use-module (gnu packages backup)
  33. #:use-module (gnu packages boost)
  34. #:use-module (gnu packages check)
  35. #:use-module (gnu packages compression)
  36. #:use-module (gnu packages documentation)
  37. #:use-module (gnu packages gl)
  38. #:use-module (gnu packages graphviz)
  39. #:use-module (gnu packages gv)
  40. #:use-module (gnu packages maths)
  41. #:use-module (gnu packages mpi)
  42. #:use-module (gnu packages perl)
  43. #:use-module (gnu packages pkg-config)
  44. #:use-module (gnu packages python)
  45. #:use-module (gnu packages python-xyz)
  46. #:use-module (gnu packages qt)
  47. #:use-module (gnu packages serialization)
  48. #:use-module (gnu packages sphinx)
  49. #:use-module (gnu packages xml)
  50. #:use-module (guix build-system cmake)
  51. #:use-module (guix build-system gnu)
  52. #:use-module (guix build-system python))
  53. (define-public avogadrolibs
  54. (package
  55. (name "avogadrolibs")
  56. (version "1.93.0")
  57. (source
  58. (origin
  59. (method git-fetch)
  60. (uri (git-reference
  61. (url "https://github.com/OpenChemistry/avogadrolibs")
  62. (commit version)))
  63. (sha256
  64. (base32 "1xivga626n5acnmwmym8svl0pdri8hkp59czf04ri2zflnviyh39"))
  65. (file-name (git-file-name name version))))
  66. (build-system cmake-build-system)
  67. (native-inputs
  68. `(("eigen" ,eigen)
  69. ("mmtf-cpp" ,mmtf-cpp)
  70. ("msgpack" ,msgpack)
  71. ("googletest" ,googletest)
  72. ("pkg-config" ,pkg-config)
  73. ("pybind11" ,pybind11)))
  74. (inputs
  75. `(("glew" ,glew)
  76. ("libarchive" ,libarchive)
  77. ("libmsym" ,libmsym)
  78. ("molequeue" ,molequeue)
  79. ("python" ,python)
  80. ("spglib" ,spglib)
  81. ("qtbase" ,qtbase-5)))
  82. (arguments
  83. '(#:configure-flags (list "-DENABLE_TESTING=ON"
  84. (string-append "-DSPGLIB_INCLUDE_DIR="
  85. (assoc-ref %build-inputs "spglib")
  86. "/include"))))
  87. (home-page "https://www.openchemistry.org/projects/avogadro2/")
  88. (synopsis "Libraries for chemistry, bioinformatics, and related areas")
  89. (description
  90. "Avogadro libraries provide 3D rendering, visualization, analysis and data
  91. processing useful in computational chemistry, molecular modeling,
  92. bioinformatics, materials science, and related areas.")
  93. (license license:bsd-3)))
  94. (define-public avogadro2
  95. (package
  96. (name "avogadro2")
  97. (version "1.93.0")
  98. (source
  99. (origin
  100. (method git-fetch)
  101. (uri (git-reference
  102. (url "https://github.com/OpenChemistry/avogadroapp")
  103. (commit version)))
  104. (sha256
  105. (base32
  106. "1z3pjlwja778a1dmvx9aqz2hlw5q9g3kqxhm9slz08452600jsv7"))
  107. (file-name (git-file-name name version))))
  108. (build-system cmake-build-system)
  109. (native-inputs
  110. `(("eigen" ,eigen)
  111. ("pkg-config" ,pkg-config)))
  112. (inputs
  113. `(("avogadrolibs" ,avogadrolibs)
  114. ("hdf5" ,hdf5)
  115. ("molequeue" ,molequeue)
  116. ("qtbase" ,qtbase-5)))
  117. ;; TODO: Enable tests with "-DENABLE_TESTING" configure flag.
  118. (arguments
  119. '(#:tests? #f))
  120. (home-page "https://www.openchemistry.org/projects/avogadro2/")
  121. (synopsis "Advanced molecule editor")
  122. (description
  123. "Avogadro 2 is an advanced molecule editor and visualizer designed for use
  124. in computational chemistry, molecular modeling, bioinformatics, materials
  125. science, and related areas. It offers flexible high quality rendering and a
  126. powerful plugin architecture.")
  127. (license license:bsd-3)))
  128. (define-public domainfinder
  129. (package
  130. (name "domainfinder")
  131. (version "2.0.5")
  132. (source
  133. (origin
  134. (method url-fetch)
  135. (uri (string-append "https://bitbucket.org/khinsen/"
  136. "domainfinder/downloads/DomainFinder-"
  137. version ".tar.gz"))
  138. (sha256
  139. (base32
  140. "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
  141. (build-system python-build-system)
  142. (inputs
  143. `(("python-mmtk" ,python2-mmtk)))
  144. (arguments
  145. `(#:python ,python-2
  146. ;; No test suite
  147. #:tests? #f))
  148. (home-page "http://dirac.cnrs-orleans.fr/DomainFinder.html")
  149. (synopsis "Analysis of dynamical domains in proteins")
  150. (description "DomainFinder is an interactive program for the determination
  151. and characterization of dynamical domains in proteins. It can infer dynamical
  152. domains by comparing two protein structures, or from normal mode analysis on a
  153. single structure. The software is currently not actively maintained and works
  154. only with Python 2 and NumPy < 1.9.")
  155. (license license:cecill-c)))
  156. (define-public inchi
  157. (package
  158. (name "inchi")
  159. ;; Update the inchi-doc native input when updating inchi.
  160. (version "1.06")
  161. (source (origin
  162. (method url-fetch)
  163. (uri (string-append "https://www.inchi-trust.org/download/"
  164. (string-join (string-split version #\.) "")
  165. "/INCHI-1-SRC.zip"))
  166. (sha256
  167. (base32
  168. "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28"))
  169. (file-name (string-append name "-" version ".zip"))))
  170. (build-system gnu-build-system)
  171. (arguments
  172. '(#:tests? #f ; no check target
  173. #:phases
  174. (modify-phases %standard-phases
  175. (delete 'configure) ; no configure script
  176. (add-before 'build 'chdir-to-build-directory
  177. (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
  178. (add-after 'build 'build-library
  179. (lambda _
  180. (chdir "../../../INCHI_API/libinchi/gcc")
  181. (invoke "make")))
  182. (replace 'install
  183. (lambda* (#:key inputs outputs #:allow-other-keys)
  184. (let* ((out (assoc-ref outputs "out"))
  185. (bin (string-append out "/bin"))
  186. (doc (string-append out "/share/doc/inchi"))
  187. (include-dir (string-append out "/include/inchi"))
  188. (lib (string-append out "/lib/inchi"))
  189. (inchi-doc (assoc-ref inputs "inchi-doc"))
  190. (unzip (search-input-file inputs "/bin/unzip")))
  191. (chdir "../../..")
  192. ;; Install binary.
  193. (with-directory-excursion "INCHI_EXE/bin/Linux"
  194. (rename-file "inchi-1" "inchi")
  195. (install-file "inchi" bin))
  196. ;; Install libraries.
  197. (with-directory-excursion "INCHI_API/bin/Linux"
  198. (for-each (lambda (file)
  199. (install-file file lib))
  200. (find-files "." "libinchi\\.so\\.1\\.*")))
  201. ;; Install header files.
  202. (with-directory-excursion "INCHI_BASE/src"
  203. (for-each (lambda (file)
  204. (install-file file include-dir))
  205. (find-files "." "\\.h$")))
  206. ;; Install documentation.
  207. (mkdir-p doc)
  208. (invoke unzip "-j" "-d" doc inchi-doc)
  209. #t))))))
  210. (native-inputs
  211. `(("unzip" ,unzip)
  212. ("inchi-doc"
  213. ,(origin
  214. (method url-fetch)
  215. (uri (string-append "http://www.inchi-trust.org/download/"
  216. (string-join (string-split version #\.) "")
  217. "/INCHI-1-DOC.zip"))
  218. (sha256
  219. (base32
  220. "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f"))
  221. (file-name (string-append name "-" version ".zip"))))))
  222. (home-page "https://www.inchi-trust.org")
  223. (synopsis "Utility for manipulating machine-readable chemical structures")
  224. (description
  225. "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
  226. chemical structures into machine-readable strings of information. InChIs are
  227. unique to the compound they describe and can encode absolute stereochemistry
  228. making chemicals and chemistry machine-readable and discoverable. A simple
  229. analogy is that InChI is the bar-code for chemistry and chemical structures.")
  230. (license (license:non-copyleft
  231. "file://LICENCE"
  232. "See LICENCE in the distribution."))))
  233. (define-public libmsym
  234. (package
  235. (name "libmsym")
  236. (version "0.2.3")
  237. (source
  238. (origin
  239. (method git-fetch)
  240. (uri (git-reference
  241. (url "https://github.com/mcodev31/libmsym")
  242. (commit (string-append "v" version))))
  243. (sha256
  244. (base32
  245. "0a9j28irdsr461qpzlc9z1yjyb9kp64fh5zw7ylspc9zn3189qwk"))
  246. (file-name (git-file-name name version))))
  247. (build-system cmake-build-system)
  248. (arguments
  249. '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
  250. #:tests? #f)) ; no check target
  251. (home-page "https://github.com/mcodev31/libmsym")
  252. (synopsis "C library dealing with point group symmetry in molecules")
  253. (description "libmsym is a C library dealing with point group symmetry in
  254. molecules.")
  255. (license license:expat)))
  256. (define-public mmtf-cpp
  257. (package
  258. (name "mmtf-cpp")
  259. (version "1.0.0")
  260. (source
  261. (origin
  262. (method git-fetch)
  263. (uri (git-reference
  264. (url "https://github.com/rcsb/mmtf-cpp")
  265. (commit (string-append "v" version))))
  266. (file-name (git-file-name name version))
  267. (sha256
  268. (base32
  269. "17ylramda69plf5w0v5hxbl4ggkdi5s15z55cv0pljl12yvyva8l"))))
  270. (build-system cmake-build-system)
  271. ;; Tests require the soon-to-be-deprecated version 1 of the catch-framework.
  272. (arguments
  273. '(#:tests? #f))
  274. (home-page "https://mmtf.rcsb.org/")
  275. (synopsis "C++ API for the Macromolecular Transmission Format")
  276. (description "This package is a library for the
  277. @acronym{MMTF,macromolecular transmission format}, a binary encoding of
  278. biological structures.")
  279. (license license:expat)))
  280. (define-public molequeue
  281. (package
  282. (name "molequeue")
  283. (version "0.9.0")
  284. (source
  285. (origin
  286. (method url-fetch)
  287. (uri (string-append "https://github.com/OpenChemistry/molequeue/"
  288. "releases/download/" version "/molequeue-"
  289. version ".tar.bz2"))
  290. (sha256
  291. (base32
  292. "1w1fgxzqrb5yxvpmnc3c9ymnvixy0z1nfafkd9whg9zw8nbgl998"))))
  293. (build-system cmake-build-system)
  294. (inputs
  295. `(("qtbase" ,qtbase-5)))
  296. (arguments
  297. '(#:configure-flags '("-DENABLE_TESTING=ON")
  298. #:phases
  299. (modify-phases %standard-phases
  300. (add-after 'unpack 'patch-tests
  301. (lambda _
  302. ;; TODO: Fix/enable the failing message and clientserver tests.
  303. ;; In the message test, the floating-point value "5.36893473232" on
  304. ;; line 165 of molequeue/app/testing/messagetest.cpp should
  305. ;; (apparently) be truncated, but it is not.
  306. (substitute* "molequeue/app/testing/messagetest.cpp"
  307. (("5\\.36893473232") "5.36893"))
  308. ;; It is unclear why the clientserver test fails, so it is
  309. ;; completely disabled.
  310. (substitute* "molequeue/app/testing/CMakeLists.txt"
  311. ((".*clientserver.*") ""))
  312. #t))
  313. (add-before 'check 'set-display
  314. (lambda _
  315. ;; Make Qt render "offscreen" for the sake of tests.
  316. (setenv "QT_QPA_PLATFORM" "offscreen")
  317. #t)))))
  318. (home-page "https://www.openchemistry.org/projects/molequeue/")
  319. (synopsis "Application for coordinating computational jobs")
  320. (description "MoleQueue is a system-tray resident desktop application for
  321. abstracting, managing, and coordinating the execution of tasks both locally and
  322. on remote computational resources. Users can set up local and remote queues
  323. that describe where the task will be executed. Each queue can have programs,
  324. with templates to facilitate the execution of the program. Input files can be
  325. staged, and output files collected using a standard interface.")
  326. (license license:bsd-3)))
  327. (define with-numpy-1.8
  328. (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
  329. (define-public nmoldyn
  330. (package
  331. (name "nmoldyn")
  332. (version "3.0.11")
  333. (source
  334. (origin
  335. (method git-fetch)
  336. (uri (git-reference
  337. (url "https://github.com/khinsen/nMOLDYN3")
  338. (commit (string-append "v" version))))
  339. (file-name (git-file-name name version))
  340. (sha256
  341. (base32
  342. "016h4bqg419p6s7bcx55q5iik91gqmk26hbnfgj2j6zl0j36w51r"))))
  343. (build-system python-build-system)
  344. (inputs
  345. `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
  346. ("python-scientific" ,python2-scientific)
  347. ("netcdf" ,netcdf)
  348. ("gv" ,gv)))
  349. (propagated-inputs
  350. `(("python-mmtk" ,python2-mmtk)))
  351. (arguments
  352. `(#:python ,python-2
  353. #:tests? #f ; No test suite
  354. #:phases
  355. (modify-phases %standard-phases
  356. (add-before 'build 'create-linux2-directory
  357. (lambda _
  358. (mkdir-p "nMOLDYN/linux2")))
  359. (add-before 'build 'change-PDF-viewer
  360. (lambda* (#:key inputs #:allow-other-keys)
  361. (substitute* "nMOLDYN/Preferences.py"
  362. ;; Set the paths for external executables, substituting
  363. ;; gv for acroread.
  364. ;; There is also vmd_path, but VMD is not free software
  365. ;; and Guix contains currently no free molecular viewer that
  366. ;; could be substituted.
  367. (("PREFERENCES\\['acroread_path'\\] = ''")
  368. (format #f "PREFERENCES['acroread_path'] = '~a'"
  369. (which "gv")))
  370. (("PREFERENCES\\['ncdump_path'\\] = ''")
  371. (format #f "PREFERENCES['ncdump_path'] = '~a'"
  372. (which "ncdump")))
  373. (("PREFERENCES\\['ncgen_path'\\] = ''")
  374. (format #f "PREFERENCES['ncgen_path'] = '~a'"
  375. (which "ncgen3")))
  376. (("PREFERENCES\\['task_manager_path'\\] = ''")
  377. (format #f "PREFERENCES['task_manager_path'] = '~a'"
  378. (which "task_manager")))
  379. ;; Show documentation as PDF
  380. (("PREFERENCES\\['documentation_style'\\] = 'html'")
  381. "PREFERENCES['documentation_style'] = 'pdf'") ))))))
  382. (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN.html")
  383. (synopsis "Analysis software for Molecular Dynamics trajectories")
  384. (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
  385. simulations. It is especially designed for the computation and decomposition of
  386. neutron scattering spectra, but also computes other quantities. The software
  387. is currently not actively maintained and works only with Python 2 and
  388. NumPy < 1.9.")
  389. (license license:cecill)))
  390. (define-public tng
  391. (package
  392. (name "tng")
  393. (version "1.8.2")
  394. (source (origin
  395. (method git-fetch)
  396. (uri (git-reference
  397. (url "https://github.com/gromacs/tng")
  398. (commit (string-append "v" version))))
  399. (file-name (git-file-name name version))
  400. (sha256
  401. (base32
  402. "1apf2n8nb34z09xarj7k4jgriq283l769sakjmj5aalpbilvai4q"))))
  403. (build-system cmake-build-system)
  404. (inputs
  405. `(("zlib" ,zlib)))
  406. (arguments
  407. `(#:phases
  408. (modify-phases %standard-phases
  409. (add-after 'unpack 'remove-bundled-zlib
  410. (lambda _
  411. (delete-file-recursively "external")
  412. #t))
  413. (replace 'check
  414. (lambda _
  415. (invoke "../build/bin/tests/tng_testing")
  416. #t)))))
  417. (home-page "https://github.com/gromacs/tng")
  418. (synopsis "Trajectory Next Generation binary format manipulation library")
  419. (description "TRAJNG (Trajectory next generation) is a program library for
  420. handling molecular dynamics (MD) trajectories. It can store coordinates, and
  421. optionally velocities and the H-matrix. Coordinates and velocities are
  422. stored with user-specified precision.")
  423. (license license:bsd-3)))
  424. (define-public gromacs
  425. (package
  426. (name "gromacs")
  427. (version "2020.2")
  428. (source (origin
  429. (method url-fetch)
  430. (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
  431. version ".tar.gz"))
  432. (sha256
  433. (base32
  434. "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
  435. ;; Our version of tinyxml2 is far newer than the bundled one and
  436. ;; require fixing `testutils' code. See patch header for more info
  437. (patches (search-patches "gromacs-tinyxml2.patch"))))
  438. (build-system cmake-build-system)
  439. (arguments
  440. `(#:configure-flags
  441. (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
  442. ;; Unbundling
  443. "-DGMX_USE_LMFIT=EXTERNAL"
  444. "-DGMX_BUILD_OWN_FFTW=off"
  445. "-DGMX_EXTERNAL_BLAS=on"
  446. "-DGMX_EXTERNAL_LAPACK=on"
  447. "-DGMX_EXTERNAL_TNG=on"
  448. "-DGMX_EXTERNAL_ZLIB=on"
  449. "-DGMX_EXTERNAL_TINYXML2=on"
  450. (string-append "-DTinyXML2_DIR="
  451. (assoc-ref %build-inputs "tinyxml2"))
  452. ;; Workaround for cmake/FindSphinx.cmake version parsing that does
  453. ;; not understand the guix-wrapped `sphinx-build --version' answer
  454. (string-append "-DSPHINX_EXECUTABLE_VERSION="
  455. ,(package-version python-sphinx)))
  456. #:phases
  457. (modify-phases %standard-phases
  458. (add-after 'unpack 'fixes
  459. (lambda* (#:key inputs #:allow-other-keys)
  460. ;; Still bundled: part of gromacs, source behind registration
  461. ;; but free software anyways
  462. ;;(delete-file-recursively "src/external/vmd_molfile")
  463. ;; Still bundled: threads-based OpenMPI-compatible fallback
  464. ;; designed to be bundled like that
  465. ;;(delete-file-recursively "src/external/thread_mpi")
  466. ;; Unbundling
  467. (delete-file-recursively "src/external/lmfit")
  468. (delete-file-recursively "src/external/clFFT")
  469. (delete-file-recursively "src/external/fftpack")
  470. (delete-file-recursively "src/external/build-fftw")
  471. (delete-file-recursively "src/external/tng_io")
  472. (delete-file-recursively "src/external/tinyxml2")
  473. (delete-file-recursively "src/external/googletest")
  474. (copy-recursively (assoc-ref inputs "googletest-source")
  475. "src/external/googletest")
  476. ;; This test warns about the build host hardware, disable
  477. (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
  478. (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
  479. "void __guix_disabled()"))
  480. #t)))))
  481. (native-inputs
  482. `(("doxygen" ,doxygen)
  483. ("googletest-source" ,(package-source googletest))
  484. ("graphviz" ,graphviz)
  485. ("pkg-config" ,pkg-config)
  486. ("python" ,python)
  487. ("python-pygments" ,python-pygments)
  488. ("python-sphinx" ,python-sphinx)))
  489. (inputs
  490. `(("fftwf" ,fftwf)
  491. ("hwloc" ,hwloc-2 "lib")
  492. ("lmfit" ,lmfit)
  493. ("openblas" ,openblas)
  494. ("perl" ,perl)
  495. ("tinyxml2" ,tinyxml2)
  496. ("tng" ,tng)))
  497. (home-page "http://www.gromacs.org/")
  498. (synopsis "Molecular dynamics software package")
  499. (description "GROMACS is a versatile package to perform molecular dynamics,
  500. i.e. simulate the Newtonian equations of motion for systems with hundreds to
  501. millions of particles. It is primarily designed for biochemical molecules like
  502. proteins, lipids and nucleic acids that have a lot of complicated bonded
  503. interactions, but since GROMACS is extremely fast at calculating the nonbonded
  504. interactions (that usually dominate simulations) many groups are also using it
  505. for research on non-biological systems, e.g. polymers. GROMACS supports all the
  506. usual algorithms you expect from a modern molecular dynamics implementation.")
  507. (license license:lgpl2.1+)))
  508. (define-public openbabel
  509. (package
  510. (name "openbabel")
  511. (version "3.1.1")
  512. (source (origin
  513. (method url-fetch)
  514. (uri (string-append "https://github.com/openbabel/openbabel/"
  515. "releases/download/openbabel-"
  516. (string-replace-substring version "." "-")
  517. "/openbabel-" version "-source.tar.bz2"))
  518. (sha256
  519. (base32
  520. "0s0f4zib8vshfaywsr5bjjz55jwsg6yiz2qw4i5jm8wysn0q7v56"))))
  521. (build-system cmake-build-system)
  522. (arguments
  523. `(;; FIXME: Disable tests on i686 to work around
  524. ;; https://github.com/openbabel/openbabel/issues/2041.
  525. #:tests? ,(or (%current-target-system)
  526. (not (string=? "i686-linux" (%current-system))))
  527. #:configure-flags
  528. (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
  529. (string-append "-DINCHI_LIBRARY="
  530. (assoc-ref %build-inputs "inchi")
  531. "/lib/inchi/libinchi.so.1")
  532. (string-append "-DINCHI_INCLUDE_DIR="
  533. (assoc-ref %build-inputs "inchi") "/include/inchi"))
  534. #:test-target "test"))
  535. (native-inputs
  536. `(("pkg-config" ,pkg-config)))
  537. (inputs
  538. `(("eigen" ,eigen)
  539. ("inchi" ,inchi)
  540. ("libxml2" ,libxml2)
  541. ("zlib" ,zlib)))
  542. (home-page "http://openbabel.org/wiki/Main_Page")
  543. (synopsis "Chemistry data manipulation toolbox")
  544. (description
  545. "Open Babel is a chemical toolbox designed to speak the many languages of
  546. chemical data. It's a collaborative project allowing anyone to search, convert,
  547. analyze, or store data from molecular modeling, chemistry, solid-state
  548. materials, biochemistry, or related areas.")
  549. (license license:gpl2)))
  550. (define-public spglib
  551. (package
  552. (name "spglib")
  553. (version "1.16.0")
  554. (source
  555. (origin
  556. (method git-fetch)
  557. (uri (git-reference
  558. (url "https://github.com/spglib/spglib")
  559. (commit (string-append "v" version))))
  560. (sha256
  561. (base32 "1kzc956m1pnazhz52vspqridlw72wd8x5l3dsilpdxl491aa2nws"))
  562. (file-name (git-file-name name version))))
  563. (build-system cmake-build-system)
  564. (arguments
  565. '(#:test-target "check"
  566. #:phases
  567. (modify-phases %standard-phases
  568. (add-after 'unpack 'patch-header-install-dir
  569. (lambda _
  570. ;; As of the writing of this package, CMake and GNU build systems
  571. ;; install the header to two different location. This patch makes
  572. ;; the CMake build system's choice of header directory compatible
  573. ;; with the GNU build system's choice and with what avogadrolibs
  574. ;; expects.
  575. ;; See https://github.com/spglib/spglib/issues/75 and the relevant
  576. ;; part of https://github.com/OpenChemistry/avogadroapp/issues/97.
  577. (substitute* "CMakeLists.txt"
  578. (("\\$\\{CMAKE_INSTALL_INCLUDEDIR\\}" include-dir)
  579. (string-append include-dir "/spglib")))
  580. #t)))))
  581. (home-page "https://spglib.github.io/spglib/index.html")
  582. (synopsis "Library for crystal symmetry search")
  583. (description "Spglib is a library for finding and handling crystal
  584. symmetries written in C. Spglib can be used to:
  585. @enumerate
  586. @item Find symmetry operations
  587. @item Identify space-group type
  588. @item Wyckoff position assignment
  589. @item Refine crystal structure
  590. @item Find a primitive cell
  591. @item Search irreducible k-points
  592. @end enumerate")
  593. (license license:bsd-3)))