-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathINSTALL
396 lines (303 loc) · 11.9 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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
SDPA 7.3.X Install Manual
[Copyright (C) 2004-2012 SDPA Project]
This text explains how to install SDPA.
If you have questions on the installation,
please contact us from
http://sdpa.sourceforge.net/contact.html
The user-manual of SDPA is available at
https://sourceforge.net/projects/sdpa/files/sdpa/sdpa.7.1.1.manual.20080618.pdf/download
--- index ------------------------------------
1. Install the SDPA
2. Compile callable-library example [optional]
3. Compile SDPA-M (for Matlab and Octave) [optional]
including short manual for SDPA-M
4. Note for Mac OS X
5. Note for existing MUMPS package (for Ubuntu/Debian)
6. If you have some trouble
----------------------------------------------
1. Install the SDPA
(1) Download the SDPA from the SDPA Homepage;
http://sdpa.sourceforge.net/download.html
You can get the sdpa_7.3.X.tar.gz
(2) configure && make
You can select BLAS library from the three, OpenBLAS, ATLAS, and
LAPACK/BLAS. The selection of BLAS library sometimes strongly affects
the performance of SDPA. From our numerical experiments, GotoBLAS
attains best performance. If you are allowed to use GotoBLAS (for the
details, refer the GotoBLAS license), our suggestion is GotoBLAS. The
LAPACK/BLAS is only for the case both ATLAS and Goto BLAS can not be
compiled.
If you install SDPA into **Mac OS X**, then first take a
look this section before your compile. Then, you should read
Section 4 ``Note for Mac OS X'' and return here.
(2-1) SDPA linked against GotoBLAS library
Assume that SDPA is installed into $HOME/sdpa/.
# OpenBLAS
$ mkdir -p $HOME/sdpa
$ git clone https://github.com/xianyi/OpenBLAS.git
$ cd OpenBLAS
Depending on OS bit (64 or 32),
$ make BINARY=64 CC=gcc FC=gfortran USE_OPENMP=0 NO_CBLAS=1 NO_WARMUP=1 libs netlib;
or
$ make BINARY=32 CC=gcc FC=gfortran USE_OPENMP=0 NO_CBLAS=1 NO_WARMUP=1 libs netlib;
[If you are going to use mex files on Mac OS X
with Matlab 2009a or earlier, we suggest
you use 32bit (because Matlab 2009a on Mac OS X
is 32bit)]
# SDPA
$ cd $HOME/sdpa
$ tar xzf sdpa_7.3.X.tar.gz
$ cd sdpa-7.3.X
$ export CC=gcc
$ export CXX=g++
$ export FC=gfortran
$ export CFLAGS="-funroll-all-loops"
$ export CXXFLAGS="-funroll-all-loops"
$ export FFLAGS="-funroll-all-loops"
$ ./configure --prefix=$HOME/sdpa --with-blas="${HOME}/sdpa/OpenBLAS/libopenblas.a" --with-lapack="${HOME}/sdpa/OpenBLAS/libopenblas.a"
$ make
$ make install
(2-2) SDPA linked against ATLAS library
Download the ATLAS library from the following web site;
http://math-atlas.sourceforge.net/
Download the LAPACK library from the following web site;
http://www.netlib.org/lapack/
Assume that SDPA and ATLAS/LAPACK library are installed into $HOME/sdpa/sdpa_7.3.X and $HOME/sdpa/lib respectively.
# LAPACK
$ tar xvzf lapack.tgz
$ cd lapack-3.3.0
$ cp ./INSTALL/make.inc.gfortran make.inc
$ make lapacklib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC"
$ cp lapack_LINUX.a $HOME/sdpa/lib/liblapack.a
# ATLAS
$ cd $HOME/sdpa
$ tar xvzf atlas3.x.x.tar.gz
$ mkdir -p $HOME/sdpa/atlas-tmp
$ cd $HOME/sdpa/atlas-tmp
$ ../ATLAS/configure --prefix=$HOME/sdpa/atlas \
-Si cputhrchk 0 \
--with-netlib-lapack=$HOME/sdpa/lib/liblapack.a \
-C ic gcc -C if gfortran -Fa alg -fPIC
If your OS is 64bit, you should configure exlicitly by
adding '-b 64' as follows.
$ ../ATLAS/configure --prefix=$HOME/sdpa/atlas \
-Si cputhrchk 0 \
--with-netlib-lapack=$HOME/sdpa/lib/liblapack.a \
-C ic gcc -C if gfortran -Fa alg -fPIC -b 64
$ make
$ make install
$ rm -rf $HOME/sdpa/atlas-tmp
Note:
On Mac OS X, 'make' or 'make install'
of ATLAS sometimes fail. In this case,
copy from the build directory as follow
$ cp $HOME/sdpa/atlas-tmp/lib/lib*.a $HOME/sdpa/atlas/lib/
# SDPA
$ cd $HOME/sdpa
$ tar xzf sdpa_7.3.X.tar.gz
$ cd sdpa-7.3.X
$ export CC=gcc
$ export CXX=g++
$ export FC=gfortran
$ export CFLAGS="-funroll-all-loops"
$ export CXXFLAGS="-funroll-all-loops"
$ export FFLAGS="-funroll-all-loops"
$ ./configure --prefix=$HOME/sdpa --with-blas="-L${HOME}/sdpa/atlas/lib -lptf77blas -lptcblas -latlas" --with-lapack="-L${HOME}/sdpa/lib -llapack"
Note:
If your OS is Mac OS X, assign the full paths,
$ ./configure --prefix=$HOME/sdpa --with-blas="${HOME}/sdpa/atlas/lib/libptf77blas.a ${HOME}/sdpa/atlas/lib/libatlas.a" --with-lapack="${HOME}/sdpa/lib/liblapack.a"
$ make
$ make install
(2-3) SDPA linked against LAPACK/BLAS library
Download the LAPACK/BLAS library from the following web site;
http://www.netlib.org/lapack/
Assume that SDPA and LAPACK/BLAS library are installed into $HOME/sdpa/sdpa_7.3.X and $HOME/sdpa/lib respectively.
# LAPACK/BLAS
$ tar xvzf lapack.tgz
$ cd lapack-3.3.0
$ make blaslib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC"
$ make lapacklib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC"
$ cp blas_LINUX.a $HOME/sdpa/lib/libblas.a
$ cp lapack_LINUX.a $HOME/sdpa/lib/liblapack.a
# SDPA
$ cd $HOME/sdpa
$ tar xzf sdpa_7.3.X.tar.gz
$ cd sdpa-7.3.X
$ export CC=gcc
$ export CXX=g++
$ export FC=gfortran
$ export CFLAGS="-funroll-all-loops"
$ export CXXFLAGS="-funroll-all-loops"
$ export FFLAGS="-funroll-all-loops"
$ ./configure --with-blas="-L${HOME}/sdpa/lib -lblas" --with-lapack="-L${HOME}/sdpa/lib -llapack"
$ make
$ make install
(3) execute
Try the following command to execute sdpa
$ cd $HOME/sdpa/bin/
$ ./sdpa
Then you will see message from SDPA and can check command line options.
To solve input dat-s and write its result,
$ ./sdpa $HOME/sdpa/share/sdpa/example/example1.dat-s example1.result
If you specify the number of threads with the SDPA,
set OMP_NUM_THREADS environment variable(ex. export OMP_NUM_THREADS=4).
If you have dual-core or quad-core CPU, we strongly recommend that set
$ export OMP_NUM_THREADS=2
or
$ export OMP_NUM_THREADS=4
The details of the configure script option for each OS
can be found in sdpa user manual.
(https://sourceforge.net/projects/sdpa/files/sdpa/sdpa.7.1.1.manual.20080618.pdf/download)
----------------------------------------------
2. Compile callable-library example (optional)
To compile callable-library example, use 'make' command
in 'libexample' directory
$ cd $HOME/sdpa/share/sdpa/libexample
$ make
The details of callable-library can be found in
SDPA user manual in $HOME/sdpa/share/sdpa/
----------------------------------------------
3. Compile SDPA-M (optional)
To compile SDPA-M, use 'make' command
in 'mex' directory
$ cd $HOME/sdpa/share/sdpa/mex
$ make
If you use Octave instead of Matlab, then
$ cd $HOME/sdpa/share/sdpa/mex
$ make COMPILE_ENVIRONMENT=octave
The make command automatically searches 'mex' command
by invoking 'matlab' command. If this auto-search fails,
you setup the full-path for 'mex' command in Makefile
in the 'mex' directory and use 'make' command again.
Since the usage of this new SDPA-M as SDPA-M 6.2.0,
SDPA-M 6.2.0 manual is very useful.
(https://sourceforge.net/projects/sdpa/files/sdpa-m/sdpamManual.pdf/download)
In addition, the file 'mex/CommandList.txt' summarizes
each command.
When you have trouble with SDPA-M(Matlab environment),
the following command will display useful messages.
$ matlab -Dgdb
[On gdb environment]
(gdb) run -nodisplay
[On Matlab environment]
>> (Call SDPA-M by sdpam or sedumiwrap)
If Matlab aborts, try the following command in gdb environment.
(gdb) where
The command 'where' will display what happened.
To exit gdb environment,
(gdb) quit
In some case, the segmentation fault may be avoided by
$ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libgfortran.so:$LD_PRELOAD
$ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libstdc++.so:$LD_PRELOAD
$ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libgcc_s.so:$LD_PRELOAD
$ matlab
In particular, when the gcc version is higher than the version Matlab
assumes, Matlab sometimes can not load appropriate shared libraries.
The command above load the libraries before Matlab launches.
----------------------------------------------
4. Note for Mac OS X
Since the installation of SDPA requires gfortran,
we recommend the users install 'fink' system,
which is a package manager for Mac OS X.
(You need an administrator authority for your system).
To install fink system, please refer
http://www.finkproject.org/
and
http://www.finkproject.org/download/index.php?phpLang=en
In particular, the following URLs are useful when
you have trouble with fink.
http://www.finkproject.org/faq/upgrade-fink.php?phpLang=en
http://www.finkproject.org/faq/index.php?phpLang=en
(1-1) SDPA linked against ATLAS library
Install atlas by the fink system.
(You can install atlas by following Section 1 above;
but the installation by the fink system is easier.)
$ sudo fink install atlas
The atlas package in the fink system also contains
lapack library. If your system does not have gcc-4
or gfortran, the fink system automatically installs
them before compiling the atlas package.
You can check whether your system successfully installed
gcc-4 and atlas by the following command.
[To check gcc-4]
$ /sw/bin/gcc-4 -v
$ /sw/bin/g++-4 -v
$ /sw/bin/gfortran -v
[To check atlas]
$ ls -l /sw/lib/libptf77blas.a
$ ls -l /sw/lib/libptcblas.a
$ ls -l /sw/lib/libatlas.a
$ ls -l /sw/lib/liblapack.a
To install SDPA, download the SDPA from the SDPA Homepage;
http://sdpa.sourceforge.net/download.html
You can get the sdpa_7.3.X.tar.gz
Then the following commands will install SDPA.
$ mkdir $HOME/sdpa
$ cd $HOME/sdpa
$ tar xzf sdpa_7.3.X.tar.gz
$ cd sdpa-7.3.X
$ export CC=/sw/bin/gcc-4
$ export CXX=/sw/bin/g++-4
$ export FC=/sw/bin/gfortran
$ export CFLAGS="-funroll-all-loops"
$ export CXXFLAGS="-funroll-all-loops"
$ export FFLAGS="-funroll-all-loops"
$ ./configure --prefix=$HOME/sdpa --with-blas="/sw/lib/libptf77blas.a /sw/lib/libptcblas.a /sw/lib/libatlas.a" --with-lapack="/sw/lib/liblapack.a"
$ make
$ make install
(1-2) SDPA linked against GotoBLAS library or LAPACK/BLAS library
In these cases, instead of installing atlas, you need to
install gfortran into Mac OS X. You can install gfortran
by the following command:
$ fink install gcc43
After installing gfortran, go back to (2-2) of Section 2.
(Even if you have already installed LAPACK into your computer
by using fink system, it is inappropriate to link with GotoBLAS
(since the LAPACK of the fink system has some ATLAS interface)
and you need to install LAPACK by following (2-2) of Section 2.)
(1-3) compile callable-library example and SDPA-M in Mac OS X
To use callable library and SDPA-M,
after using make install, you need to modify
etc/make.inc to remove "-lcrt1.10.5"
(due to a confliction between Mac OS X and Matlab).
$ cd $HOME/sdpa/sdpa-7.3.X/etc
$ sed -e 's/-lcrt1.10.5.o//g' -i .bak make.inc
Then
$ cd $HOME/sdpa/share/sdpa/libexample
$ make
$ cd $HOME/sdpa/share/sdpa/mex
$ make
Sometimes 'make' command in the 'mex' directory fails,
since Matlab directory may depend on your environment.
In the case, modify 'Makefile' in the 'mex' directory
from
MEX = /Applications/MATLAB_R2008b.app/bin/mex
to (for example)
MEX = /Applications/MATLAB_R2007b/bin/mex
and use 'make' command again.
In addition, some warning may be displayed due to
a confliction between Mac OS X and Matlab.
-------------------------------------------------------
5. Note for existing MUMPS package (for Ubuntu/Debian)
On Ubuntu/Debian, you can install a MUMPS package by
$ sudo aptitude install libmumps-seq-dev
If you have alredy a MUMPS package, you can use it
by assiging it to configure script.
For example, on Debian, the header file is
'/usr/include/dmumps_c.h' and the library file is
'/usr/lib/libdmumps_seq.a'.
In this case
$ ./configure --prefix=$HOME/sdpa \
--with-blas=SOME_BLAS --with-lapack=SOME_LAPACK \
--with-mumps-include="-I/usr/include" \
--with-mumps-libs="-L/usr/lib -ldmumps_seq"
Then
$ make
$ make install
-------------------------------------------------------
6. If you have some trouble
If some bugs are found or you encounter some trouble
when you are compiling SDPA, please let us know from
http://sdpa.sourceforge.net/contact.html
In particular, attaching error messages and/or 'config.log' file
is very useful to let us understand your situation.