2 Highly Optimized Object-oriented Many-particle Dynamics -- Blue Edition
3 (HOOMD-blue) Open Source Software License Copyright 2008-2011 Ames Laboratory
4 Iowa State University and The Regents of the University of Michigan All rights
7 HOOMD-blue may contain modifications ("Contributions") provided, and to which
8 copyright is held, by various Contributors who have granted The Regents of the
9 University of Michigan the right to modify and/or distribute such Contributions.
11 You may redistribute, use, and create derivate works of HOOMD-blue, in source
12 and binary forms, provided you abide by the following conditions:
14 * Redistributions of source code must retain the above copyright notice, this
15 list of conditions, and the following disclaimer both in the code and
16 prominently in any materials provided with the distribution.
18 * Redistributions in binary form must reproduce the above copyright notice, this
19 list of conditions, and the following disclaimer in the documentation and/or
20 other materials provided with the distribution.
22 * All publications and presentations based on HOOMD-blue, including any reports
23 or published results obtained, in whole or in part, with HOOMD-blue, will
24 acknowledge its use according to the terms posted at the time of submission on:
25 http://codeblue.umich.edu/hoomd-blue/citations.html
27 * Any electronic documents citing HOOMD-Blue will link to the HOOMD-Blue website:
28 http://codeblue.umich.edu/hoomd-blue/
30 * Apart from the above required attributions, neither the name of the copyright
31 holder nor the names of HOOMD-blue's contributors may be used to endorse or
32 promote products derived from this software without specific prior written
37 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' AND
38 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR ANY
40 WARRANTIES THAT THIS SOFTWARE IS FREE OF INFRINGEMENT ARE DISCLAIMED.
42 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
43 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
44 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
47 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
48 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 \page page_compile_guide_linux_generic Compiling HOOMD-blue on Linux (generic)
56 - \ref sec_build_linux_generic_prereq
57 - \ref sec_build_linux_generic_compile
60 \section sec_build_linux_generic_prereq Software Prerequisites
62 This page assumes that you have a standard terminal window open. Commands to run will
63 be indicated as below:
68 " $ " indicates a shell prompt. As demonstrated above, if you type "echo hello", then you should see the same
69 output obtained above on the next line: "hello"
71 The process for installing software/libraries differs from linux distribution to distribution.
72 In Gentoo (http://www.gentoo.org/)
76 would install python. Look at your linux distribution's documentation to find how to install
77 packages on your system (i.e. yum, apt-get, up2date, or another). You may need to "su -" or use sudo to
78 become root before installing.
80 \section software_req_install_linux_python Python
82 First, check if python is already installed
87 Make sure that the version is 2.3 or greater. If you get
89 bash: python: command not found
91 or have a version older than 2.3, you will need to upgrade/install python.
92 Note that you will also
93 need the python development libraries which some distributions might separate into into
94 python-devel or some such. The existence of the python development package can be tested
95 by checking the output of
97 $ ls /usr/include/python2.X/Python.h
98 /usr/include/python2.X/Python.h
100 where X is replaced with the major version of python that you have (i.e. For python 2.4.4 above,
101 X would be 4). If this returned
103 ls: cannot access /usr/include/python2.X/Python.h: No such file or directory
105 then you do not have the python development libraries installed.
109 \section software_req_install_linux_boost Boost
111 First, check if boost is already installed
113 $ grep BOOST_LIB_VERSION /usr/include/boost/version.hpp
114 // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
115 #define BOOST_LIB_VERSION "1_34_1"
117 Make sure that the version is 1_32_0 or newer. If you get
119 grep: /usr/include/boost/version.hpp: No such file or directory
121 then boost is not installed. You can upgrade/install boost with your distribution's package
122 manager. You may need to install the boost-static package to get the static libraries needed by
125 If your distribution doesn't have a new enough version of boost, you can build it by hand. Building boost is a time consuming process, but not complicated if you follow these instructions.
127 Start by downloading \b boost_1_41_0.tar.bz2 from http://www.boost.org/ . Extract the tarball and
128 configure boost for building with the following commands.
130 $ tar -xjf boost_1_41_0.tar.bz2
132 $ ./bootstrap.sh --prefix=/home/myuser/software
133 -n Building Boost.Jam with toolset darwin...
134 tools/jam/src/bin.macosxx86/bjam
135 -n Detecting Python version...
137 -n Detecting Python root...
138 /System/Library/Frameworks/Python.framework/Versions/2.5
144 $ ./bjam variant=release threading=multi link=shared,static
146 and wait a \e long time for everything to compile. At the end, you should see a message saying
148 ...updated 765 targets...
151 Now, you are ready to install the library.
153 $ ./bjam variant=release threading=multi link=shared,static install
155 After a considerably shorter wait, you should see
157 ...updated 7684 targets...
159 again. Boost is now installed.
161 You can delete the boost_1_41_0 directory now if you wish. It might be worth
162 saving for a little while until you have compiled HOOMD-blue and know everything
163 is working so that you won't need to go through all the setup steps again.
166 Before running ccmake or cmake-gui, set the following environment variables to the location where you installed boost:
168 $ export BOOST_ROOT=/home/myuser/software
169 $ ccmake ../src # or run cmake-gui
170 ... continue with build instructions ...
173 \section software_req_install_linux_compiler Compiler
175 These instructions test for the installation of gcc. Other C++ compilers can be used
176 if you wish, though compilations with CUDA enabled are only supported with gcc.
178 Test if g++ is installed.
181 $ g++ (GCC) 4.1.2 (Gentoo 4.1.2)
183 Any version should do. If you get
185 bash: g++: command not found
187 then you will need to install gcc using your distributions package management system.
190 \section software_req_install_linux_cmake CMake
192 It is not very likely that your linux distribution includes CMake by default,
196 cmake version 2.6-patch 1
198 Make sure the version is 2.6 or later. If you have an old version or get
200 bash: cmake: command not found
202 then you will need to upgrade/install CMake. Try your distributions package
203 manager first. I.e. in Gentoo
208 If your distribution does not have a cmake package,
209 then you can install it into your home directory by hand. First, download
210 cmake-2.6.1-Linux-i386.tar.gz from the Downloads section at http://www.cmake.org.
211 Unpack the tarball to any location you prefer: this example assumes you are installing it to the
215 $ mv cmake-2.6.1-Linux-i386.tar.gz ~/software/
217 $ tar -xvzf cmake-2.6.1-Linux-i386.tar.gz
219 Then you need to put the bin directory for cmake into your path. If you use bash for a shell you can do
220 this by editing ~/.bashrc. Look for a line with PATH=... and add the cmake directory to the end separated
221 by a colon. If you can't find the line, create it like so.
223 PATH=$PATH:$HOME/software/cmake-2.6.1-Linux-i386/bin
226 Restart your bash shell (or open a new one) and try the version check above to test your installation.
228 \section software_req_install_linux_cuda CUDA
230 Even if you do not have the needed graphics hardware to run, you can still install the CUDA toolkit and
231 run executables in emulation mode. The emulation is slow, but will allow you to develop and test
232 any changes you make that affect any of the *GPU classes.
234 CUDA is quite new and it is not likely that there is a package available through your linux distribution.
235 Gentoo is the only distribution currently offering a package:
237 $ emerge nvidia-cuda-toolkit
239 will install the latest version of the CUDA toolkit and set all environment variables for you.
241 If your distribution doesn't come with a package, go to http://developer.nvidia.com/object/cuda.html
242 and download the latest CUDA toolkit for you architecture and linux distribution. If your distribution isn't listed,
243 pick one that looks close, it will likely work. To install, simply go to the directory where you downloaded
246 $ bash NVIDIA_CUDA_Toolkit_2.0_rhel5_x86_64.run
248 Note, this example lists a specific file: change the command to match the file that you downloaded. The
249 file is a self-unpacking and installing script. Just accept the default location if you have root access
250 to install, or install to ~/CUDA or anywhere else you please. Open up ~/.bashrc in your
251 favorite text editor and add the following line:
253 export LD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
254 export PATH=$PATH:/usr/local/cuda/bin
256 Change the paths on these lines if you did not install to the default location.
258 If you have a CUDA capable graphics card, you will also need the proper graphics driver version. See
259 the CUDA webpage linked to above for more information.
261 If you wish, you can download the CUDA SDK from the same website and compile the example files to
262 test your CUDA installation. The CUDA SDK is not required to compile or run HOOMD-blue, however.
264 \section software_req_install_linux_git Git
266 Git is used for version control. You need to install it if you are going to
267 work on active development of HOOMD-blue, or if you just want to download and compile the latest and greatest
270 First, see if you already have git installed.
277 -bash: git: command not found
279 then you will need to install it with your distrubition's package manager.
281 \section sec_build_linux_generic_compile Compile hoomd
283 Now that all of the prerequisite software is installed, you are ready to compile hoomd.
285 <b>Step 1: Get a copy of the source code</b>
286 There are two ways to get the source code for HOOMD-blue. You can download it
287 (http://codeblue.umich.edu/hoomd-blue/download.html) or you can clone the git repository:
291 $ git clone https://codeblue.umich.edu/git/hoomd-blue code
293 By default, the \em master branch will be checked out. This branch includes new features tested and
294 validated for the next feature release. Using the command <code>git checkout</code> \em branchname
295 you can access bugfixes applied to the previous tagged release (\em maint) or experimental features
296 still under development (\em next).
298 To access a tagged release, check out the tag (for example 0.11.0):
300 $ git checkout v0.11.0
303 You can verify that the tagged release is exactly as it appeared to the developers when it was created if you
306 $ git cat-file blob 175bf6edfc8ac23c067df1d9bd7b5dd41982be3c | gpg --import
310 <b>Step 2: Compile and install hoomd with makefiles</b>
315 $ cmake ../code -DCMAKE_INSTALL_PREFIX=~/hoomd-install
318 The -j4 option to make allows it to compile many files in parallel. Set the number to the number of CPU cores in your
327 <b>Step 3: Setup your PATH</b>
329 Open \c ~/.bash_profile and add the following line to the end
331 export PATH=$PATH:${HOME}/hoomd-install/bin
333 assuming that you set CMAKE_INSTALL_PREFIX to ~/hoomd-install above. If you prefer to install hoomd to a different
334 location, simply set CMAKE_INSTALL_PREFIX to the desired directory in the cmake command in step 2.
336 Either open a new terminal or
338 source ~/.bash_profile
340 for the path setting to take effect.