-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathINSTALL
102 lines (82 loc) · 4.96 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
The installation instructions are for Linux.
The build scripts will search for dependencies in ~/local first, so
all dependencies can be installed without administrator rights.
1. Install cmake (provided as package "cmake" in every distribution)
Version 2.8.3 or higher is needed!
2. Install mpich2 (>= 1.3.2p1).
a) Use a package from your distribution (mpich2 & libmpich2-dev; sometimes also
mpich & libmpich-dev)
b) Download source code from http://www.mcs.anl.gov/research/projects/mpich2/
and perform the following steps:
- unpack to ~local/src/mpich2/ and cd to this directory
- run ./configure --enable-shared --prefix=/home/<your-login>/local --enable-mpe
- run make
- run make install
- add ~/local/bin to your path (to the front)
3. Install a recent version of Boost (>= 1.60). (tested with 1.63)
a) Use package "libboost-dev" from your Linux distribution, if recent enough and
built against mpich2 (and not openmpi).
b) Download source code from http://www.boost.org/ and perform the following
steps:
- unpack to ~/local/src/boost_1_63 and cd to this directory
- run ./bootstrap.sh
- edit project-config.jam and modify the lines below:
option.set prefix : /home/<your-login>/local ;
option.set exec-prefix : /home/<your-login>/local ;
option.set libdir : /home/<your-login>/local/lib ;
option.set includedir : /home/<your-login>/local/include ;
- edit or create tools/build/src/user-config.jam (on older Boost versions, tools/build/v2/user-config.jam)
and add the line:
using mpi ;
- edit boost/mpi/config.hpp and uncomment the line
#define BOOST_MPI_HOMOGENEOUS
- run ./b2 -j4 install (here -j4 means "use 4 cores")
4. Install the log4cxx library.
a) Use a package from your distribution (log4cxx & log4cxx-dev OR liblog4cxx10 & liblog4cxx10-dev)
b) Download source code from http://logging.apache.org/log4cxx/download.html
and perform the following steps:
- unpack to ~/local/src/apache-log4cxx-0.10.0
- run ./configure --prefix=/home/<your-login>/local
- run make (if this fails, see TROUBLESHOOTING below)
- run make install
5. Install other required libraries using a package from your distribution
- LAPACK (liblapack-dev, libf2c-dev)
- optional: GNU scientific library (libgsl0-dev)
6. Install ccache
- Use a package from your distribution (ccache)
7. Install the mpi2 library (skip the "build boost" step). You can find the mpi2 library at https://github.com/uma-pi1/mpi2.
- If the steps above have been performed, just go to the mpi2 directory, create "build" subdirectory, and run "localinstall.sh"
8. To build, Cd to <mf-root>/build, then run
- For optimized build (default; release with CPU-specific optimizations): cmake -DCMAKE_BUILD_TYPE=NativeRelease ../
- For generic release (release without CPU-specific optimizations): cmake -DCMAKE_BUILD_TYPE=Release ../
- For development (never use to measure runtime!): cmake -DCMAKE_BUILD_TYPE=Debug ../
- make (this takes a while)
After the build is successful, the project can be imported into Eclipse
(project file is in root directory).
8. (Optionally) Run doxygen in the main directory to create documentation files.
TROUBLESHOOTING
- If cmake does not find the system's MPI library, you can hint it as follows:
cmake -DMPI_INCLUDE_PATH=/usr/include/mpich2/ -DMPI_LIBRARY=/usr/lib/libmpi.so ../
- If you get relocation errors, try compiling/installing boost with:
./bjam --v2 cxxflags=-fPIC install
- mf library may not compile with gcc-4.5. This is a bug in gcc, which is already fixed in more recent versions.
One fallback is to use gcc-4.4.
* install packages gcc-4.4, g++-4.4, c++-4.4 on your system
* Either
1) Change the default compiler (recommended)
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 40
2) add the following lines to your environment (or your ~/.bashrc file)
export MPICH_CC=/usr/bin/gcc-4.4
export MPICH_CXX=/usr/bin/g++-4.4
* test by checking "mpicc --version" and "mpicxx --version"
- log4cxx doesn't compile on new gcc versions.
To fix, add "#include <string.h>" to each of the following files:
* src/main/cpp/inputstreamreader.cpp:66: error: 'memmove' was not declared in this scope
* src/main/cpp/socketoutputstream.cpp:52: error: 'memcpy' was not declared in this scope
* src/examples/cpp/console.cpp:63: error: 'strcmp' was not declared in this scope
- Boost libraries not found when using DEBUG build: Build boost with
./bjam --variant=debug --layout=versioned --threading=multi install
./bjam --variant=release --layout=versioned --threading=multi install
- If you see a std::bad_alloc with ALS, try installing libatlas.* and rebuild from scratch
(this seems to be some bug in lapack)