Difference between revisions of "Compiling on Linux and Mac OS X"

From Avogadro - Free cross-platform molecule editor
Jump to: navigation, search
(Updated the build instructions. I think cloning the git repo is preferred.)
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 inteded to help users to build Avogadro from the latest code. Be aware that Avogadro may fail to build or work properly at any given time when built using the instructions below.  
For the adventurous, there are also [[Compiling_on_Windows|Windows Visual Studio 2008]] instructions that may or may not work.
+
For the adventurous, there are also [[Compiling_on_Windows|Windows Visual Studio 2008]] instructions.
  
Generally, users should first try the pre-made installers or packages available on the [[:Get_Avogadro|download]] page made from Avogadro releases.
+
Generally, users should first try the binary installers or packages available on the [[:Get_Avogadro|download]] page, made using a released version of Avogadro.
  
 
Developers may want to use the instructions found at [[Building:Development_Version]].
 
Developers may want to use the instructions found at [[Building:Development_Version]].
Line 12: Line 12:
 
;[http://www.cmake.org CMake] (>=2.4.5)
 
;[http://www.cmake.org CMake] (>=2.4.5)
 
;[http://trolltech.com/products/qt Qt4] (>=4.4.0)
 
;[http://trolltech.com/products/qt Qt4] (>=4.4.0)
;[[#Installing Eigen 1|Eigen]]
+
;[[#Installing Eigen 1|Eigen]] (>=2.0_beta3)
;[[#Building OpenBabel 1|OpenBabel]] (see below)
+
;[[#Building OpenBabel 1|OpenBabel]] (>=2.2.0)
  
At least Subversion, Git, CMake and Qt4 might be available through your distribution's repositories.
+
It is likely that Subversion, Git, CMake and Qt4 will be available from your distribution's repositories, or in binary form on the Mac.
  
 
== Installing Eigen ==
 
== Installing Eigen ==
Line 25: Line 25:
 
cd build
 
cd build
 
cmake ..
 
cmake ..
make install # must be run as root or with sudo
+
sudo make install
 
</pre></code>
 
</pre></code>
  
 
== Building Open Babel ==
 
== Building Open Babel ==
Avogadro makes heavy use of code and features from the [http://openbabel.org Open Babel] chemistry toolbox. To ensure you have the latest Open Babel code you should build it from the code repository:
+
Avogadro makes heavy use of code and features from the [http://openbabel.org Open Babel] chemistry toolbox. To ensure you have the latest Open Babel code you should build it from the code repository. It is sufficient to use OpenBabel 2.2.0 or more recent:
  
 
<code><pre>
 
<code><pre>
Line 40: Line 40:
  
 
== Building Avogadro ==
 
== Building Avogadro ==
 +
 +
Avogadro's version control system is now Git, with hosting provided by GitHub. If you would rather not install Git it is possible to download a tar or zip file containing the latest sources from [http://github.com/cryos/avogadro/ here] by clicking on the download link. Generally you will want to clone the git repository,
  
 
<code><pre>
 
<code><pre>
wget http://github.com/cryos/avogadro/tarball/master/avogadro-latest.tar.gz -O- | tar -xvvzf -
+
git clone git://github.com/cryos/avogadro.git
cd cryos-avogadro-* # This doesn't look nice, but since the directory has the git-revision appended, the directory has always a different name
+
cd avogadro
 
mkdir build
 
mkdir build
 
cd build
 
cd build
 
cmake ..
 
cmake ..
make
+
make -j3
make install # must be run as root or with sudo
+
sudo make install
 
</pre></code>
 
</pre></code>
  
Line 54: Line 56:
  
 
<code><pre>avogadro</pre></code>
 
<code><pre>avogadro</pre></code>
On Mac OS X Avogadro should be in your Applications folder.
+
On Mac OS X Avogadro will be in your Applications folder.
  
 
[[Category:User]]
 
[[Category:User]]

Revision as of 23:27, 25 December 2008

These instructions are inteded to help users to build Avogadro from the latest code. Be aware that Avogadro may fail to build or work properly at any given time when built using the instructions below. For the adventurous, there are also Windows Visual Studio 2008 instructions.

Generally, users should first try the binary installers or packages available on the download page, made using a released version of Avogadro.

Developers may want to use the instructions found at Building:Development_Version.


Dependencies

Subversion
CMake (>=2.4.5)
Qt4 (>=4.4.0)
Eigen (>=2.0_beta3)
OpenBabel (>=2.2.0)

It is likely that Subversion, Git, CMake and Qt4 will be available from your distribution's repositories, or in binary form on the Mac.

Installing Eigen

svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2
cd eigen2
mkdir build
cd build
cmake ..
sudo make install

Building Open Babel

Avogadro makes heavy use of code and features from the Open Babel chemistry toolbox. To ensure you have the latest Open Babel code you should build it from the code repository. It is sufficient to use OpenBabel 2.2.0 or more recent:

svn co https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk openbabel
cd openbabel
./configure 
make
make install # must be run as root or with sudo

Building Avogadro

Avogadro's version control system is now Git, with hosting provided by GitHub. If you would rather not install Git it is possible to download a tar or zip file containing the latest sources from here by clicking on the download link. Generally you will want to clone the git repository,

git clone git://github.com/cryos/avogadro.git
cd avogadro
mkdir build
cd build
cmake ..
make -j3
sudo make install

Running

avogadro

On Mac OS X Avogadro will be in your Applications folder.