Difference between revisions of "Compiling on Windows"
From Avogadro - Free cross-platform molecule editor
Line 1: | Line 1: | ||
;Compiling Avogadro for Windows is a complex task and it is recommended that you download the pre-made installer found on the download page. For the adventurous, here are Windows Visual Studio 2005 instructions that may or may not work. | ;Compiling Avogadro for Windows is a complex task and it is recommended that you download the pre-made installer found on the download page. For the adventurous, here are Windows Visual Studio 2005 instructions that may or may not work. | ||
− | = Windows Visual Studio | + | = Windows Visual Studio 2008 (Express) = |
== Dependencies == | == Dependencies == | ||
;[http://tortoisesvn.tigris.org/ TortoiseSVN] (SVN for Windows) | ;[http://tortoisesvn.tigris.org/ TortoiseSVN] (SVN for Windows) | ||
− | ;[http://www.cmake.org CMake] (>=2. | + | ;[http://www.cmake.org CMake] (>=2.6.0) |
− | ;[[#Building Qt4|Qt4]] (>=4. | + | ;[[#Building Qt4|Qt4]] (>=4.4.0) |
;[[#Building Eigen 2|Eigen]] | ;[[#Building Eigen 2|Eigen]] | ||
;[[#Building OpenBabel 2|OpenBabel]] | ;[[#Building OpenBabel 2|OpenBabel]] | ||
Line 13: | Line 13: | ||
=== Building Qt4 === | === Building Qt4 === | ||
− | Follow the instructions for [http://wiki.qtcentre.org/index.php?title=Qt4_with_Visual_Studio Qt4 with Visual Studio]. Extract and build Qt4 in the <code>c:\qt\<version></code> directory (eg. <code>c:\qt\4.3 | + | Follow the instructions for [http://wiki.qtcentre.org/index.php?title=Qt4_with_Visual_Studio Qt4 with Visual Studio]. Extract and build Qt4 in the <code>c:\qt\<version></code> directory (eg. <code>c:\qt\4.4.3</code> for version 4.4.3). |
=== Building Eigen === | === Building Eigen === |
Revision as of 12:41, 25 December 2008
- Compiling Avogadro for Windows is a complex task and it is recommended that you download the pre-made installer found on the download page. For the adventurous, here are Windows Visual Studio 2005 instructions that may or may not work.
Contents
Windows Visual Studio 2008 (Express)
Dependencies
- TortoiseSVN (SVN for Windows)
- CMake (>=2.6.0)
- Qt4 (>=4.4.0)
- 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.4.3
for version 4.4.3).
Building Eigen
- Checkout Eigen trunk
svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen
to the c:\eigen directory. - Open the Visual Studio 2005 Command Prompt.
- Create the Eigen vs2005 solution:
cd c:\eigen
mkdir build
cd build
cmake -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/trunk
to 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/trunk
to the c:\avogadro directory. - Open the Visual Studio 2005 Command Prompt.
- Create the Avogadro vs2005 solution:
set PATH=%PATH%;c:\qt4\<version>\bin
cd c:\avogadro
mkdir build
cd 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.nsi
and choose Compile NSIS Script
This will create the AvogadroSetup.exe file.