From ead609930f300c8bb274cc1659bb53441cf62df1 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 22 Jan 2021 21:32:41 -0500 Subject: gnu: Add spglib. * gnu/packages/chemistry.scm (spglib): New variable. --- gnu/packages/chemistry.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index ddbf5ca098..129d6c1abe 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Konrad Hinsen -;;; Copyright © 2018 Kei Kebreau +;;; Copyright © 2018, 2021 Kei Kebreau ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2020 Björn Höfling @@ -29,6 +29,7 @@ #:use-module (guix git-download) #:use-module (gnu packages) #:use-module (gnu packages algebra) + #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -464,3 +465,49 @@ chemical data. It's a collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas.") (license license:gpl2))) + +(define-public spglib + (package + (name "spglib") + (version "1.16.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/spglib/spglib") + (commit (string-append "v" version)))) + (sha256 + (base32 "1kzc956m1pnazhz52vspqridlw72wd8x5l3dsilpdxl491aa2nws")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + '(#:test-target "check" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-header-install-dir + (lambda _ + ;; As of the writing of this package, CMake and GNU build systems + ;; install the header to two different location. This patch makes + ;; the CMake build system's choice of header directory compatible + ;; with the GNU build system's choice and with what avogadrolibs + ;; expects. + ;; See https://github.com/spglib/spglib/issues/75 and the relevant + ;; part of https://github.com/OpenChemistry/avogadroapp/issues/97. + (substitute* "CMakeLists.txt" + (("\\$\\{CMAKE_INSTALL_INCLUDEDIR\\}" include-dir) + (string-append include-dir "/spglib"))) + #t))))) + (home-page "https://spglib.github.io/spglib/index.html") + (synopsis "Library for crystal symmetry search") + (description "Spglib is a library for finding and handling crystal +symmetries written in C. Spglib can be used to: + +@enumerate +@item Find symmetry operations +@item Identify space-group type +@item Wyckoff position assignment +@item Refine crystal structure +@item Find a primitive cell +@item Search irreducible k-points +@end enumerate") + (license license:bsd-3))) -- cgit v1.2.3 From daa4728efc14a3c4c3893ba5e4daeda4bbdabf75 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 22 Jan 2021 22:27:21 -0500 Subject: gnu: Add mmtf-cpp. * gnu/packages/chemistry.scm (mmtf-cpp): New variable. --- gnu/packages/chemistry.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 129d6c1abe..2a42f6bcc8 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -242,6 +242,31 @@ analogy is that InChI is the bar-code for chemistry and chemical structures.") "file://LICENCE" "See LICENCE in the distribution.")))) +(define-public mmtf-cpp + (package + (name "mmtf-cpp") + (version "1.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rcsb/mmtf-cpp") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17ylramda69plf5w0v5hxbl4ggkdi5s15z55cv0pljl12yvyva8l")))) + (build-system cmake-build-system) + ;; Tests require the soon-to-be-deprecated version 1 of the catch-framework. + (arguments + '(#:tests? #f)) + (home-page "https://mmtf.rcsb.org/") + (synopsis "C++ API for the Macromolecular Transmission Format") + (description "This package is a library for the +@acronym{MMTF,macromolecular transmission format}, a binary encoding of +biological structures.") + (license license:expat))) + (define with-numpy-1.8 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8)))) -- cgit v1.2.3 From 58dd11038bcddc080fdf7745f0d8f3a8d9a46f8a Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 22 Jan 2021 23:44:15 -0500 Subject: gnu: Add molequeue. * gnu/packages/chemistry.scm (molequeue): New variable. --- gnu/packages/chemistry.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 2a42f6bcc8..87b3037589 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -267,6 +267,54 @@ analogy is that InChI is the bar-code for chemistry and chemical structures.") biological structures.") (license license:expat))) +(define-public molequeue + (package + (name "molequeue") + (version "0.9.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/OpenChemistry/molequeue/" + "releases/download/" version "/molequeue-" + version ".tar.bz2")) + (sha256 + (base32 + "1w1fgxzqrb5yxvpmnc3c9ymnvixy0z1nfafkd9whg9zw8nbgl998")))) + (build-system cmake-build-system) + (inputs + `(("qtbase" ,qtbase))) + (arguments + '(#:configure-flags '("-DENABLE_TESTING=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-tests + (lambda _ + ;; TODO: Fix/enable the failing message and clientserver tests. + ;; In the message test, the floating-point value "5.36893473232" on + ;; line 165 of molequeue/app/testing/messagetest.cpp should + ;; (apparently) be truncated, but it is not. + (substitute* "molequeue/app/testing/messagetest.cpp" + (("5\\.36893473232") "5.36893")) + ;; It is unclear why the clientserver test fails, so it is + ;; completely disabled. + (substitute* "molequeue/app/testing/CMakeLists.txt" + ((".*clientserver.*") "")) + #t)) + (add-before 'check 'set-display + (lambda _ + ;; Make Qt render "offscreen" for the sake of tests. + (setenv "QT_QPA_PLATFORM" "offscreen") + #t))))) + (home-page "https://www.openchemistry.org/projects/molequeue/") + (synopsis "Application for coordinating computational jobs") + (description "MoleQueue is a system-tray resident desktop application for +abstracting, managing, and coordinating the execution of tasks both locally and + on remote computational resources. Users can set up local and remote queues +that describe where the task will be executed. Each queue can have programs, +with templates to facilitate the execution of the program. Input files can be +staged, and output files collected using a standard interface.") + (license license:bsd-3))) + (define with-numpy-1.8 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8)))) -- cgit v1.2.3 From 68dabe3c1c5a40e060d740b0365f066773297880 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Sat, 23 Jan 2021 14:39:30 -0500 Subject: gnu: Add libmsym. * gnu/packages/chemistry.scm (libmsym): New variable. --- gnu/packages/chemistry.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 87b3037589..e97648fa3b 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -242,6 +242,30 @@ analogy is that InChI is the bar-code for chemistry and chemical structures.") "file://LICENCE" "See LICENCE in the distribution.")))) +(define-public libmsym + (package + (name "libmsym") + (version "0.2.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mcodev31/libmsym") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0a9j28irdsr461qpzlc9z1yjyb9kp64fh5zw7ylspc9zn3189qwk")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON") + #:tests? #f)) ; no check target + (home-page "https://github.com/mcodev31/libmsym") + (synopsis "C library dealing with point group symmetry in molecules") + (description "libmsym is a C library dealing with point group symmetry in +molecules.") + (license license:expat))) + (define-public mmtf-cpp (package (name "mmtf-cpp") -- cgit v1.2.3 From 1d41f7770182f4225dcb7ab197bf0a5b9cca603a Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Sat, 23 Jan 2021 12:23:11 -0500 Subject: gnu: Add avogadrolibs. * gnu/packages/chemistry.scm (avogadrolibs): New variable. --- gnu/packages/chemistry.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index e97648fa3b..e2a1ef57e1 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) + #:use-module (gnu packages backup) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -44,6 +45,7 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) @@ -135,6 +137,48 @@ science, and related areas. It offers flexible high quality rendering and a powerful plugin architecture.") (license license:gpl2+))) +(define-public avogadrolibs + (package + (name "avogadrolibs") + (version "1.93.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/OpenChemistry/avogadrolibs") + (commit version))) + (sha256 + (base32 "1xivga626n5acnmwmym8svl0pdri8hkp59czf04ri2zflnviyh39")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (native-inputs + `(("eigen" ,eigen) + ("mmtf-cpp" ,mmtf-cpp) + ("msgpack" ,msgpack) + ("googletest" ,googletest) + ("pkg-config" ,pkg-config) + ("pybind11" ,pybind11))) + (inputs + `(("glew" ,glew) + ("libarchive" ,libarchive) + ("libmsym" ,libmsym) + ("molequeue" ,molequeue) + ("python" ,python) + ("spglib" ,spglib) + ("qtbase" ,qtbase))) + (arguments + '(#:configure-flags (list "-DENABLE_TESTING=ON" + (string-append "-DSPGLIB_INCLUDE_DIR=" + (assoc-ref %build-inputs "spglib") + "/include")))) + (home-page "https://www.openchemistry.org/projects/avogadro2/") + (synopsis "Libraries for chemistry, bioinformatics, and related areas") + (description + "Avogadro libraries provide 3D rendering, visualization, analysis and data +processing useful in computational chemistry, molecular modeling, +bioinformatics, materials science, and related areas.") + (license license:bsd-3))) + (define-public domainfinder (package (name "domainfinder") -- cgit v1.2.3 From cf31ee0427ad9ac254a7fc2af9a4599d44c22f97 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Sat, 23 Jan 2021 17:29:50 -0500 Subject: gnu: Add avogadro2. * gnu/packages/chemistry.scm (avogadro2): New variable. --- gnu/packages/chemistry.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index e2a1ef57e1..5351ea596b 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -179,6 +179,41 @@ processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.") (license license:bsd-3))) +(define-public avogadro2 + (package + (name "avogadro2") + (version "1.93.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/OpenChemistry/avogadroapp") + (commit version))) + (sha256 + (base32 + "1z3pjlwja778a1dmvx9aqz2hlw5q9g3kqxhm9slz08452600jsv7")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (native-inputs + `(("eigen" ,eigen) + ("pkg-config" ,pkg-config))) + (inputs + `(("avogadrolibs" ,avogadrolibs) + ("hdf5" ,hdf5) + ("molequeue" ,molequeue) + ("qtbase" ,qtbase))) + ;; TODO: Enable tests with "-DENABLE_TESTING" configure flag. + (arguments + '(#:tests? #f)) + (home-page "https://www.openchemistry.org/projects/avogadro2/") + (synopsis "Advanced molecule editor") + (description + "Avogadro 2 is an advanced molecule editor and visualizer designed for use +in computational chemistry, molecular modeling, bioinformatics, materials +science, and related areas. It offers flexible high quality rendering and a +powerful plugin architecture.") + (license license:bsd-3))) + (define-public domainfinder (package (name "domainfinder") -- cgit v1.2.3 From 42008264d9fff544ee00c3c109093472b8a92bd2 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Fri, 29 Jan 2021 15:17:15 -0500 Subject: gnu: Remove avogadro. This package fails to build and has been superseded by avogadro2. * gnu/packages/chemistry.scm (avogadro): Remove variable. * gnu/packages/patches/avogadro-boost148.patch, gnu/packages/patches/avogadro-eigen3-update.patch, gnu/packages/patches/avogadro-python-eigen-lib.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. --- gnu/local.mk | 3 - gnu/packages/chemistry.scm | 85 --- gnu/packages/patches/avogadro-boost148.patch | 69 --- gnu/packages/patches/avogadro-eigen3-update.patch | 603 --------------------- .../patches/avogadro-python-eigen-lib.patch | 161 ------ 5 files changed, 921 deletions(-) delete mode 100644 gnu/packages/patches/avogadro-boost148.patch delete mode 100644 gnu/packages/patches/avogadro-eigen3-update.patch delete mode 100644 gnu/packages/patches/avogadro-python-eigen-lib.patch (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/local.mk b/gnu/local.mk index ee57d6fe51..4ca5d60937 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -823,9 +823,6 @@ dist_patch_DATA = \ %D%/packages/patches/audiofile-function-signature.patch \ %D%/packages/patches/automake-skip-amhello-tests.patch \ %D%/packages/patches/avahi-localstatedir.patch \ - %D%/packages/patches/avogadro-boost148.patch \ - %D%/packages/patches/avogadro-eigen3-update.patch \ - %D%/packages/patches/avogadro-python-eigen-lib.patch \ %D%/packages/patches/avidemux-install-to-lib.patch \ %D%/packages/patches/awesome-reproducible-png.patch \ %D%/packages/patches/aws-c-event-stream-cmake-prefix.patch \ diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 5351ea596b..e7b061515b 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -52,91 +52,6 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system python)) -(define-public avogadro - (package - (name "avogadro") - (version "1.2.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cryos/avogadro") - (commit version))) - (sha256 - (base32 "0258py3lkba85qhs5ynancinyym61vlp0zaq9yrfs3hhnhpzv9n2")) - (file-name (git-file-name name version)) - (patches - (search-patches "avogadro-eigen3-update.patch" - "avogadro-python-eigen-lib.patch" - "avogadro-boost148.patch")))) - (build-system cmake-build-system) - (arguments - `(#:tests? #f - #:configure-flags - (list "-DENABLE_GLSL=ON" - (string-append "-DPYTHON_LIBRARIES=" - (assoc-ref %build-inputs "python") - "/lib") - (string-append "-DPYTHON_INCLUDE_DIRS=" - (assoc-ref %build-inputs "python") - "/include/python" - ,(version-major+minor - (package-version python)))) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-python-lib-path - (lambda* (#:key outputs #:allow-other-keys) - ;; This is necessary to install the Python module in the correct - ;; directory. - (substitute* "libavogadro/src/python/CMakeLists.txt" - (("^EXECUTE_PROCESS.*$") "") - (("^.*from sys import stdout.*$") "") - (("^.*OUTPUT_VARIABLE.*") - (string-append "set(PYTHON_LIB_PATH \"" - (assoc-ref outputs "out") - "/lib/python" - ,(version-major+minor - (package-version python)) - "/site-packages\")"))) - #t)) - (add-after 'install 'wrap-program - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Make sure 'avogadro' runs with the correct PYTHONPATH. - (let* ((out (assoc-ref outputs "out"))) - (setenv "PYTHONPATH" - (string-append - (assoc-ref outputs "out") - "/lib/python" - ,(version-major+minor - (package-version python)) - "/site-packages:" - (getenv "PYTHONPATH"))) - (wrap-program (string-append out "/bin/avogadro") - `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))) - #t))))) - (native-inputs - `(("doxygen" ,doxygen) - ("pkg-config" ,pkg-config))) - (inputs - `(("boost" ,boost) - ("eigen" ,eigen) - ("glew" ,glew) - ("openbabel" ,openbabel) - ("python" ,python-2) - ("python-numpy" ,python2-numpy) - ("python-pyqt" ,python2-pyqt-4) - ("python-sip" ,python2-sip) - ("qt" ,qt-4) - ("zlib" ,zlib))) - (home-page "https://avogadro.cc") - (synopsis "Advanced molecule editor") - (description - "Avogadro is an advanced molecule editor and visualizer designed for use -in computational chemistry, molecular modeling, bioinformatics, materials -science, and related areas. It offers flexible high quality rendering and a -powerful plugin architecture.") - (license license:gpl2+))) - (define-public avogadrolibs (package (name "avogadrolibs") diff --git a/gnu/packages/patches/avogadro-boost148.patch b/gnu/packages/patches/avogadro-boost148.patch deleted file mode 100644 index f244f14674..0000000000 --- a/gnu/packages/patches/avogadro-boost148.patch +++ /dev/null @@ -1,69 +0,0 @@ -Index: avogadro-1.2.0/libavogadro/src/pythonengine_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonengine_p.h -+++ avogadro-1.2.0/libavogadro/src/pythonengine_p.h -@@ -31,7 +31,9 @@ - - #include - #include -+#ifndef Q_MOC_RUN - #include -+#endif - - namespace Avogadro { - -Index: avogadro-1.2.0/libavogadro/src/pythonextension_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonextension_p.h -+++ avogadro-1.2.0/libavogadro/src/pythonextension_p.h -@@ -33,7 +33,9 @@ - #include - #include - #include -+#ifndef Q_MOC_RUN - #include -+#endif - - #include - #include -Index: avogadro-1.2.0/libavogadro/src/pythontool_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythontool_p.h -+++ avogadro-1.2.0/libavogadro/src/pythontool_p.h -@@ -31,7 +31,9 @@ - - #include - #include -+#ifndef Q_MOC_RUN - #include -+#endif - - #include - #include -Index: avogadro-1.2.0/libavogadro/src/pythoninterpreter.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythoninterpreter.h -+++ avogadro-1.2.0/libavogadro/src/pythoninterpreter.h -@@ -26,7 +26,9 @@ - #define PYTHONINTERPRETER_H - - #include -+#ifndef Q_MOC_RUN - #include -+#endif - #include - #include - -Index: avogadro-1.2.0/libavogadro/src/pythonscript.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonscript.h -+++ avogadro-1.2.0/libavogadro/src/pythonscript.h -@@ -27,6 +27,8 @@ - #define PYTHONSCRIPT_H - - #include -+#ifndef Q_MOC_RUN - #include -+#endif - - #include "pythonerror.h" diff --git a/gnu/packages/patches/avogadro-eigen3-update.patch b/gnu/packages/patches/avogadro-eigen3-update.patch deleted file mode 100644 index a5f669292f..0000000000 --- a/gnu/packages/patches/avogadro-eigen3-update.patch +++ /dev/null @@ -1,603 +0,0 @@ -From 43af3c117b0b3220b15c2fe2895b94bbd83d3a60 Mon Sep 17 00:00:00 2001 -From: Claudio Fernandes -Date: Sun, 15 Jan 2017 21:23:39 -0200 -Subject: [PATCH] Adapt Avogadro to Eigen 3.3 - ---- - CMakeLists.txt | 9 +------ - avogadro/src/mainwindow.cpp | 5 ++-- - libavogadro/src/camera.cpp | 10 ++++---- - libavogadro/src/camera.h | 14 +++++------ - libavogadro/src/engines/wireengine.cpp | 4 ++-- - .../crystallography/crystallographyextension.cpp | 2 +- - .../crystallography/ui/ceviewoptionswidget.cpp | 2 +- - .../src/extensions/orca/orcaanalysedialog.cpp | 1 - - .../src/extensions/orca/orcainputdialog.cpp | 1 - - .../src/extensions/qtaim/qtaimmathutilities.cpp | 1 + - .../qtaim/qtaimwavefunctionevaluator.cpp | 28 +++++++++++----------- - .../extensions/surfaces/openqube/gamessukout.cpp | 1 + - .../src/extensions/surfaces/openqube/slaterset.cpp | 6 +++-- - libavogadro/src/glpainter_p.cpp | 14 +++++------ - libavogadro/src/glwidget.cpp | 4 ++-- - libavogadro/src/molecule.cpp | 26 ++++++++++++++++++-- - libavogadro/src/navigate.cpp | 2 +- - libavogadro/src/tools/bondcentrictool.cpp | 28 +++++++++++----------- - libavogadro/src/tools/manipulatetool.cpp | 17 +++++++------ - libavogadro/src/tools/navigatetool.cpp | 3 ++- - libavogadro/src/tools/skeletontree.cpp | 7 +++--- - libavogadro/src/tools/skeletontree.h | 2 +- - 22 files changed, 102 insertions(+), 85 deletions(-) - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -231,14 +231,7 @@ if(NOT Linguist_FOUND) - message(WARNING " Qt4 Linguist not found, please install it if you want Avogadro translations") - endif() - --find_package(Eigen3) # find and setup Eigen3 if available --if(NOT EIGEN3_FOUND) -- message(STATUS "Cannot find Eigen3, trying Eigen2") -- find_package(Eigen2 REQUIRED) # Some version is required --else() --# Use Stage10 Eigen3 support -- set (EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API TRUE) --endif() -+find_package(Eigen3 REQUIRED) # find and setup Eigen3 if available - - find_package(ZLIB REQUIRED) - find_package(OpenBabel2 REQUIRED) # find and setup OpenBabel ---- a/avogadro/src/mainwindow.cpp -+++ b/avogadro/src/mainwindow.cpp -@@ -115,7 +115,6 @@ - #include - - #include --#include - #define USEQUAT - // This is a "hidden" exported Qt function on the Mac for Qt-4.x. - #ifdef Q_WS_MAC -@@ -2775,7 +2774,7 @@ protected: - linearGoal.row(1) = linearGoal.row(2).cross(linearGoal.row(0)); - - // calculate the translation matrix -- Transform3d goal(linearGoal); -+ Projective3d goal(linearGoal); - - goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ()); - -@@ -2840,7 +2839,7 @@ protected: - Matrix3d linearGoal = Matrix3d::Identity(); - - // calculate the translation matrix -- Transform3d goal(linearGoal); -+ Projective3d goal(linearGoal); - - goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ()); - ---- a/libavogadro/src/camera.cpp -+++ b/libavogadro/src/camera.cpp -@@ -47,7 +47,7 @@ namespace Avogadro - - CameraPrivate() {}; - -- Eigen::Transform3d modelview, projection; -+ Eigen::Projective3d modelview, projection; - const GLWidget *parent; - double angleOfViewY; - double orthoScale; -@@ -169,20 +169,20 @@ namespace Avogadro - - double Camera::distance(const Eigen::Vector3d & point) const - { -- return ( d->modelview * point ).norm(); -+ return ( d->modelview * point.homogeneous() ).head<3>().norm(); - } - -- void Camera::setModelview(const Eigen::Transform3d &matrix) -+ void Camera::setModelview(const Eigen::Projective3d &matrix) - { - d->modelview = matrix; - } - -- const Eigen::Transform3d & Camera::modelview() const -+ const Eigen::Projective3d & Camera::modelview() const - { - return d->modelview; - } - -- Eigen::Transform3d & Camera::modelview() -+ Eigen::Projective3d & Camera::modelview() - { - return d->modelview; - } ---- a/libavogadro/src/camera.h -+++ b/libavogadro/src/camera.h -@@ -101,16 +101,16 @@ namespace Avogadro { - double angleOfViewY() const; - /** Sets 4x4 "modelview" matrix representing the camera orientation and position. - * @param matrix the matrix to copy from -- * @sa Eigen::Transform3d & modelview(), applyModelview() */ -- void setModelview(const Eigen::Transform3d &matrix); -+ * @sa Eigen::Projective3d & modelview(), applyModelview() */ -+ void setModelview(const Eigen::Projective3d &matrix); - /** @return a constant reference to the 4x4 "modelview" matrix representing - * the camera orientation and position -- * @sa setModelview(), Eigen::Transform3d & modelview() */ -- const Eigen::Transform3d & modelview() const; -+ * @sa setModelview(), Eigen::Projective3d & modelview() */ -+ const Eigen::Projective3d & modelview() const; - /** @return a non-constant reference to the 4x4 "modelview" matrix representing - * the camera orientation and position -- * @sa setModelview(), const Eigen::Transform3d & modelview() const */ -- Eigen::Transform3d & modelview(); -+ * @sa setModelview(), const Eigen::Projective3d & modelview() const */ -+ Eigen::Projective3d & modelview(); - /** Calls gluPerspective() or glOrtho() with parameters automatically chosen - * for rendering the GLWidget's molecule with this camera. Should be called - * only in GL_PROJECTION matrix mode. Example code is given -@@ -342,7 +342,7 @@ namespace Avogadro { - * @return {x/w, y/w, z/w} vector - */ - Eigen::Vector3d V4toV3DivW(const Eigen::Vector4d & v4) { -- return v4.start<3>()/v4.w(); -+ return v4.head<3>()/v4.w(); - } - }; - ---- a/libavogadro/src/engines/wireengine.cpp -+++ b/libavogadro/src/engines/wireengine.cpp -@@ -109,7 +109,7 @@ namespace Avogadro { - const Camera *camera = pd->camera(); - - // perform a rough form of frustum culling -- Eigen::Vector3d transformedPos = pd->camera()->modelview() * v; -+ Eigen::Vector3d transformedPos = (pd->camera()->modelview() * v.homogeneous()).head<3>(); - double dot = transformedPos.z() / transformedPos.norm(); - if(dot > -0.8) - return true; -@@ -167,7 +167,7 @@ namespace Avogadro { - map = pd->colorMap(); // fall back to global color map - - // perform a rough form of frustum culling -- Eigen::Vector3d transformedEnd1 = pd->camera()->modelview() * v1; -+ Eigen::Vector3d transformedEnd1 = (pd->camera()->modelview() * v1.homogeneous()).head<3>(); - double dot = transformedEnd1.z() / transformedEnd1.norm(); - if(dot > -0.8) - return true; // i.e., don't bother rendering ---- a/libavogadro/src/extensions/crystallography/crystallographyextension.cpp -+++ b/libavogadro/src/extensions/crystallography/crystallographyextension.cpp -@@ -1989,7 +1989,7 @@ namespace Avogadro - // fix coordinates - // Apply COB matrix: - Eigen::Matrix3d invCob; -- cob.computeInverse(&invCob); -+ invCob = cob.inverse(); - for (QList::iterator - it = fcoords.begin(), - it_end = fcoords.end(); ---- a/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp -+++ b/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp -@@ -139,7 +139,7 @@ namespace Avogadro - { - // View into a Miller plane - Camera *camera = m_glWidget->camera(); -- Eigen::Transform3d modelView; -+ Eigen::Projective3d modelView; - modelView.setIdentity(); - - // OK, so we want to rotate to look along the normal at the plane ---- a/libavogadro/src/extensions/orca/orcaanalysedialog.cpp -+++ b/libavogadro/src/extensions/orca/orcaanalysedialog.cpp -@@ -41,7 +41,6 @@ - #include - - #include --#include - - #include - ---- a/libavogadro/src/extensions/orca/orcainputdialog.cpp -+++ b/libavogadro/src/extensions/orca/orcainputdialog.cpp -@@ -33,7 +33,6 @@ - #include - - #include --#include - - #include - ---- a/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp -+++ b/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp -@@ -28,6 +28,7 @@ - - #include - #include -+#include - - namespace Avogadro { - namespace QTAIMMathUtilities { ---- a/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp -+++ b/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp -@@ -35,21 +35,21 @@ namespace Avogadro - m_nprim=wfn.numberOfGaussianPrimitives(); - m_nnuc=wfn.numberOfNuclei(); - -- m_nucxcoord=Map >(wfn.xNuclearCoordinates(),m_nnuc); -- m_nucycoord=Map >(wfn.yNuclearCoordinates(),m_nnuc); -- m_nuczcoord=Map >(wfn.zNuclearCoordinates(),m_nnuc); -- m_nucz=Map >(wfn.nuclearCharges(),m_nnuc); -- m_X0=Map >(wfn.xGaussianPrimitiveCenterCoordinates(),m_nprim,1); -- m_Y0=Map >(wfn.yGaussianPrimitiveCenterCoordinates(),m_nprim,1); -- m_Z0=Map >(wfn.zGaussianPrimitiveCenterCoordinates(),m_nprim,1); -- m_xamom=Map >(wfn.xGaussianPrimitiveAngularMomenta(),m_nprim,1); -- m_yamom=Map >(wfn.yGaussianPrimitiveAngularMomenta(),m_nprim,1); -- m_zamom=Map >(wfn.zGaussianPrimitiveAngularMomenta(),m_nprim,1); -- m_alpha=Map >(wfn.gaussianPrimitiveExponentCoefficients(),m_nprim,1); -+ m_nucxcoord=Map >(const_cast(wfn.xNuclearCoordinates()),m_nnuc); -+ m_nucycoord=Map >(const_cast(wfn.yNuclearCoordinates()),m_nnuc); -+ m_nuczcoord=Map >(const_cast(wfn.zNuclearCoordinates()),m_nnuc); -+ m_nucz=Map >(const_cast(wfn.nuclearCharges()),m_nnuc); -+ m_X0=Map >(const_cast(wfn.xGaussianPrimitiveCenterCoordinates()),m_nprim,1); -+ m_Y0=Map >(const_cast(wfn.yGaussianPrimitiveCenterCoordinates()),m_nprim,1); -+ m_Z0=Map >(const_cast(wfn.zGaussianPrimitiveCenterCoordinates()),m_nprim,1); -+ m_xamom=Map >(const_cast(wfn.xGaussianPrimitiveAngularMomenta()),m_nprim,1); -+ m_yamom=Map >(const_cast(wfn.yGaussianPrimitiveAngularMomenta()),m_nprim,1); -+ m_zamom=Map >(const_cast(wfn.zGaussianPrimitiveAngularMomenta()),m_nprim,1); -+ m_alpha=Map >(const_cast(wfn.gaussianPrimitiveExponentCoefficients()),m_nprim,1); - // TODO Implement screening for unoccupied molecular orbitals. -- m_occno=Map >(wfn.molecularOrbitalOccupationNumbers(),m_nmo,1); -- m_orbe=Map >(wfn.molecularOrbitalEigenvalues(),m_nmo,1); -- m_coef=Map >(wfn.molecularOrbitalCoefficients(),m_nmo,m_nprim); -+ m_occno=Map >(const_cast(wfn.molecularOrbitalOccupationNumbers()),m_nmo,1); -+ m_orbe=Map >(const_cast(wfn.molecularOrbitalEigenvalues()),m_nmo,1); -+ m_coef=Map >(const_cast(wfn.molecularOrbitalCoefficients()),m_nmo,m_nprim); - m_totalEnergy=wfn.totalEnergy(); - m_virialRatio=wfn.virialRatio(); - ---- a/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp -+++ b/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp -@@ -19,6 +19,7 @@ - using Eigen::Vector3d; - using std::vector; - -+#include - #include - - namespace OpenQube ---- a/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp -+++ b/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp -@@ -25,9 +25,9 @@ - - #include "cube.h" - --#include - #include - #include -+#include - - #include - -@@ -250,7 +250,9 @@ bool SlaterSet::initialize() - - SelfAdjointEigenSolver s(m_overlap); - MatrixXd p = s.eigenvectors(); -- MatrixXd m = p * s.eigenvalues().cwise().inverse().cwise().sqrt().asDiagonal() * p.inverse(); -+ // TODO check if this is correct -+ MatrixXd m1 = (s.eigenvalues().array().inverse().sqrt()); -+ MatrixXd m = p.array()*(m1.diagonal().array())*p.inverse().array(); - m_normalized = m * m_eigenVectors; - - if (!(m_overlap*m*m).isIdentity()) ---- a/libavogadro/src/glpainter_p.cpp -+++ b/libavogadro/src/glpainter_p.cpp -@@ -789,13 +789,13 @@ namespace Avogadro - } else { - points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u; - } -- points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]); -+ points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>(); - } - - // Get vectors representing the points' positions in terms of the model view. -- Eigen::Vector3d _origin = d->widget->camera()->modelview() * origin; -- Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin+u); -- Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin+v); -+ Eigen::Vector3d _origin = (d->widget->camera()->modelview() * origin.homogeneous()).head<3>(); -+ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin+u).homogeneous()).head<3>(); -+ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin+v).homogeneous()).head<3>(); - - glPushAttrib(GL_ALL_ATTRIB_BITS); - glPushMatrix(); -@@ -880,12 +880,12 @@ namespace Avogadro - } else { - points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u; - } -- points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]); -+ points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>(); - } - - // Get vectors representing the points' positions in terms of the model view. -- Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin + u); -- Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin + v); -+ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin + u).homogeneous()).head<3>(); -+ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin + v).homogeneous()).head<3>(); - - glPushAttrib(GL_ALL_ATTRIB_BITS); - glPushMatrix(); ---- a/libavogadro/src/glwidget.cpp -+++ b/libavogadro/src/glwidget.cpp -@@ -765,7 +765,7 @@ namespace Avogadro { - GLfloat fogColor[4]= {static_cast(d->background.redF()), static_cast(d->background.greenF()), - static_cast(d->background.blueF()), static_cast(d->background.alphaF())}; - glFogfv(GL_FOG_COLOR, fogColor); -- Vector3d distance = camera()->modelview() * d->center; -+ Vector3d distance = (camera()->modelview() * d->center.homogeneous()).head<3>(); - double distanceToCenter = distance.norm(); - glFogf(GL_FOG_DENSITY, 1.0); - glHint(GL_FOG_HINT, GL_NICEST); -@@ -1711,7 +1711,7 @@ namespace Avogadro { - - if (d->renderModelViewDebug) { - // Model view matrix: -- const Eigen::Transform3d &modelview = d->camera->modelview(); -+ const Eigen::Projective3d &modelview = d->camera->modelview(); - y += d->pd->painter()->drawText - (x, y, tr("ModelView row 1: %L1 %L2 %L3 %L4") - .arg(modelview(0, 0), 6, 'f', 2, ' ') ---- a/libavogadro/src/molecule.cpp -+++ b/libavogadro/src/molecule.cpp -@@ -38,7 +38,7 @@ - #include "zmatrix.h" - - #include --#include -+#include - - #include - -@@ -1907,7 +1907,29 @@ namespace Avogadro{ - } - d->center /= static_cast(nAtoms); - Eigen::Hyperplane planeCoeffs; -- Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs); -+ //Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs); -+ -+ // TODO check if this is OK -+ /************************/ -+ typedef Eigen::Matrix CovMatrixType; -+ typedef Eigen::Vector3d VectorType; -+ -+ VectorType mean = d->center; -+ int size=3; -+ int numPoints=numAtoms(); -+ VectorType ** points=atomPositions; -+ CovMatrixType covMat = CovMatrixType::Zero(size, size); -+ VectorType remean = VectorType::Zero(size); -+ for(int i = 0; i < numPoints; ++i) -+ { -+ VectorType diff = (*(points[i]) - mean).conjugate(); -+ covMat += diff * diff.adjoint(); -+ } -+ Eigen::SelfAdjointEigenSolver eig(covMat); -+ planeCoeffs.normal() = eig.eigenvectors().col(0); -+ /************************/ -+ -+ - delete[] atomPositions; - d->normalVector = planeCoeffs.normal(); - } ---- a/libavogadro/src/navigate.cpp -+++ b/libavogadro/src/navigate.cpp -@@ -40,7 +40,7 @@ namespace Avogadro { - void Navigate::zoom(GLWidget *widget, const Eigen::Vector3d &goal, - double delta) - { -- Vector3d transformedGoal = widget->camera()->modelview() * goal; -+ Vector3d transformedGoal = (widget->camera()->modelview() * goal.homogeneous()).head<3>(); - double distanceToGoal = transformedGoal.norm(); - - double t = ZOOM_SPEED * delta; ---- a/libavogadro/src/tools/bondcentrictool.cpp -+++ b/libavogadro/src/tools/bondcentrictool.cpp -@@ -578,8 +578,8 @@ namespace Avogadro { - - Vector3d clicked = *m_clickedAtom->pos(); - -- Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >= -- (widget->camera()->modelview() * center).z() ? -1 : 1)); -+ Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >= -+ (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1)); - - Vector3d centerProj = widget->camera()->project(center); - centerProj -= Vector3d(0,0,centerProj.z()); -@@ -673,8 +673,8 @@ namespace Avogadro { - - Vector3d clicked = *m_clickedAtom->pos(); - -- Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >= -- (widget->camera()->modelview() * center).z() ? -1 : 1)); -+ Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >= -+ (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1)); - - Vector3d centerProj = widget->camera()->project(center); - centerProj -= Vector3d(0,0,centerProj.z()); -@@ -1362,10 +1362,10 @@ namespace Avogadro { - - planeVec = length * (planeVec / planeVec.norm()); - -- Vector3d topLeft = widget->camera()->modelview() * (left + planeVec); -- Vector3d topRight = widget->camera()->modelview() * (right + planeVec); -- Vector3d botRight = widget->camera()->modelview() * (right - planeVec); -- Vector3d botLeft = widget->camera()->modelview() * (left - planeVec); -+ Vector3d topLeft = (widget->camera()->modelview() * (left + planeVec).homogeneous()).head<3>(); -+ Vector3d topRight = (widget->camera()->modelview() * (right + planeVec).homogeneous()).head<3>(); -+ Vector3d botRight = (widget->camera()->modelview() * (right - planeVec).homogeneous()).head<3>(); -+ Vector3d botLeft = (widget->camera()->modelview() * (left - planeVec).homogeneous()).head<3>(); - - float alpha = 0.4; - double lineWidth = 1.5; -@@ -1444,10 +1444,10 @@ namespace Avogadro { - C = D + ((C-D).normalized() * minWidth); - } - -- Vector3d topLeft = widget->camera()->modelview() * D; -- Vector3d topRight = widget->camera()->modelview() * C; -- Vector3d botRight = widget->camera()->modelview() * B; -- Vector3d botLeft = widget->camera()->modelview() * A; -+ Vector3d topLeft = (widget->camera()->modelview() * D.homogeneous()).head<3>(); -+ Vector3d topRight = (widget->camera()->modelview() * C.homogeneous()).head<3>(); -+ Vector3d botRight = (widget->camera()->modelview() * B.homogeneous()).head<3>(); -+ Vector3d botLeft = (widget->camera()->modelview() * A.homogeneous()).head<3>(); - - float alpha = 0.4; - double lineWidth = 1.5; -@@ -1506,12 +1506,12 @@ namespace Avogadro { - Vector3d positionVector) - { - //Rotate skeleton around a particular axis and center point -- Eigen::Transform3d rotation; -+ Eigen::Projective3d rotation; - rotation = Eigen::AngleAxisd(angle, rotationVector); - rotation.pretranslate(centerVector); - rotation.translate(-centerVector); - -- return rotation*positionVector; -+ return (rotation*positionVector.homogeneous()).head<3>(); - } - - // ########## showAnglesChanged ########## ---- a/libavogadro/src/tools/manipulatetool.cpp -+++ b/libavogadro/src/tools/manipulatetool.cpp -@@ -40,7 +40,6 @@ - #include - - using Eigen::Vector3d; --using Eigen::Transform3d; - using Eigen::AngleAxisd; - - namespace Avogadro { -@@ -138,7 +137,7 @@ namespace Avogadro { - double yRotate = m_settingsWidget->yRotateSpinBox->value() * DEG_TO_RAD; - double zRotate = m_settingsWidget->zRotateSpinBox->value() * DEG_TO_RAD; - -- Eigen::Transform3d rotation; -+ Eigen::Projective3d rotation; - rotation.matrix().setIdentity(); - rotation.translation() = center; - rotation.rotate(AngleAxisd(xRotate, Vector3d::UnitX()) -@@ -152,12 +151,12 @@ namespace Avogadro { - if (p->type() == Primitive::AtomType) { - Atom *atom = static_cast(p); - tempPos = translate + *(atom->pos()); -- atom->setPos(rotation * tempPos); -+ atom->setPos((rotation * tempPos.homogeneous()).head<3>()); - } - } else { - foreach(Atom *atom, widget->molecule()->atoms()) { - tempPos = translate + *(atom->pos()); -- atom->setPos(rotation * tempPos); -+ atom->setPos((rotation * tempPos.homogeneous()).head<3>()); - } - } - -@@ -199,7 +198,7 @@ namespace Avogadro { - widget->setCursor(Qt::SizeVerCursor); - - // Move the selected atom(s) in to or out of the screen -- Vector3d transformedGoal = widget->camera()->modelview() * *goal; -+ Vector3d transformedGoal = (widget->camera()->modelview() * goal->homogeneous()).head<3>(); - double distanceToGoal = transformedGoal.norm(); - - double t = ZOOM_SPEED * delta; -@@ -255,7 +254,7 @@ namespace Avogadro { - - // Rotate the selected atoms about the center - // rotate only selected primitives -- Transform3d fragmentRotation; -+ Eigen::Projective3d fragmentRotation; - fragmentRotation.matrix().setIdentity(); - fragmentRotation.translation() = *center; - fragmentRotation.rotate( -@@ -266,7 +265,7 @@ namespace Avogadro { - - foreach(Primitive *p, widget->selectedPrimitives()) - if (p->type() == Primitive::AtomType) -- static_cast(p)->setPos(fragmentRotation * *static_cast(p)->pos()); -+ static_cast(p)->setPos((fragmentRotation * static_cast(p)->pos()->homogeneous()).head<3>()); - widget->molecule()->update(); - } - -@@ -274,7 +273,7 @@ namespace Avogadro { - double delta) const - { - // Tilt the selected atoms about the center -- Transform3d fragmentRotation; -+ Eigen::Projective3d fragmentRotation; - fragmentRotation.matrix().setIdentity(); - fragmentRotation.translation() = *center; - fragmentRotation.rotate(AngleAxisd(delta * ROTATION_SPEED, widget->camera()->backTransformedZAxis())); -@@ -282,7 +281,7 @@ namespace Avogadro { - - foreach(Primitive *p, widget->selectedPrimitives()) - if (p->type() == Primitive::AtomType) -- static_cast(p)->setPos(fragmentRotation * *static_cast(p)->pos()); -+ static_cast(p)->setPos((fragmentRotation * static_cast(p)->pos()->homogeneous()).head<3>()); - widget->molecule()->update(); - } - ---- a/libavogadro/src/tools/navigatetool.cpp -+++ b/libavogadro/src/tools/navigatetool.cpp -@@ -92,7 +92,8 @@ namespace Avogadro { - double sumOfWeights = 0.; - QList atoms = widget->molecule()->atoms(); - foreach (Atom *atom, atoms) { -- Vector3d transformedAtomPos = widget->camera()->modelview() * *atom->pos(); -+ Vector3d transformedAtomPos = (widget->camera()->modelview() * -+ atom->pos()->homogeneous()).head<3>(); - double atomDistance = transformedAtomPos.norm(); - double dot = transformedAtomPos.z() / atomDistance; - double weight = exp(-30. * (1. + dot)); ---- a/libavogadro/src/tools/skeletontree.cpp -+++ b/libavogadro/src/tools/skeletontree.cpp -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - using namespace Eigen; - using namespace std; -@@ -221,7 +222,7 @@ namespace Avogadro { - { - if (m_rootNode) { - //Rotate skeleton around a particular axis and center point -- Eigen::Transform3d rotation; -+ Eigen::Projective3d rotation; - rotation = Eigen::AngleAxisd(angle, rotationAxis); - rotation.pretranslate(centerVector); - rotation.translate(-centerVector); -@@ -248,11 +249,11 @@ namespace Avogadro { - // ########## recursiveRotate ########## - - void SkeletonTree::recursiveRotate(Node* n, -- const Eigen::Transform3d &rotationMatrix) -+ const Eigen::Projective3d &rotationMatrix) - { - // Update the root node with the new position - Atom* a = n->atom(); -- a->setPos(rotationMatrix * (*a->pos())); -+ a->setPos((rotationMatrix * (*a->pos()).homogeneous()).head<3>()); - a->update(); - - // Now update the children ---- a/libavogadro/src/tools/skeletontree.h -+++ b/libavogadro/src/tools/skeletontree.h -@@ -230,6 +230,6 @@ namespace Avogadro { - * @param centerVector Center location to rotate around. - */ - void recursiveRotate(Node* n, -- const Eigen::Transform3d &rotationMatrix); -+ const Eigen::Projective3d &rotationMatrix); - - }; - } // End namespace Avogadro \ No newline at end of file diff --git a/gnu/packages/patches/avogadro-python-eigen-lib.patch b/gnu/packages/patches/avogadro-python-eigen-lib.patch deleted file mode 100644 index ac9f2e30af..0000000000 --- a/gnu/packages/patches/avogadro-python-eigen-lib.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 2d4be7ede177a8df7340fe3b209698d591ee8a04 Mon Sep 17 00:00:00 2001 -From: Claudio Fernandes -Date: Mon, 16 Jan 2017 19:48:23 -0200 -Subject: [PATCH] Adapt libavogadro/python to Eigen 3.3 - ---- - libavogadro/src/python/camera.cpp | 2 +- - libavogadro/src/python/eigen.cpp | 60 +++++++++++++++++++-------------------- - 2 files changed, 31 insertions(+), 31 deletions(-) - -diff --git a/libavogadro/src/python/camera.cpp b/libavogadro/src/python/camera.cpp -index 69ca87bf8..30b32af7d 100644 ---- a/libavogadro/src/python/camera.cpp -+++ b/libavogadro/src/python/camera.cpp -@@ -10,7 +10,7 @@ using namespace Avogadro; - void export_Camera() - { - -- const Eigen::Transform3d& (Camera::*modelview_ptr)() const = &Camera::modelview; -+ const Eigen::Projective3d& (Camera::*modelview_ptr)() const = &Camera::modelview; - Eigen::Vector3d (Camera::*unProject_ptr1)(const Eigen::Vector3d&) const = &Camera::unProject; - Eigen::Vector3d (Camera::*unProject_ptr2)(const QPoint&, const Eigen::Vector3d&) const = &Camera::unProject; - Eigen::Vector3d (Camera::*unProject_ptr3)(const QPoint&) const = &Camera::unProject; -diff --git a/libavogadro/src/python/eigen.cpp b/libavogadro/src/python/eigen.cpp -index c1faedbcc..20b4e719d 100644 ---- a/libavogadro/src/python/eigen.cpp -+++ b/libavogadro/src/python/eigen.cpp -@@ -305,9 +305,9 @@ template <> struct ScalarTraits - struct innerclass - { - // -- // Eigen::Transform3d --> python array (4x4) -+ // Eigen::Projective3d --> python array (4x4) - // -- static PyObject* convert(Eigen::Transform3d const &trans) -+ static PyObject* convert(Eigen::Projective3d const &trans) - { - npy_intp dims[2] = { 4, 4 }; - PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE); -@@ -321,9 +321,9 @@ template <> struct ScalarTraits - return incref(result); - } - // -- // Eigen::Transform3d* --> python array (4x4) -+ // Eigen::Projective3d* --> python array (4x4) - // -- static PyObject* convert(Eigen::Transform3d *trans) -+ static PyObject* convert(Eigen::Projective3d *trans) - { - npy_intp dims[2] = { 4, 4 }; - PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE); -@@ -337,9 +337,9 @@ template <> struct ScalarTraits - return incref(result); - } - // -- // const Eigen::Transform3d* --> python array (4x4) -+ // const Eigen::Projective3d* --> python array (4x4) - // -- static PyObject* convert(const Eigen::Transform3d *trans) -+ static PyObject* convert(const Eigen::Projective3d *trans) - { - npy_intp dims[2] = { 4, 4 }; - PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE); -@@ -358,10 +358,10 @@ template <> struct ScalarTraits - Transform3d_to_python_array() - { - #ifndef WIN32 -- to_python_converter(); -+ to_python_converter(); - #endif -- to_python_converter(); -- to_python_converter(); -+ to_python_converter(); -+ to_python_converter(); - } - - }; -@@ -373,17 +373,17 @@ template <> struct ScalarTraits - // Insert an rvalue from_python converter at the tail of the - // chain. Used for implicit conversions - // -- // python array --> Eigen::Transform3d -+ // python array --> Eigen::Projective3d - // - // used for: - // -- // void function(Eigen::Transform3d vec) -- // void function(Eigen::Transform3d & vec) -- // void function(const Eigen::Transform3d & vec) -+ // void function(Eigen::Projective3d vec) -+ // void function(Eigen::Projective3d & vec) -+ // void function(const Eigen::Projective3d & vec) - // -- converter::registry::push_back( &convertible, &construct, type_id() ); -+ converter::registry::push_back( &convertible, &construct, type_id() ); - -- converter::registry::insert( &convert, type_id() ); -+ converter::registry::insert( &convert, type_id() ); - } - - static void* convert(PyObject *obj_ptr) -@@ -401,7 +401,7 @@ template <> struct ScalarTraits - throw_error_already_set(); // the 1D array does not have exactly 3 elements - - double *values = reinterpret_cast(array->data); -- Eigen::Transform3d *c_obj = new Eigen::Transform3d(); -+ Eigen::Projective3d *c_obj = new Eigen::Projective3d(); - double *dataPtr = c_obj->data(); - - for (int i = 0; i < 16; ++i) -@@ -432,7 +432,7 @@ template <> struct ScalarTraits - // I think this is a better way to get at the double array, where is this - // deleted though? Does Boost::Python do it? - double *values = reinterpret_cast(array->data); -- Eigen::Transform3d *storage = new Eigen::Transform3d(); -+ Eigen::Projective3d *storage = new Eigen::Projective3d(); - double *dataPtr = storage->data(); - - for (int i = 0; i < 16; ++i) -@@ -467,21 +467,21 @@ class EigenUnitTestHelper - void set_vector3d_ptr(Eigen::Vector3d* vec) { m_vector3d = *vec; } - void set_const_vector3d_ptr(const Eigen::Vector3d* const vec) { m_vector3d = *vec; } - -- //Eigen::Transform3d transform3d() { return m_transform3d; } -- //Eigen::Transform3d& transform3d_ref() { return m_transform3d; } -- const Eigen::Transform3d& const_transform3d_ref() { return m_transform3d; } -- Eigen::Transform3d* transform3d_ptr() { return &m_transform3d; } -- const Eigen::Transform3d* const_transform3d_ptr() { return &m_transform3d; } -- -- //void set_transform3d(Eigen::Transform3d vec) { m_transform3d = vec; } -- //void set_transform3d_ref(Eigen::Transform3d& vec) { m_transform3d = vec; } -- void set_const_transform3d_ref(const Eigen::Transform3d& vec) { m_transform3d = vec; } -- void set_transform3d_ptr(Eigen::Transform3d* vec) { m_transform3d = *vec; } -- void set_const_transform3d_ptr(const Eigen::Transform3d* const vec) { m_transform3d = *vec; } -+ //Eigen::Projective3d transform3d() { return m_transform3d; } -+ //Eigen::Projective3d& transform3d_ref() { return m_transform3d; } -+ const Eigen::Projective3d& const_transform3d_ref() { return m_transform3d; } -+ Eigen::Projective3d* transform3d_ptr() { return &m_transform3d; } -+ const Eigen::Projective3d* const_transform3d_ptr() { return &m_transform3d; } -+ -+ //void set_transform3d(Eigen::Projective3d vec) { m_transform3d = vec; } -+ //void set_transform3d_ref(Eigen::Projective3d& vec) { m_transform3d = vec; } -+ void set_const_transform3d_ref(const Eigen::Projective3d& vec) { m_transform3d = vec; } -+ void set_transform3d_ptr(Eigen::Projective3d* vec) { m_transform3d = *vec; } -+ void set_const_transform3d_ptr(const Eigen::Projective3d* const vec) { m_transform3d = *vec; } - - private: - Eigen::Vector3d m_vector3d; -- Eigen::Transform3d m_transform3d; -+ Eigen::Projective3d m_transform3d; - - }; - #endif -@@ -529,6 +529,6 @@ void export_Eigen() - Vector3x_to_python_array(); - Vector3x_from_python_array(); - -- // Eigen::Transform3d -+ // Eigen::Projective3d - Transform3d_to_python_array(); - Transform3d_from_python_array(); -- cgit v1.2.3 From 35bb3d5ffd84778e1d97eeebc27711f8c35d045b Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Tue, 26 Jan 2021 00:02:01 -0500 Subject: gnu: inchi: Update to 1.06. * gnu/packages/chemistry.scm (inchi): Update to 1.06. [source]: Use HTTPS. [native-inputs]: Update inchi-doc hash. --- gnu/packages/chemistry.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index e7b061515b..69cfed454a 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -161,15 +161,16 @@ only with Python 2 and NumPy < 1.9.") (define-public inchi (package (name "inchi") - (version "1.05") + ;; Update the inchi-doc native input when updating inchi. + (version "1.06") (source (origin (method url-fetch) - (uri (string-append "http://www.inchi-trust.org/download/" + (uri (string-append "https://www.inchi-trust.org/download/" (string-join (string-split version #\.) "") "/INCHI-1-SRC.zip")) (sha256 (base32 - "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa")) + "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28")) (file-name (string-append name "-" version ".zip")))) (build-system gnu-build-system) (arguments @@ -222,7 +223,7 @@ only with Python 2 and NumPy < 1.9.") "/INCHI-1-DOC.zip")) (sha256 (base32 - "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6")) + "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f")) (file-name (string-append name "-" version ".zip")))))) (home-page "https://www.inchi-trust.org") (synopsis "Utility for manipulating machine-readable chemical structures") -- cgit v1.2.3 From 1f1c525ac939eefbb433450693aef08fc252e62e Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Tue, 26 Jan 2021 00:38:25 -0500 Subject: gnu: openbabel: Update to 3.1.1. * gnu/packages/chemistry.scm (openbabel): Update to 3.1.1. [source]: Update URI. [arguments]: Temporarily skip tests on i686-linux. --- gnu/packages/chemistry.scm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 69cfed454a..4b0e719959 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -522,19 +522,23 @@ usual algorithms you expect from a modern molecular dynamics implementation.") (define-public openbabel (package (name "openbabel") - (version "2.4.1") + (version "3.1.1") (source (origin (method url-fetch) - (uri (string-append "mirror://sourceforge/" name "/" name "/" - version "/" name "-" version ".tar.gz")) + (uri (string-append "https://github.com/openbabel/openbabel/" + "releases/download/openbabel-" + (string-replace-substring version "." "-") + "/openbabel-" version "-source.tar.bz2")) (sha256 (base32 - "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90")) - (patches - (search-patches "openbabel-fix-crash-on-nwchem-output.patch")))) + "0s0f4zib8vshfaywsr5bjjz55jwsg6yiz2qw4i5jm8wysn0q7v56")))) (build-system cmake-build-system) (arguments - `(#:configure-flags + `(;; FIXME: Disable tests on i686 to work around + ;; https://github.com/openbabel/openbabel/issues/2041. + #:tests? ,(or (%current-target-system) + (not (string=? "i686-linux" (%current-system)))) + #:configure-flags (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON" (string-append "-DINCHI_LIBRARY=" (assoc-ref %build-inputs "inchi") -- cgit v1.2.3