IMP  2.1.1
The Integrative Modeling Platform
installation.md
1 # Installation #
2 
3 # Building and installing basics # {#installation}
4 
5 [TOC]
6 
7 IMP is available in a variety of different ways. If you are just planning on using
8 existing IMP code and run on a standard platform, you may be able to install
9 a pre-built binary. See the [download](http://integrativemodeling.org/download.html) page.
10 
11 If you are planning on contributing to IMP, you should download and build the source.
12 See the next section for more information.
13 
14 
15 
16 Building IMP from source is straightforward if the [prerequisites](#prereqs)
17 are already installed.
18 
19  git clone git://github.com/salilab/imp.git
20  cd imp
21  ./setup_git.py
22  mkdir ../imp_release
23  cd ../imp_release
24  cmake ../imp -DCMAKE_BUILD_TYPE=Release
25  make -j 8
26 
27 See [Building IMP with CMake](https://github.com/salilab/imp/wiki/Cmake)
28 for more information.
29 
30 
31 # Prerequisites # {#installation_prereqs}
32 In order to obtain and compile IMP, you will need:
33 
34 - cmake (2.8 or later)
35 - Boost (1.40 or later)
36 - HDF5 (1.8 or later)
37 - Developers will also need a git client to access the repository
38 
39 If you wish to build the Python interfaces, you will also need:
40 
41 - Python (2.4 or later)
42 - SWIG (1.3.40 or later)
43 
44 ## Getting prerequisites on a Mac ## {#installation_prereqs_mac}
45 
46 Mac users must first install Xcode (previously known as Developer Tools)
47 which is not installed by default with OS X, but is available from the App store
48 (or from the Mac OS install DVD for old versions of Mac OS). They will also
49 need the Xcode command line tools (install by going to Xcode Preferences, then
50 Downloads, then Components, and select "Command Line Tools").
51 
52 Then Mac users should use one of the available collections of Unix tools,
53 either
54 - [Homebrew](http://mxcl.github.com/homebrew/) (_recommended_) Once you installed `homebrew`
55  do
56 
57  `brew tap homebrew/science`
58 
59  `brew install boost gmp google-perftools cgal graphviz gsl cmake doxygen hdf5 swig eigen fftw mpfr`
60 
61  to install everything IMP finds useful (or that you will want for installing various useful python libs that IMP finds useful). On older Macs, you may also need to `brew install git` if you want to use git (newer Macs include git).
62 - [Macports](http://www.macports.org/) If you use MacPorts, you must add `/opt/local/bin` to your path (either by modifying your shell's
63  config file or by making an `environment.plist` file) and then do
64 
65  `sudo port install boost cmake swig-python`
66 
67  to install the needed libraries and tools. When installing HDF5 with MacPorts, be sure to install `hdf5-18`
68  (version 1.8), rather than the older `hdf5` (version 1.6.9).
69 - or [Fink](http://www.finkproject.org/)
70 
71 ### Mac OS X 10.5 and 10.6
72 These versions of mac os include a 'swig' binary, but it is too old to use
73 with IMP. You need to make sure that the newer version of `swig` is found first
74 in your `PATH`.
75 
76 
77 ## Getting prerequisites on Windows ## {#installation_prereqs_windows}
78 
79 We recommend Linux or Mac for developing with IMP, as obtaining the
80 prerequisites on Windows is much more involved. However, we do test IMP on
81 Windows, built with the Microsoft Visual Studio compilers (we use Visual Studio
82 Express 2010 SP1). One complication is that different packages are compiled
83 with different versions of Visual Studio, and mixing the different runtimes
84 (msvc*.dll) can cause odd behavior; therefore, we recommend building most
85 of the dependencies from source code using the same version of Visual Studio
86 that you're going to use to build IMP. The basic procedure is as follows:
87 
88  - Install Microsoft Visual Studio Express (it is free, but registration with
89  Microsoft is required).
90  - Get and install [cmake](http://www.cmake.org).
91  - Get [Python 2](http://www.python.org) (not Python 3)
92  (make sure you get the
93  32-bit version if you're going to build IMP for 32-bit Windows).
94  - Download the [Boost source code](http://www.boost.org)
95  (we extracted it into `C:\Program Files\boost_1_53_0`), then
96  - Open a Visual Studio Command Prompt, and cd into the directory where
97  Boost was extracted
98  - Run bootstrap.bat
99  - Run `bjam link=shared runtime-link=shared`
100  - Get and install [SWIG for Windows](http://www.swig.org)
101  - Get and install the
102  [zlib package](http://gnuwin32.sourceforge.net/packages/zlib.htm)
103  (complete package without sources).
104  - We found that the zconf.h header included with zlib erroneously includes
105  unistd.h, which doesn't exist on Windows, so we commented out that line.
106  - Get the [HDF5 source code](http://www.hdfgroup.org)
107  - Edit the H5pubconf.h file in the `windows\src` subdirectory to
108  disable szip (or first install szip if you want to include szip support).
109  Copy this file into the top-level src directory.
110  - Open the h5libsettings project (in `windows\misc\typegen\h5libsettings`)
111  in Visual Studio, and build it in Release configuration. (Note that if
112  you don't have the x64 SDK installed, you'll first need to edit the
113  project file in a text editor and remove any mention of the x64 platform,
114  since otherwise the upgrade of this solution to 2010 format will fail.)
115  - Build the 'h5tinit' project (in `windows\misc\typegen\h5tinit`) in
116  Release configuration.
117  - Build the 'hdf5dll' project (in `windows\proj\hdf5dll`) in
118  Release configuration.
119  - In order for Visual Studio to find zlib, we first opened the project
120  settings, and under C/C++, Additional Include Directories, added
121  `C:\Program Files\GnuWin32\include`, and under Linker, Input,
122  Additional Dependencies, added
123  `C:\Program Files\GnuWin32\lib\zlib.lib`.
124  - Copy proj\hdf5dll\Release\hdf5dll.lib to hdf5.lib to help cmake
125  find it.
126  - (Optional) [Build CGAL from source code](http://www.cgal.org/windows_installation.html).
127  - (Optional) [Get and install Eigen](http://eigen.tuxfamily.org).
128  - (Optional) Download the
129  [FFTW DLLs](http://www.fftw.org/install/windows.html) and follow the
130  instructions at that website to make .lib import libraries needed for
131  Visual Studio.
132  - Copy `libfftw3-3.lib` to `fftw3.lib` to help cmake find it
133  - (Optional) Get the
134  [GSL source code](http://gnuwin32.sourceforge.net/packages/gsl.htm)
135  and build it:
136  - Open the libgsl project file in the `src\gsl\1.8\gsl-1.8\VC8`
137  subdirectory
138  - Build in Release-DLL configuration
139  - Copy the generated `libgsl.dll` and `libgslcblas.dll` to a suitable
140  location (we used `C:\Program Files\gsl-1.8\lib`)
141  - Copy the corresponding .lib files, libgsl_dll.lib and libgslcblas_dll.lib
142  (we recommend removing the _dll suffix and the lib prefix when you do
143  this so that cmake has an easier time finding them, i.e. call them
144  gsl.lib and gslcblas.lib).
145  - (Optional) Get [numpy and scipy](http://www.scipy.org) to match your
146  Python version.
147  - (Optional) Get and install
148  [libTAU](http://integrativemodeling.org/libTAU.html)
149  - Copy `libTAU.lib` to `TAU.lib` to help cmake find it.
150  - (Optional) Get the [OpenCV source code](http://opencv.willowgarage.com/wiki/InstallGuide)
151  and build it by following the instructions at that website.
152  - Copy each `opencv_*.lib` to a similar file without the version extension
153  (e.g. copy `opencv_ml244.lib` to `opencv_ml.lib`) to help cmake find it
154  - Set PATH, INCLUDE, and/or LIB environment variables so that the compiler
155  can find all of the dependencies. (We wrote a little batch file.)
156  - Set up IMP by running something similar to
157 
158  `cmake <imp_source_directory> -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/DBOOST_ALL_DYN_LINK /EHsc /D_HDF5USEDLL_ /DWIN32 /DGSL_DLL" -G "NMake Makefiles"`
159 
160  - Then use simply 'nmake' (instead of 'make', as on Linux or Mac) to
161  build IMP. (cmake can also generate Visual Studio project files, but
162  we recommend nmake.)
163  - To use IMP or run tests, first run the setup_environment.bat file to set
164  up the environment so all the programs and Python modules can be found.
165  (This batch file needs to be run only once, not for each test.)
166 
167 ## Getting prerequisites on Linux
168 All of the prerequisites should be available as pre-built packages for
169 your Linux distribution of choice.
170 
171 # Optional prerequisites # {#installation_preqs_optional}
172 
173 IMP can make use of a variety of external tools to provide more or
174 better functionality.
175 
176 - [Doxygen](http://www.doxygen.org/) and [Graphviz](http://www.graphviz.org/): Required for building documentation. They are available as
177 part of most Unix tool sets (HomeBrew, all Linux distributions etc.).
178 - [Modeller](\ref modeller)
179 - [CGAL](\ref CGAL)
180 - [Google perf tools](\ref perf)
181 - [ANN](\ref ANN)
182 - [GSL](\ref GSL)
183 - [OpenCV](\ref OpenCV)
184 - [MPI](\ref impmpi)
185 
186 # Where to go next # {#installation_next}
187 
188 You are now ready to use IMP within Python and C++.
189 
190 Everyone should read the [introduction](\ref introduction) and developers should
191 then move on to the [Developer Guide](\ref devguide).