forked from geodynamics/relax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
140 lines (90 loc) · 4.35 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
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
Before building Relax, you must have
Fortran 90 and C compilers (e.g. gfortran)
GMT 4.5 or greater
Proj 4.7.1 or greater
Python 2.4 or greater
***************************** NOTE ***********************************
Versions 4.5.1 and 4.5.2 of gfortran (and perhaps others) are
unable to compile Relax with OpenMP and optimizations. This manifests
itself as a compiler error when compiling viscoelastic3D.f90. One
workaround is to compile Relax without optimizations, but a better
solution is to use a different compiler.
**********************************************************************
A fast fft library, such as FFTW or MKL, is also highly recommended.
An implementation of the Cooley-Tukey FFT algorithm is included, but
it will be significantly slower.
The first step in building Relax is to configure the build system. Relax uses Waf
http://code.google.com/p/waf/
for configuration and building. To configure, run
./waf configure
To get basic help and a list of configuration options, run
./waf --help
Once configuration works, build Relax with the command
./waf
As one example, to compile the code on Mac OS X with the Intel fortran
compiler, the MKL libraries, and the Fink-provided GMT and Proj
libraries, we configured with the command
./waf configure --proj-dir=/sw --gmt-dir=/sw --mkl-libdir=/opt/intel/Compiler/11.1/084/Frameworks/mkl/lib/em64t/ --mkl-incdir=/opt/intel/Compiler/11.1/084/Frameworks/mkl/include --check-c-compiler=icc --check-fortran-compiler=ifort
As another example, to build Relax on Caltech's CITerra, we first built and
install gmt and proj into /home/walter/src/relax/relax-bin. We then
configured Relax with the command
CPPFLAGS="-I/usr/include/netcdf-4" LDFLAGS="-L/usr/lib64" ./waf configure --proj-dir=/home/walter/src/relax/relax-bin --gmt-dir=/home/walter/src/relax/relax-bin/ --mkl-incdir=/opt/intel/composerxe-2011.1.107/mkl/include/ --mkl-libdir=/opt/intel/composerxe-2011.1.107/mkl/lib/intel64/ --check-c-compiler=icc --check-fortran-compiler=ifort
Depending on how your libraries were built, you may have to set
LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (Mac) so that Relax can
find them. For example, on Mac OS X using Fink, you may have to run the command
export DYLD_LIBRARY_PATH=/sw/lib:/sw/lib/netcdf-gfortran/lib
To build Relax on Caltech's Fram cluster, use the commands:
module load ifort
module load gmt
CPPFLAGS="-I/opt/GMT-4.5.7/netcdf/include" LDFLAGS="-L/usr/lib64 -lgdal" ./waf configure --gmt-dir=/opt/GMT-4.5.7 --mkl-incdir=/opt/intel/composer_xe_2011_sp1.6.233/mkl/include/ --mkl-libdir=/opt/intel/composer_xe_2011_sp1.6.233/mkl/lib/intel64/ --check-c-compiler=icc --check-fortran-compiler=ifort
./waf build
-------------
relax library
-------------
To configure the relax shared library
CFLAGS=-fPIC FCFLAGS=-fPIC ./waf configure --relax-lite --gmt-dir=/usr/local/GMT4.5.8/intel
CFLAGS=-fPIC FCFLAGS=-fPIC ./waf lite
---------
GPU
---------
To build Relax for NVIDIA GPUs on Linux, we need to provide certain command-line options
./waf configure --use-cuda --cuda-dir=/usr/local/cuda
./waf
If you get an error 'CUDA Runtime API error 38: no CUDA-capable device is detected', you might need to explicitly enable the GPUs with the following command
sudo nvidia-xconfig --enable-all-gpus
-------
Doxygen
-------
You can generate a doxygen interface with the commands
mkdir doc
doxygen ./doxygen
---------------------
Environment Variables
---------------------
The valid environment variables for Waf are slightly different from
autoconf. Specifically, they are
CFLAGS
Selects compilation options for when the C compiler is used,
e.g. "-Wall".
CXXFLAGS
Selects compilation options for when the C++ compiler is used,
e.g. "-Wall".
FCFLAGS
Selects compilation options for when the Fortran compiler is used,
e.g. "-Wall".
CPPFLAGS
Selects C preprocessor options, e.g. "-DFOO=bar"
LINKFLAGS
Extra linker options, e.g. "-L/usr/local -lsome-library"
CC
The C compiler that will be used instead of the platform
default. Example CC=/usr/bin/gcc-2.95
CXX
The C++ compiler that will be used instead of the platform
default. Example CXX=/usr/bin/g++-2.95
FC
The fortran compiler that will be used instead of the platform
default. Example CXX=/usr/bin/gfortran
PREFIX
The default installation prefix to be used, if no --prefix option
is given.