收到以下错误后,如何从源代码安装 Avogadro?

收到以下错误后,如何从源代码安装 Avogadro?

cmake source-directory当我在另一个目录进行编译时,命令输出以下输出。

-- The build type is Release
-- Found lupdate: /usr/bin/lupdate-qt4
-- Found lrelease: /usr/bin/lrelease-qt4
CMake Warning at CMakeLists.txt:230 (message):
   Qt4 Linguist not found, please install it if you want Avogadro translations


-- checking for module 'openbabel-2.0>=2.3.0'
--   found openbabel-2.0, version 2.3.2
-- Found OpenBabel 2.3 or later: openbabel
-- Found OpenBabel2 executable: /usr/local/bin/babel
-- Found Git revision is: 
-- Building released version.
-- Searching for python dependencies...
-- [1/5] Boost Python
-- Could NOT find Boost
-- Boost Python NOT found - Python support disabled.
CMake Warning at CMakeLists.txt:268 (message):
  Not all python dependencies are found - Python support diabled


-- Threaded OpenGL rendering not enabled
-- RPath support enabled for installed binaries and libraries
-- Found Qt4: /usr/bin/qmake (found suitable version "4.8.3", required is "4.6") 
-- Linking in static plugins: bsdyengine;navigatetool;elementcolor
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- docbook tools not found, doc targets disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/brentonhorne/build
brentonhorne@brentonhorne-Vostro-3500:~/build$ make
[  0%] Generating moc_elementcolor.cxx
Scanning dependencies of target elementcolor
[  0%] Building CXX object libavogadro/src/colors/CMakeFiles/elementcolor.dir/elementcolor.cpp.o
[  0%] Building CXX object libavogadro/src/colors/CMakeFiles/elementcolor.dir/moc_elementcolor.cxx.o
Linking CXX static library elementcolor.a
[  0%] Built target elementcolor
[  0%] Generating ui_bsdysettingswidget.h
[  0%] Generating moc_bsdyengine.cxx
Scanning dependencies of target bsdyengine
[  0%] Building CXX object libavogadro/src/engines/CMakeFiles/bsdyengine.dir/bsdyengine.cpp.o
In file included from /home/brentonhorne/avogadro-1.1.0/libavogadro/src/engines/bsdyengine.cpp:27:0:
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:103:31: error: ‘Transform3d’ in namespace ‘Eigen’ does not name a type
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:103:51: warning: ISO C++ forbids declaration of ‘matrix’ with no type [-fpermissive]
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:107:13: error: ‘Transform3d’ in namespace ‘Eigen’ does not name a type
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:111:7: error: ‘Transform3d’ in namespace ‘Eigen’ does not name a type
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h: In member function ‘Eigen::Vector3d Avogadro::Camera::V4toV3DivW(const Vector4d&)’:
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:343:19: error: ‘const Vector4d’ has no member named ‘start’
/home/brentonhorne/build/libavogadro/include/avogadro/camera.h:343:28: error: expected primary-expression before ‘)’ token
make[2]: *** [libavogadro/src/engines/CMakeFiles/bsdyengine.dir/bsdyengine.cpp.o] Error 1
make[1]: *** [libavogadro/src/engines/CMakeFiles/bsdyengine.dir/all] Error 2
make: *** [all] Error 2

我已通过 cmake 成功安装了必备软件 openbabel 和 eigen,并通过 APT 成功安装了 Qt4 和其他必备软件。随附的 INSTALL 文件的内容如下:

Requirements
============
 -- CMake 2.6.0 or later (2.8.0 recommended)
 -- Qt 4.5.0 or later (4.5.3 recommended)
 -- OpenBabel 2.2.2 or later (development version from 
  http://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk is recommended)
 -- Eigen 2.0.3 or later (2.0.9 recommended)


Basic Installation
==================
These instructions give a very basic overview of how to configure, compile and
install Avogadro on most systems.  If you are using unique install locations
and/or libraries are not automatically detected please consult the 'Advanced'
section.

1. Create a 'build' directory in the package source directory.

   mkdir build
   cd build

2. Configure the build system

   cmake ../

3. Compile

   make -j2

4. Install

   sudo make install


Advanced
========
The build system (CMake) provides mechanisms for specifying non-standard
installation locations.

   -DCMAKE_INSTALL_PREFIX : specify the installation prefix
                            (default /usr/local)

   -DLIB_INSTALL_DIR : specify the install location for libraries
                       (default ${CMAKE_INSTALL_PREFIX}/lib)

   -DOPENBABEL2_LIBRARIES : specify the OpenBabel2 libraries

   -DOPENBABEL2_INCLUDE_DIR : specify the OpenBabel2 include directory

   -DEIGEN2_INCLUDE_DIR : specify the Eigen include directory

   -DENABLE_PYTHON : specify whether to build Boost.Python interpreter
                    (default = TRUE)

   -DENABLE_UPDATE_CHECKER : Enable checking for new Avogadro versions over the
                             network - Linux distributions may want to disable.

For more information please consult the CMake documentation.

Avogadro uses a few environment variables to find things at runtime. If Avogadro
is installed to the location specified at compile time none of these variables
need to be set.

AVOGADRO_TRANSLATIONS - the location of the translation files.

如果需要这个详细信息,我正在运行 12.10。

答案1

从评论来看,您似乎已经安装了 Eigen3 并且 Avogadro 需要 Eigen2。

首先卸载 Eigen 3:

sudo rm -rf /usr/local/include/eigen3/
sudo rm /usr/local/share/pkgconfig/eigen3.pc

接下来,下载并解压特征2. 完成后,安装它:

mkdir /home/brentonhorne/build_eigen2
cd /home/brentonhorne/build_eigen2
cmake /home/brentonhorne/eigen-eigen-b23437e61a07
make
sudo make install

现在您必须删除 Avogadro 的 CMakeCache.txt,因为它将缓存 Eigen3 的路径:

cd /home/brentonhorne/build
rm CMakeCache.txt

最后,重新运行 CMake 并执行:

cmake /home/brentonhorne/avogadro-1.1.0
make
sudo make install

相关内容