How do I install Avogadro from source after receiving the error below?

7,227

From the comments, it appears that you've installed Eigen3 and Avogadro requires Eigen2.

First uninstall Eigen 3:

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

Next, download and extract Eigen2. Once that's done, install it:

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

Now you'll have to delete the CMakeCache.txt for Avogadro, since it will have the path to Eigen3 cached:

cd /home/brentonhorne/build
rm CMakeCache.txt

Finally, re-run CMake and make:

cmake /home/brentonhorne/avogadro-1.1.0
make
sudo make install
Share:
7,227

Related videos on Youtube

Josh Pinto
Author by

Josh Pinto

Updated on September 18, 2022

Comments

  • Josh Pinto
    Josh Pinto over 1 year

    The following output comes out of the command cmake source-directory while I was in another directory for the compiling.

    -- 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
    

    I had installed the prerequisites openbabel and eigen successfully via cmake and Qt4 & other prerequisites via APT. The accompanying INSTALL file's contents are:

    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.
    

    I am running 12.10 if this detail is required.

    • Fraser
      Fraser over 11 years
      Did you install Eigen, or just build it?
    • Josh Pinto
      Josh Pinto over 11 years
      I just followed your instructions
    • Fraser
      Fraser over 11 years
      Again, without having tried it, the instructions indicate you can pass the path to the Eigen include directory. In your build directory, try running cmake . -DEIGEN2_INCLUDE_DIR=<path to eigen includes> then run make again.
    • Josh Pinto
      Josh Pinto over 11 years
      path to eigen includes is the actual place where the eigen source files are or where it's built?
    • Fraser
      Fraser over 11 years
      Sorry - I think I've maybe given you a bum steer. The error isn't indicating that Eigen hasn't been found, more that there's specifically a problem with Eigen::Transform3d. From a quick google search, this seems to be related to upgrading from Eigen2 to Eigen3. Not sure where you go from here I'm afraid. You've definitely downloaded and installed Eigen2 I assume?
    • Josh Pinto
      Josh Pinto over 11 years
      Maybe not, it's eigen 3.1.2 and I assume eigen2 would refer to eigen 2.x.x releases. Now that you know this could you write an answer where ya tell me how to remove eigen3 and replace it with eigen2? Then installing avogadro from there should be easy as pi.