forked from pghysels/STRUMPACK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
171 lines (130 loc) · 6 KB
/
INSTALL.txt
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
Build Instructions
==================
See doc/manual.pdf for more detailed instructions.
Or see example_build.sh for examples on how to call CMake.
STRUMPACK uses the CMake build system. To build use the
following steps:
> tar -xvzf strumpack-x.y.z.tar.gz
> cd strumpack-x.y.z
> mkdir build
> cd build
> #see below or in the manual for extra options for CMake
> export METISDIR=/path/to/metis
> cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/path/to/install \
-DCMAKE_CXX_COMPILER=<C++ (MPI) compiler> \ # optional, should be detected
-DCMAKE_C_COMPILER=<C (MPI) compiler> \
-DCMAKE_Fortran_COMPILER=<Fortran77 (MPI) compiler> \
-DSCALAPACK_LIBRARIES="/path/to/scalapack/libscalapack.a;/path/to/blacs/libblacs.a" \
-DMETIS_INCLUDES=/path/to/metis/include \
-DMETIS_LIBRARIES=/path/to/metis/libmetis.a
> make
> make install
> make test # optional
This will build STRUMPACK in a folder separate from the source
directory, which is the recommended way of building. This also
generates an example Makefile in the folder build/examples.
There are a number of dependencies which must be met in order for the
build to succeed. These are:
- C++11, C and Fortran77 compilers.
- An MPI library.
- BLAS, LAPACK, ScaLAPACK, BLACS. (BLACS usually comes with ScaLAPACK).
- Metis.
- getopt_long.
Optional dependencies:
- OpenMP >= 4.5 support in the C++ compiler.
Disable by adding -DSTRUMPACK_USE_OPENMP=OFF
- ParMetis.
- Scotch and PT-Scotch.
The (C++/C/Fortran) compiler can be specified as follows:
> cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpif90
BLAS/LAPACK/ScaLAPACK
=====================
CMake will try to find BLAS/LAPACK/ScaLAPACK libraries
automatically. CMake will look in the standard locations and in
$SCALAPACKDIR and $BLACSDIR. You can set these on the command line via
(in bash):
> export SCALAPACKDIR=/path/to/scalapack/
> export BLACSDIR=/path/to/blacs
If BLACS/SCALAPACK are not installed in a standard location, you can
also specify the libraries directly via -DBLAS_LIBRARIES=".."
-DLAPACK_LIBRARIES=".." -DSCALAPACK_LIBRARIES=".." or directly via the
linker flags as follows:
> cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib64/mpich/lib/ -lscalapack -lmpiblacs"
In order to get good performance, one should install an optimized or
vendor supplied BLAS implementation. Examples are Intel MKL, Cray
LibSci, AMD ACML, OpenBLAS or ATLAS.
On Cary systems, the compiler wrappers usually take care of linking
BLAS/LAPACK and ScaLAPACK. In that case, just set
-DBLAS_LIBRARIES="" \
-DLAPACK_LIBRARIES="" \
-DSCALAPACK_LIBRARIES="" \
in order to avoid CMake from looking for the libraries.
When using Intel MKL we recommend using the the link advisor:
https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
Always ask for the 32-bit integer interface layer, check ScaLAPACK and
BLACS.
For instance when the Intel MKL link line advisor returns the
following:
${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -lgomp -lpthread -lm -ldl
Set this:
-DBLAS_LIBRARIES="" \
-DLAPACK_LIBRARIES="" \
-DSCALAPACK_LIBRARIES="${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a;-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group;-lgomp;-lpthread;-lm;-ldl"
i.e., separate the arguments with a ';', where everything between
-Wl,--start-group and -Wl,--end-group is a single argument.
METIS
=====
For Metis, the following environment variable can be set:
> export METISDIR=/path/to/metis
CMake will then look in $METISDIR/include for metis.h. Likewise, it
will look in $METISDIR/lib for libmetis. Alternatively, one can
specify the paths directly when calling CMake as follows:
> cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DMETIS_INCLUDES=/usr/local/metis/include \
-DMETIS_LIBRARIES=/usr/local/metis/lib/libmetis.a
ParMETIS and (PT)Scotch (optional)
==================================
ParMETIS and (PT)Scotch are optional dependencies. ParMETIS can be
enable by adding the following option to the CMake command:
-DSTRUMPACK_USE_PARMETIS=ON
And similarly for (PT-)Scotch:
-DSTRUMPACK_USE_SCOTCH=ON
For ParMETIS and PT-Scotch, the following environment variables can be
set:
> export PARMETISDIR=/path/to/parmetis
> export SCOTCHDIR=/path/to/scotch
CMake will then look in $PARMETISDIR/include for parmetis.h and in
$SCOTCHDIR/include for scotch.h and ptscotch.h. Likewise, it will look
in $PARMETISDIR/lib and $SCOTCHDIR/lib for libparmetis, libscotch,
libscotcherr, libptscotch, libptscotcherr.
Or, one can set -DPARMETIS_INCLUDES, -DPARMETIS_LIBRARIES,
-DSCOTCH_INCLUDES and -DSCOTCH_LIBRARIES":
-DPARMETIS_INCLUDES=/path/to/parmetis/include \
-DPARMETIS_LIBRARIES=/path/to/parmetis/libparmetis.a
-DSCOTCH_INCLUDES=/path/to/scotch/include \
-DSCOTCH_LIBRARIES="/path/to/ptscotch/libscotch.a;...libscotcherr.a;...libptscotch.a;...libptscotcherr.a"
CombBLAS (optional)
===================
Combinatioral BLAS can be used as an alternative for MC64, in order to
permute the matrix to get nonzeros on the diagonal.
https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/
Enable this feature by adding -DSTRUMPACK_USE_COMBBLAS to the CMake
command. Then specify -DCOMBBLAS_INCLUDES=".." and
-DCOMBBLAS_LIBRARIES="..".
Usage Instructions
==================
Please see the examples in the examples/ folder, which also contains a
simple Makefile (generated by cmake, see above). For more info, read
the manual.
## How to generate doxygen
==================
First time:
rm -rf build; mkdir build; cd build; cmake ..; doxygen doxygen.dox; cd doc/html
Quick recompile, from build:
cmake ..; doxygen doxygen.dox; cd doc/html
open index.html