Building:Development Version
From Avogadro
Contents |
Linux
These steps are designed to allow you build Avogadro without having to install ('make install')the dependencies. For the purposes of this example we check out all entries to $HOME/svn.
Setting up the Environment
These environment variables allow us to direct Avogadro and OpenBabel to use special directories for runtime plugin loading.
Avogadro Engines
export AVOGADRO_ENGINES=$HOME/svn/avogadro/build/libavogadro/src/engines
Avogadro Tools
export AVOGADRO_TOOLS=$HOME/svn/avogadro/build/libavogadro/src/tools
Avogadro Extensions
export AVOGADRO_EXTENSIONS=$HOME/svn/avogadro/build/libavogadro/src/extensions
Openbabel Formats
export BABEL_LIBDIR=$HOME/svn/openbabel/src/formats/.libs:$HOME/svn/openbabel/src/formats/xml/.libs
Openbabel Data Files
export BABEL_DATADIR=$HOME/svn/openbabel/data
Dependencies
- Subversion
- CMake (>=2.4.8)
- Qt4 (>=4.3.4)
- Eigen
- OpenBabel
Building Openbabel
This will build the TRUNK version of OpenBabel and allow you to use OpenBabel from the build directory rather than having to install it.
cd $HOME/svn
svn co https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk openbabel
cd openbabel
./configure
make
Building Avogadro
cd $HOME/svn
svn co https://avogadro.svn.sourceforge.net/svnroot/avogadro/trunk avogadro
cd avogadro
mkdir build
cd build
cmake \
-DOPENBABEL2_INCLUDE_DIR=$HOME/svn/openbabel/include \
-DOPENBABEL2_LIBRARIES=$HOME/svn/openbabel/src/.libs/libopenbabel.so \
-DOPENBABEL2_VERSION_MET=true ..
make
Running
$HOME/svn/avogadro/build/avogadro/src/avogadro
Windows Visual Studio 2005
Dependencies
- TortoiseSVN (SVN for Windows)
- CMake (>=2.4.8)
- Qt4 (>=4.3.4)
- Eigen
- OpenBabel
Building Qt4
Follow the instructions for Qt4 with Visual Studio. Extract and build Qt4 in the c:\qt\<version> directory (eg. c:\qt\4.3.2 for version 4.3.2).
Building Eigen
- Checkout Eigen trunk
svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigento the c:\eigen directory. - Open the Visual Studio 2005 Command Prompt.
- Create the Eigen vs2005 solution:
cd c:\eigenmkdir buildcd buildcmake -G "Visual Studio 8 2005" -DCMAKE_INSTALL_PREFIX=c:\eigen ..
- Open the Eigen vs2005 solution
c:\eigen\build\eigen.sln - Build the INSTALL target explicitly.
You should now have the Eigen headers in c:\eigen\include\eigen
Building OpenBabel
- Checkout OpenBabel trunk
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunkto the c:\openbabel directory. - Open the OpenBabel vs2005 solution
c:\openbabel\windows-vc2005\openbabelOBF.sln - Build all the targets except FastSearch, OBConsole, OBCSharp, OBGUI, OBJava and OBPythonOBF (grab some coffee this can take a while).
Building Avogadro
- Checkout Avogadro trunk
https://avogadro.svn.sourceforge.net/svnroot/avogadro/trunkto the c:\avogadro directory. - Open the Visual Studio 2005 Command Prompt.
- Create the Avogadro vs2005 solution:
set PATH=%PATH%;c:\qt4\<version>\bincd c:\avogadromkdir buildcd build..\scripts\cmake-vs2005.bat
- Select the Release solution configuration.
- Open the Avogadro vs2005 solution
c:\avogadro\build\avogadro.sln - Add obconv.lib to the Additional Dependencies of the avogadro-app target (Right click->Properties->Linker->Input)
- Add obconv.lib to the Additional Dependencies of the animationextension target
- Add obfprt.lib oberror.lib to the Additional Dependencies of the autoopttool target
- Add obfprt.lib obconv.lib to the Additional Dependencies of the drawtool target
- Add obfprt.lib oberror.lib to the Additional Dependencies of the forcefieldextension target
- Add obconv.lib to the Additional Dependencies of the gamessextension target
- Select all the targets except: ALL_BUILD, avogadro-app, INSTALL, uninstall, update-translations, ZERO_CHECK.
- Disabled Embed Manifest (Right Click->Properties->Manifest Tool->Input and Output, set Embed Manifest to No, Click OK). Embed Manifest causes plugins to no properly load on older versions of Windows.
- Build the Solution
Running Avogadro
Currently this is tricky. I have not found an easy way to make this work real nice. The problem is that all the DLLs (and OpenBabel's .obf files) are all over the place and I'm not good enough at vs2005 to know how to specify these additional paths. The way I do it is by copying all the dll files to the c:\avogadro\build\avogadro\src\release directory and run avogadro.exe from there.
Building the Installer
Requires NSIS (nullsoft scriptable install system)
- Place all files (including plugins, dependencies [Qt4 | OpenBabel], etc.) in scripts\installer\dist
- Right Click
setup.nsiand choose Compile NSIS Script
This will create the AvogadroSetup.exe file.

