|
|
(11 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
| These instructions are to allow users to build Avogadro from the very latest code. Be aware that Avogadro may fail to build or work properly at any given time when built from the instructions below. | | These instructions are to allow users to build Avogadro from the very latest code. Be aware that Avogadro may fail to build or work properly at any given time when built from the instructions below. |
| | | |
− | ;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 2008 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 2008/2010 instructions that may or may not work. For various steps in the process, there may be downloadable binaries on the web. However, for completeness we build all dependencies. |
− |
| |
− | There are also [[Compiling_on_Linux_and_Mac_OS_X|instructions for Linux and Mac OS X]] available.
| |
| | | |
− | = Windows Visual Studio 2008 (Express) =
| + | * [[Compiling_on_Windows_with_MSVC_2008]] |
− |
| + | * [[Compiling_on_Windows_with_MSVC_2010]] |
− | == Dependencies ==
| |
| | | |
− | ;[http://www.cmake.org CMake] (>=2.6.0)
| + | There are also [[Compiling_on_Linux_and_Mac_OS_X|instructions for Linux and Mac OS X]] available. |
− | ;[[#Building Qt4|Qt4]] (>=4.4.0)
| |
− | ;[[#Building Eigen 2|Eigen]]
| |
− | ;[[#Building OpenBabel 2|OpenBabel]]
| |
− | ;[http://code.google.com/p/msysgit/ msysgit] (Git for Windows, optional)
| |
− | | |
− | For the optional Python console/bindings:
| |
− | ;[http://www.riverbankcomputing.co.uk/software/pyqt/download PyQt4]
| |
− | ;[http://www.riverbankcomputing.co.uk/software/sip/download SIP]
| |
− | ;[http://www.boostpro.com/products/free Boost libraries] (>=1.36.0)
| |
− | ;[http://www.boost.org/users/download/ Boost]
| |
− | | |
− | For optional OpenGL shader support:
| |
− | ;[http://glew.sourceforge.net/ GLEW]
| |
− | | |
− | === 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.4.3</code> for version 4.4.3).
| |
− | | |
− | === Building Eigen ===
| |
− | | |
− | There is no need to build Eigen since it's a template library consisting of headers. We simply extract the files to <nowiki>c:\eigen2</nowiki>. | |
− | | |
− | #Checkout Eigen trunk <code>svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2</code> to the <nowiki>c:\eigen2</nowiki> directory.
| |
− | | |
− | You should now have the Eigen headers in <code>c:\eigen2\Eigen</code>
| |
− | | |
− | === Building OpenBabel ===
| |
− | | |
− | #Checkout OpenBabel trunk <code>https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk</code> to the <nowiki>c:\openbabel</nowiki> directory.
| |
− | | |
− | ==== Running cmake ====
| |
− | ===== Using the Visual Studio 2008 Command Prompt =====
| |
− | | |
− | Since we are using cmake 2.6, the installed [http://www.boostpro.com/products/free boost libraries] will be found automatically.
| |
− | | |
− | cd c:\openbabel
| |
− | mkdir build
| |
− | cd build
| |
− | cmake -DZLIB_INCLUDE_DIR=c:\openbabel\include -DZLIB_LIBRARY=c:\openbabel\windows-vc2005\zlib1.lib
| |
− | -DLIBXML2_INCLUDE_DIR=c:\openbabel\include -DLIBXML2_LIBRARIES=c:\openbabel\windows-vc2005\libxml2.lib
| |
− | -DLIBRARY_OUPUT_PATH=c:\openbabel\output -DEXECUTABLE_OUPUT_PATH=c:\openbabel\output -G "Visual Studio 9 2008" ..
| |
− | | |
− | ===== Using the CMake graphical user interface =====
| |
− | | |
− | [[Image:Cmake.jpg|thumb|openbabel CMake 2.6 setting for windows]] | |
− | | |
− | # Open the CMake GUI: Start > All programs > CMake 2.6 > cmake-gui(beta)
| |
− | # Set the "Where is the source code" field to <code>c:/openbabel</code>
| |
− | # Set the "Where to build the binaries" field to <code>c:/openbabel/build</code>
| |
− | # Press the "Configure" button
| |
− | # A new dialog will appear where you can select the build environment: Visual Studio 9 2008
| |
− | # Set the combo box (on the right of the search field) to "Grouped View"
| |
− | # Edit the ZLIB and LIBXML2 fields so they resemble the screenshot
| |
− | | |
− | | |
− | ==== Building ====
| |
− | | |
− | # Open the <code>c:\openbabel\build\openbabel.sln</code> solution
| |
− | # Select the '''Release''' solution configuration.
| |
− | # Build the Solution (F7)
| |
− | | |
− | You should now have all files files in <code>c:\openbabel\output\Release</code>.
| |
− | | |
− | == Building Avogadro ==
| |
− | | |
− | #Download Avogadro trunk from <code>http://github.com/cryos/avogadro/zipball/master</code> and uncompress it to the <nowiki>c:\avogadro</nowiki> directory.
| |
− | # If you have installed Git, you can use that to update the code from the repository above.
| |
− | # Open the Visual Studio 2008 Command Prompt.
| |
− | # Create the Avogadro vs2008 solution:
| |
− | #: <code>set PATH=%PATH%;c:\qt4\<version>\bin</code>
| |
− | #: <code>cd c:\avogadro</code>
| |
− | #: <code>mkdir build</code>
| |
− | #: <code>cd build</code>
| |
− | #: <code>..\scripts\cmake-vs2005.bat</code>
| |
− | # Select the '''Release''' solution configuration.
| |
− | # Open the Avogadro vs2008 solution <code>c:\avogadro\build\avogadro.sln</code>
| |
− | #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 ==
| |
− | | |
− | Copy all needed files to one directory and run avogadro.exe from there.
| |
− | | |
− | # openbabel-2.dll, all the formats (*.obf) and data files
| |
− | # avogadro.dll + tools, extensions, colors & engines
| |
− | # MSVC runtime dll's
| |
− | # python25.dll
| |
− | # Qt dll's
| |
− | # PyQt4 *.pyd's
| |
− | # ...
| |
− | | |
− | == Building the Installer ==
| |
− | ''Requires [http://nsis.sourceforge.net/ NSIS] (nullsoft scriptable install system)''
| |
− | | |
− | #Place all files (including plugins, dependencies [Qt4 | OpenBabel], etc.) in scripts\installer\dist
| |
− | #Right Click <code>setup.nsi</code> and choose '''Compile NSIS Script'''
| |
− | | |
− | This will create the AvogadroSetup.exe file.
| |
− | | |
− | == Python Support **NEW** ==
| |
− | | |
− | === Building Python ===
| |
− | | |
− | * Python 2.6.1: http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tar.bz2
| |
− | ** Extract to C:\src
| |
− | ** Open c:\src\Python-2.6.1\PCbuild\pcbuild.sln
| |
− | ** Select '''Release'''
| |
− | ** Build (F7)
| |
− | ** You now have the files in the PCBuild directory
| |
− | ** Copy the exe, lib, dll & pyd files to c:\src\Python-2.6.1\libs
| |
− | ** Copy C:\src\Python-2.6.1\PC\pyconfig.h to C:\src\Python-2.6.1\Include
| |
− | | |
− | Some targets fail because they need additional libraries (encryption, sqlite3, ...). This is not a problem since we don't use these parts. Perhaps sqlite3 support might be nice though...
| |
− | | |
− | | |
− | === Building Boost.Python ===
| |
− | | |
− | * bjam precompiled: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
| |
− | ** place in a directory in your PATH
| |
− | * boost libraries (1.38): http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041
| |
− | ** Extract to C:\src
| |
− | ** Edit C:\src\boost_1_38_0\tools\build\v2\user-config.jam
| |
− | ** Add (at the end for example):
| |
− | | |
− | using python
| |
− | : 2.6
| |
− | : C:/src/Python-2.6.1/libs/python # cmd
| |
− | : C:/src/Python-2.6.1/Include # include
| |
− | : C:/src/Python-2.6.1/libs ; # libraries
| |
− | | |
− | In command promt:
| |
− | | |
− | cd C:\src\boost_1_38_0
| |
− | mkdir ..\build
| |
− | bjam --build-dir="..\build" --toolset=msvc --with-python stage
| |
− | | |
− | You now have the following files in '''$BOOST_ROOT/stage/lib''':
| |
− | | |
− | boost_python-vc90-mt.lib 185kB
| |
− | boost_python-vc90-mt-1_38.dll 210kB
| |
− | boost_python-vc90-mt-1_38.lib 185kB # same as 1
| |
− | libboost_python-vc90-mt.lib 5173kB
| |
− | libboost_python-vc90-mt-1_38.lib 5173kB # same as 4
| |
− | | |
− | === Building SIP ===
| |
− | | |
− | * http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.7.9.zip
| |
− | ** Extract to C:\src
| |
− | | |
− | In command prompt:
| |
− | | |
− | cd c:\src\sip-4.7.9
| |
− | C:\src\Python-2.6.1\libs\python.exe configure.py
| |
− | nmake
| |
− | | |
− | You now have these files:
| |
− | | |
− | 1. C:\src\sip-4.7.9\sipconfig.py
| |
− | 2. siplib/sip.h
| |
− | 3. siplib/sip.pyd
| |
− | 4. siplib/sip.pyd.manifest
| |
− | 5. sipgen/sip.exe
| |
− | 6. sipgen/sip.exe.manifest
| |
− | | |
− | * Copy files 1, 3 and 4 to C:\src\Python-2.6.1\lib\site-packages\
| |
− | * Copy file 2 to C:\src\Python-2.6.1\Include
| |
− | * Copy files 5 and 6 to C:\src\Python-2.6.1
| |
− | | |
− | === Building PyQt4 ===
| |
− | | |
− | Assumes Qt is in C:\Qt\4.4.3, change this if needed...
| |
− | | |
− | * PyQt4 4.4.4: http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-win-gpl-4.4.4.zip
| |
− | ** Extract to C:\src
| |
− | | |
− | In command prompt:
| |
− |
| |
− | cd C:\src\PyQt-win-gpl-4.4.4
| |
− | mkdir release
| |
− | copy C:\Qt\4.4.3\lib\QtCore4.dll release\QtCore4.dll
| |
− | C:\src\Python-2.6.1\libs\python.exe configure.py
| |
− | nmake
| |
− | | |
− | You now have the .pyd files and their manifests in the Qt* dirs:
| |
| | | |
− | C:\src\PyQt-win-gpl-4.4.4\Qt\Qt.pyd(.manifest)
| + | [[Category:Developer]] |
− | C:\src\PyQt-win-gpl-4.4.4\QtCore\QtCore.pyd(.manifest)
| |
− | C:\src\PyQt-win-gpl-4.4.4\QtGui\QtGui.pyd(.manifest)
| |
− | C:\src\PyQt-win-gpl-4.4.4\QtOpenGL\QtOpenGL.pyd(.manifest)
| |
− | ...
| |
These instructions are to allow users to build Avogadro from the very latest code. Be aware that Avogadro may fail to build or work properly at any given time when built from the instructions below.