-
Notifications
You must be signed in to change notification settings - Fork 18
/
INSTALL.STATIC
342 lines (214 loc) · 15.4 KB
/
INSTALL.STATIC
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
These instructions are only useful if you want to build binaries that
will run on other people's machines. If you are only running the
Relax on your own machine, just read the regular instructions in
INSTALL.
Static linking
--------------
After the binaries are built, to actually make the code run on another
machine, you need to copy
proj/proj_def.dat
gmt/pslib/PS_font_info.d
gmt/time/us.d
gmt/gmt.conf
into the following structure
share/time/us.d
share/gmt.conf
share/pslib/PS_font_info.d
share/proj_def.dat
You can do this by creating this file structure on your own machine,
added in the documentation, utilities, and examples, and put it in a
tarball (e.g. files.tgz). Then on each build machine you untar the
tarball and rename the directory to the correct place
(e.g. Relax-Linux32-1_0_4). Copy the binary to that directory and
remove unnecessary files (e.g. Linux and Mac do not need .bat files,
and Windows does not need the .sh or .csh files where there are .bat
files). On Windows, also copy the cygwin dll's. You can get the
right ones from a previous release of Relax. To create the final
file, run tar, zip, or hdiutil (see the instructions for each
machine).
Then before running set the environment variables
export PROJ_LIB=$PWD/share
export GMT_SHAREDIR=$PWD/share
Also, on the Mac, you have to set DYLD_LIBRARY_PATH to point to a
bundled version of libgcc_s. There are scripts for this in
setup_linux.sh, setup_mac.sh, and setup_win.bat.
-------
Windows
-------
Install cygwin and the packages gcc4, gcc4-fortran, libhdf5-devel, and
libfftw3-devel. libproj-devel is too old.
Download and configure netcdf 4.1.3 with
./configure --prefix=/home/walter/src/relax/relax-bin --enable-netcdf4 --disable-shared --disable-fortran --disable-dap
Download and configure GMT 4.5.7 (do not use install-gmt.sh)
./configure --prefix=/home/walter/src/relax/relax-bin --enable-netcdf=/home/walter/src/relax/relax-bin LIBS=-lnetcdf -lhdf5_hl -lhdf5 -lz --disable-xgrid --disable-shared --disable-ps
Download and configure Proj 4.7.0
./configure --prefix=/home/walter/src/relax/relax-bin --disable-shared
Finally, configure relax
./waf configure --use-fftw --gmt-dir=/home/walter/src/relax/relax-bin --proj-dir=/home/walter/src/relax/relax-bin/
Build relax, cd into build/, and redo the link line
cd build
gcc -Wl,--enable-auto-import -Wl,--enable-auto-import -fopenmp src/relax.f90.1.o src/types.f90.1.o src/ctfft.f.1.o src/fourier.f90.1.o src/green.f90.1.o src/okada/green_space.f90.1.o src/okada/dc3d.f.1.o src/elastic3d.f90.1.o src/friction3d.f90.1.o src/viscoelastic3d.f90.1.o src/writevtk.c.1.o src/writegrd4.2.c.1.o src/proj.c.1.o src/export.f90.1.o src/getdata.f.1.o src/getopt_m.f90.1.o src/input.f90.1.o src/mkl_dfti.f90.1.o -o /home/walter/src/relax/relax/build/relax.exe -Wl,-rpath,/home/walter/src/relax/relax-bin/lib -Wl,-rpath,/home/walter/src/relax/relax-bin//lib -Wl,-rpath,None -Wl,-Bstatic -Wl,-Bdynamic -L/home/walter/src/relax/relax-bin/lib -L/home/walter/src/relax/relax-bin//lib -LNone -lgmt -lnetcdf -lproj -lfftw3f -lfftw3f_threads /usr/lib/libhdf5_hl.a /usr/lib/libhdf5.a /usr/lib/libz.a `gcc -print-file-name=libgfortran.a` `gcc -print-file-name=libgomp.a`
Running ldd on the binary gives
$ ldd build/relax.exe
ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x77e80000)
kernel32.dll => /cygdrive/c/Windows/syswow64/kernel32.dll (0x76130000)
KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll (0x75970000)
cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
ADVAPI32.DLL => /cygdrive/c/Windows/syswow64/ADVAPI32.DLL (0x76030000)
msvcrt.dll => /cygdrive/c/Windows/syswow64/msvcrt.dll (0x75e20000)
sechost.dll => /cygdrive/c/Windows/SysWOW64/sechost.dll (0x75860000)
RPCRT4.dll => /cygdrive/c/Windows/syswow64/RPCRT4.dll (0x755f0000)
SspiCli.dll => /cygdrive/c/Windows/syswow64/SspiCli.dll (0x75560000)
CRYPTBASE.dll => /cygdrive/c/Windows/syswow64/CRYPTBASE.dll (0x75550000)
cygfftw3f-3.dll => /usr/bin/cygfftw3f-3.dll (0x64140000)
cyggcc_s-1.dll => /usr/bin/cyggcc_s-1.dll (0x6bf40000)
So you will have to include cygwin1.dll, cygfftw3f-3.dll, and
cyggcc_s-1.dll with the binary.
Create the binary package with a command like
zip -r ../Relax-Win-1_0_4.zip *
--------
Mac OS X
--------
You will first need a fortran compiler. Compile gcc 4.6.2 with
../gcc-4.6.2/configure --prefix=/Users/walter/src/gcc-4.6.2-bin --enable-languages=c,c++,fortran
Then build and install it. Set the path to point to the new compiler
export PATH=/Users/walter/src/gcc-4.6.2-bin/bin:$PATH
Tell the compiler to produce binaries that are compatible with 10.5.
export MACOSX_DEPLOYMENT_TARGET=10.5
Configure HDF5 1.8.8
./configure --prefix=/Users/walter/src/relax/relax-bin --disable-shared --disable-parallel
Configure NetCDF 4.1.3
./configure --prefix=/Users/walter/src/relax/relax-bin --enable-netcdf4 --disable-shared CPPFLAGS="-I/Users/walter/src/relax/relax-bin/include" LDFLAGS="-L/Users/walter/src/relax/relax-bin/lib" --disable-fortran --disable-dap
Get the GMT 4.5.7 tarball and configure it directly (do not use install-gmt.sh)
./configure --prefix=/Users/walter/src/relax/relax-bin --enable-netcdf=/Users/walter/src/relax/relax-bin LDFLAGS="-L/Users/walter/src/relax/relax-bin/lib" CPPFLAGS="-I/Users/walter/src/relax/relax-bin/include" LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" --disable-xgrid --disable-shared --disable-ps
Configure Proj 4.7.0
./configure --prefix=/Users/walter/src/relax/relax-bin --disable-shared
Configure FFTW 3.3
./configure --enable-threads --disable-openmp --enable-fortran --prefix=/Users/walter/src/relax/relax-bin --enable-single
Finally, configure Relax
./waf configure --use-fftw --gmt-dir=/Users/walter/src/relax/relax-bin/ --proj-dir=/Users/walter/src/relax/relax-bin/ --fftw-dir=/Users/walter/src/relax/relax-bin/
This will fail to link. cd into build/ and redo the final link with
cd build
gcc src/relax.f90.1.o src/types.f90.1.o src/ctfft.f.1.o src/fourier.f90.1.o src/green.f90.1.o src/okada/green_space.f90.1.o src/okada/dc3d.f.1.o src/elastic3d.f90.1.o src/friction3d.f90.1.o src/viscoelastic3d.f90.1.o src/writevtk.c.1.o src/writegrd4.2.c.1.o src/proj.c.1.o src/export.f90.1.o src/getdata.f.1.o src/getopt_m.f90.1.o src/input.f90.1.o src/mkl_dfti.f90.1.o -o /Users/walter/src/relax/relax/build/relax -Wl,-rpath,/Users/walter/src/relax/relax-bin//lib -Wl,-rpath,/Users/walter/src/relax/relax-bin//lib -Wl,-rpath,/Users/walter/src/relax/relax-bin//lib -L/Users/walter/src/relax/relax-bin//lib -L/Users/walter/src/relax/relax-bin//lib -L/Users/walter/src/relax/relax-bin//lib -lgmt -lnetcdf -lproj -lfftw3f -lfftw3f_threads -lhdf5 -lhdf5_hl -lz `gcc -print-file-name=libgomp.a` `gcc -print-file-name=libquadmath.a` `gcc -print-file-name=libgfortran.a` -static-libgcc
strip relax
Running otool -L on it gives
$ otool -L relax
relax:
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3
)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
125.2.11)
which are both provided by the system.
Create the binary package with a command like
hdiutil create -srcfolder Relax-Mac-1_0_4 Relax-Mac-1_0_4.dmg
------------------
Mac OS X with Fink
------------------
Install gmt, fftw, proj, gfortran, and gcc4.6. Configure with
CC=/sw/bin/gcc-fsf-4.6 CPPFLAGS="-I/usr/include/netcdf-4" ./waf configure --proj-dir=/sw --gmt-dir=/sw --fftw-dir=/sw --use-fftw
Copy system directories to the current directory.
cp /sw/lib/gcc4.6/lib/libquadmath.a /sw/lib/gcc4.6/lib/libgfortran.a /sw/lib/gcc4.6/lib/libgomp.a /sw/lib/libgmt.a /sw/lib/libnetcdf.a /sw/lib/libproj.a /sw/lib/libfftw3f.a /sw/lib/libfftw3f_threads.a .
Compile
./waf
and then recompile the executable
cd build
/sw/bin/gfortran relax.f90.1.o types.f90.1.o ctfft.f.1.o fourier.f90.1.o green.f90.1.o elastic3d.f90.1.o friction3d.f90.1.o viscoelastic3d.f90.1.o writevtk.c.1.o writegrd4.2.c.1.o proj.c.1.o export.f90.1.o getdata.f.1.o getopt_m.f90.1.o input.f90.1.o mkl_dfti.f90.1.o -o /Users/sbarbot/Documents/src/relax/relax -L.. -lgmt -lnetcdf -lproj -lfftw3f -lfftw3f_threads -lgomp -lquadmath -lgfortran -Wl,-search_paths_first -static-libgcc
Then the output of "otool -L ../relax" will give
../relax:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
which is a standard system library available on all Macs.
-----
Linux
-----
First install gmp
./configure --prefix=/home/walter/src/gcc-4.7.0-bin
then mpfr
./configure --prefix=/home/walter/src/gcc-4.7.0-bin --with-gmp=/home/walter/src/gcc-4.7.0-bin
then mpc
./configure --prefix=/home/walter/src/gcc-4.7.0-bin --with-gmp=/home/walter/src/gcc-4.7.0-bin --with-mpfr=/home/walter/src/gcc-4.7.0-bin/
On nix (32 bit), set
export LD_LIBRARY_PATH=/home/walter/src/gcc-4.7.0-bin/lib
while on io (64 bit), set
export LD_LIBRARY_PATH=/home/walter/src/gcc-4.7.0-bin/lib64:/home/walter/src/gcc-4.7.0-bin/lib
Then unpack gcc 4.7.0. Make
mkdir gcc-4.7.0-build
cd gcc-4.7.0-build
../gcc-4.7.0/configure --prefix=/home/walter/src/gcc-4.7.0-bin --enable-languages=c,c++,fortran --with-gmp=/home/walter/src/gcc-4.7.0-bin/ --with-mpfr=/home/walter/src/gcc-4.7.0-bin/ --with-mpc=/home/walter/src/gcc-4.7.0-bin/
make
make install
Now set the path
export PATH=/home/walter/src/gcc-4.7.0-bin/bin:$PATH
Install fftw using apt. Manually install hdf5 1.8.8 using the configure line
./configure --prefix=/home/walter/src/relax/relax-bin --disable-shared --disable-parallel
Then install netcdf 4.1.3 using the configure line
./configure --prefix=/home/walter/src/relax/relax-bin --enable-netcdf4 --disable-shared CPPFLAGS="-I/home/walter/src/relax/relax-bin/include" LDFLAGS="-L/home/walter/src/relax/relax-bin/lib" --disable-fortran
Install gmt 4.5.7 using the configure line (do not use install-gmt.sh)
./configure --prefix=/home/walter/src/relax/relax-bin --enable-netcdf=/home/walter/src/relax/relax-bin LDFLAGS="-L/home/walter/src/relax/relax-bin/lib" CPPFLAGS="-I/home/walter/src/relax/relax-bin/include" LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" --disable-xgrid --disable-shared --disable-ps
Install Proj 4.7.0 with the configure line
./configure --prefix=/home/walter/src/relax/relax-bin --disable-shared
Finally, configure relax with the line
python2.5 waf configure --use-fftw --gmt-dir=/home/walter/src/relax/relax-bin/ --proj-dir=/home/walter/src/relax/relax-bin/
Build relax, cd into build/, and redo the link with a command like
cd build
gcc src/relax.f90.1.o src/types.f90.1.o src/ctfft.f.1.o src/fourier.f90.1.o src/green.f90.1.o src/okada/green_space.f90.1.o src/okada/dc3d.f.1.o src/elastic3d.f90.1.o src/friction3d.f90.1.o src/viscoelastic3d.f90.1.o src/writevtk.c.1.o src/writegrd4.2.c.1.o src/proj.c.1.o src/export.f90.1.o src/getdata.f.1.o src/getopt_m.f90.1.o src/input.f90.1.o src/mkl_dfti.f90.1.o -o /home/walter/src/relax/relax/build/relax -Wl,-rpath,/home/walter/src/relax/relax-bin//lib -Wl,-rpath,/home/walter/src/relax/relax-bin//lib -Wl,-rpath,None -Wl,-Bstatic -Wl,-Bdynamic -L/home/walter/src/relax/relax-bin//lib -L/home/walter/src/relax/relax-bin//lib -LNone -lgmt -lnetcdf -lhdf5_hl -lhdf5 -lproj /usr/lib/libfftw3f.a /usr/lib/libfftw3f_threads.a /usr/lib/libz.a `gcc -print-file-name=libgfortran.a` `gcc -print-file-name=libgomp.a` -lm -lpthread -lrt -static-libgcc
strip relax
The changes to the default link line are
1) Change gfortran to gcc and add in
`gcc -print-file-name=libgfortran.a`
`gcc -print-file-name=libquadmath.a`
2) Add in hdf5 links.
3) Change fftw to static libs.
4) Remove -fopenmp and add in
`gcc -print-file-name=libgfortran.a`
5) Add in -lm, -lpthread, and -lrt
6) Add in -static-libgcc
Running ldd on the binary gives
$ ldd relax
linux-gate.so.1 => (0xb7797000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb776c000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7754000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb774a000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb75fb000)
/lib/ld-linux.so.2 (0xb7798000)
which are all things provided by the system.
Create the binary package with a command like
tar -zcvf Relax-Linux64-1_0_4.tgz Relax-Linux64-1_0_4/
--------------
Linux Centos 5
--------------
Mostly the same as regular linux, but log in as the buildbot. So
s/walter/buildbot/ in the instructions. You also have to build FFTW.
To be concrete, first install gmp
./configure --prefix=/home/buildbot/src/gcc-4.7.0-bin
then mpfr
./configure --prefix=/home/buildbot/src/gcc-4.7.0-bin --with-gmp=/home/buildbot/src/gcc-4.7.0-bin
then mpc
./configure --prefix=/home/buildbot/src/gcc-4.7.0-bin --with-gmp=/home/buildbot/src/gcc-4.7.0-bin --with-mpfr=/home/buildbot/src/gcc-4.7.0-bin/
Set
export LD_LIBRARY_PATH=/home/buildbot/src/gcc-4.7.0-bin/lib64:/home/buildbot/src/gcc-4.7.0-bin/lib
Then unpack gcc 4.7.0. Make
mkdir gcc-4.7.0-build
cd gcc-4.7.0-build
../gcc-4.7.0/configure --prefix=/home/buildbot/src/gcc-4.7.0-bin --enable-languages=c,c++,fortran --with-gmp=/home/buildbot/src/gcc-4.7.0-bin/ --with-mpfr=/home/buildbot/src/gcc-4.7.0-bin/ --with-mpc=/home/buildbot/src/gcc-4.7.0-bin/
make
make install
Now set the path
export PATH=/home/buildbot/src/gcc-4.7.0-bin/bin:$PATH
Configure HDF5
./configure --prefix=/home/buildbot/src/relax/relax-bin --disable-shared --disable-parallel
Configure NetCDF 4.1.3
./configure --prefix=/home/buildbot/src/relax/relax-bin --enable-netcdf4 --disable-shared CPPFLAGS="-I/home/buildbot/src/relax/relax-bin/include" LDFLAGS="-L/home/buildbot/src/relax/relax-bin/lib" --disable-fortran --disable-dap
Get the GMT 4.5.7 tarball and configure it directly (do not use install-gmt.sh)
./configure --prefix=/home/buildbot/src/relax/relax-bin --enable-netcdf=/home/buildbot/src/relax/relax-bin LDFLAGS="-L/home/buildbot/src/relax/relax-bin/lib" CPPFLAGS="-I/home/buildbot/src/relax/relax-bin/include" LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" --disable-xgrid --disable-shared --disable-ps
Configure Proj 4.7.0
./configure --prefix=/home/buildbot/src/relax/relax-bin --disable-shared
Configure FFTW 3.3
./configure --enable-threads --disable-openmp --enable-fortran --prefix=/home/buildbot/src/relax/relax-bin --enable-single
Finally, configure Relax
./waf configure --use-fftw --gmt-dir=/home/buildbot/src/relax/relax-bin/ --proj-dir=/home/buildbot/src/relax/relax-bin/ --fftw-dir=/home/buildbot/src/relax/relax-bin/
This will fail to link. cd into build/ and redo the final link with
cd build
gcc src/relax.f90.1.o src/types.f90.1.o src/ctfft.f.1.o src/fourier.f90.1.o src/green.f90.1.o src/okada/green_space.f90.1.o src/okada/dc3d.f.1.o src/elastic3d.f90.1.o src/friction3d.f90.1.o src/viscoelastic3d.f90.1.o src/writevtk.c.1.o src/writegrd4.2.c.1.o src/proj.c.1.o src/export.f90.1.o src/getdata.f.1.o src/getopt_m.f90.1.o src/input.f90.1.o src/mkl_dfti.f90.1.o -o /home/buildbot/src/relax/relax/build/relax -Wl,-rpath,/home/buildbot/src/relax/relax-bin//lib -Wl,-rpath,/home/buildbot/src/relax/relax-bin//lib -Wl,-rpath,/home/buildbot/src/relax/relax-bin//lib -Wl,-Bstatic -Wl,-Bdynamic -L/home/buildbot/src/relax/relax-bin//lib -L/home/buildbot/src/relax/relax-bin//lib -L/home/buildbot/src/relax/relax-bin//lib -lgmt -lnetcdf -lproj -lfftw3f -lfftw3f_threads -lhdf5_hl -lhdf5 -lz -lm `gcc -print-file-name=libgfortran.a` `gcc -print-file-name=libgomp.a` -lpthread -lrt -static-libgcc
strip relax.exe
Create the binary package with a command like
tar -zcvf Relax-Centos5-1_0_4.tgz Relax-Centos5-1_0_4/