Skip to content

Commit 343c76b

Browse files
Everything should now be in trunk
1 parent 168f7fc commit 343c76b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+17120
-0
lines changed

AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Main author(s):
2+
Dr. Brian Borchers <[email protected]> main contributor
3+
4+
Other contributors:
5+
Joseph Young <[email protected]> Original parallel version of
6+
op_o.
7+
Aaron Wilson <[email protected]> modified documentation/install
8+
procedure for COIN-OR

INSTALL

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
REQUIREMENTS:
2+
3+
The build process for CSDP uses make, so your system must have make
4+
installed. The GNU make works quite well, but CSDP has also been
5+
built with other versions of make. The make files are very simple.
6+
7+
In order to build CSDP, you will need an ANSI C compiler. The GNU C
8+
compiler gcc works quite well, but the code has also been compiled
9+
with Intel's icc, IBM's xlc, Sun's cc, and many other compilers.
10+
11+
Although CSDP itself is written in C, the BLAS/LAPACK libraries used
12+
by CSDP were originally written in Fortran. Combining C and Fortran
13+
is generally straight forward, but you may have to install a Fortran
14+
compiler in order to get run time libraries needed by the Fortran code
15+
in BLAS/LAPACK. In particular, on Linux systems using gcc you will
16+
need the g2c C/Fortran compatibility library that comes as part of the
17+
g77 package.
18+
19+
Use of the CSDP library and the solver and theta functions requires
20+
the BLAS library and a few routines from the LAPACK library. Using
21+
BLAS and LAPACK routines that have been optimized for your computer is
22+
critical to getting good performance from CSDP, since the code
23+
typically spends nearly all of its time in these routines. On the
24+
same hardware, it's not uncommon to find that optimized BLAS and
25+
LAPACK routines are an order of magnitude faster than unoptimized BLAS
26+
and LAPACK routines.
27+
28+
The original authors of BLAS and LAPACK have provided "reference
29+
implementations" that are freely available but not very well
30+
optimized. If your system has BLAS and LAPACK libraries in /usr/lib,
31+
there's a good chance that these are the reference implementations.
32+
Using them is a reasonable way to start, but you may well find that
33+
you need faster routines to get acceptable performance.
34+
35+
ATLAS (automatically tuned linear algebra software) is an open source
36+
implementation of BLAS and part of LAPACK that is sufficient for our
37+
purposes. ATLAS obtains good performance on a variety of systems by
38+
automatically adjusting blocksizes and other parameters to get the
39+
best performance out of any particular system. ATLAS is availible at
40+
41+
http://math-atlas.sourceforge.net/
42+
43+
If possible, use their precompiled, optimized libraries that are
44+
availible for several architectures, otherwise build it yourself
45+
from source.
46+
47+
Most hardware manufacturers have developed optimized BLAS/LAPACK
48+
libraries for their systems, such as Apple's veclib for G5
49+
systems, Intel's Math Kernel Library (MKL), AMD's Core Mathematical
50+
Library (ACML), IBM's extended scientific subroutine library (ESSL),
51+
and Sun's sunperf library. These typically have restrictive licenses and
52+
may be expensive to purchase, but can provide very good performance.
53+
54+
In practice, on Intel or AMD Linux systems, we find that ATLAS
55+
provides very good performance (close to if not better than MKL or
56+
ACML.) Thus we recommend ATLAS. However, to make the build process
57+
simpler and more flexible, the make files are setup to use whatever
58+
LAPACK and BLAS libraries are already installed on your system. If
59+
you decide to use ATLAS, the make files contain ATLAS specific
60+
instructions.
61+
62+
CSDP also includes a set of routines for interfacing CSDP to MATLAB
63+
and Octave. This interface is entirely optional- CSDP works fine
64+
without it. In order to use this interface, you will need MATLAB (6.5
65+
or later) or Octave (2.9.5 or later.) Note that earlier versions of
66+
Octave, particularly 2.0 and 2.1, will not function with this interface
67+
because Octave didn't support sparse matrices until version 2.9. The
68+
README file in the matlab directory contains instructions for installing
69+
the matlab interface and testing it on a sample problem.
70+
71+
DOWNLOADING CSDP:
72+
73+
The current version of CSDP can be obtained using subversion from
74+
the COIN-OR web site. To do this, first install the subversion
75+
tools, then issue the command
76+
77+
svn co https://projects.coin-or.org/svn/Csdp Csdp
78+
79+
Or use a GUI to access the repository.
80+
81+
Source and binaries for older stable versions of CSDP can be
82+
downloaded from
83+
84+
http://www.nmt.edu/~borchers/csdp.html
85+
86+
INSTALLING CSDP:
87+
88+
The following instructions assume that you're using a Linux system with
89+
gcc, g77, LAPACK, and BLAS installed. The make files will have to be
90+
altered for other systems, but the basic process of building the software
91+
will be similar.
92+
93+
After you've downloaded the source code, unpack the tar archive if you
94+
downloaded a .tar archive of CSDP 5.0, and then go into the csdp
95+
directory (this directory is called "Csdp" in subversion) Issue the
96+
command
97+
98+
> make
99+
100+
to build CSDP. Make will go into the lib, solver, theta, and example
101+
subdirectories and compile the C code, using values of CFLAGS and LIBS
102+
supplied in the Makefiles in these directories.
103+
104+
If the build fails, it is important to start by identifying where the
105+
build failed. Failures in building the CSDP library are extremely
106+
rare. Most reported failures have occured in the solver and theta
107+
directories. The most common problem in practice is that one or more
108+
of the required libraries (blas, lapack, or g2c) is missing. In that
109+
case you must install the required library before continuing with the
110+
installation of CSDP. If the build fails for some other reason, feel
111+
free to contact the author for help- we're interested in learning about
112+
problems on different systems.
113+
114+
If for some reason the build fails, it's a good idea to remove all
115+
of the binaries before modifying the make files and rebuilding. To do
116+
this, issue the command
117+
118+
> make clean
119+
120+
If the build appears to be successful, you can test the code with
121+
122+
> make unitTest
123+
124+
This will run tests of the stand alone solver csdp and Lovasz theta
125+
program theta. Compare the .out files produced by the test with the
126+
corresponding .correct files. The actual values will typically vary
127+
because of small differences in floating point round-off, compiler
128+
optimizations, and so on. However, the optimal objective values
129+
should match to at least six digits, the relative primal and dual
130+
infeasibilities should be smaller than 1.0e-7, and all DIMACS errors
131+
should be smaller than 5.0e-7.
132+
133+
If either of the tests fail, please contact the author.
134+
135+
Once you're satisfied with tests, you can become root and issue the
136+
command
137+
138+
> make install
139+
140+
This will copy csdp, rand_graph, complement, theta, and graphtoprob
141+
into the /usr/local/bin directory. If you use the C shell, remember
142+
to "rehash" so that the shell will know that these programs have been
143+
added to the /usr/local/bin directory.
144+
145+
The matlab directory contains .m files that provide a matlab interface
146+
to CSDP solver. To install these .m files they must be added to your
147+
matlab path. This requires use of the path(...) command in
148+
matlab. See '>help path' for instructions on adding a new directory to
149+
your matlab path (you can put the .m files in any directory you wish,
150+
then add that directory to your matlab path).
151+
152+
USING GCC 4:
153+
154+
In gcc 3.x, the C/Fortran compatibility library was linked with -lg2c. In
155+
gcc 4.x, you will need to link with -lgfortran instead.
156+
157+
Note that OpenMP support first appears in Red Hat's version of gcc 4.1.1
158+
and also appears in the general release of gcc 4.2. There is no OpenMP
159+
support in earlier versions of gcc!
160+
161+
RUNNING CSDP IN PARALLEL:
162+
163+
Version 6 of CSDP includes support for a parallel version of CSDP on
164+
multi-processor shared memory systems. This is done using the OpenMP
165+
standard for #pragma's that tell the C compiler how to parallelize
166+
various loops in the code. On systems that don't support OpenMP,
167+
these pragma's are simply ignored. On systems that do support OpenMP,
168+
it will typically be necessary to modify the CFLAGS and LIBS in the
169+
Makefiles to build a parallel version of CSDP. As an example, the
170+
following CFLAGS and LIBS have been used to build a parallel version
171+
of CSDP on a Red Hat Enterprise Linux system using Red Hat's version
172+
of gcc4.1 with ATLAS.
173+
174+
CFLAGS=CFLAGS=-O3 -march=nocona -m64 -fprefetch-loop-arrays -ftree-vectorize -ftree-vectorizer-verbose=1 -fopenmp -ansi -Wall -DNOSHORTS -DBIT64 -DUSEOPENMP -I../include
175+
176+
LIBS=LIBS=-static -L../lib -lsdp -llapack -lptf77blas -lptcblas -latlas -lgomp -lrt -lpthread -lgfortran -lm
177+
178+
179+
180+

0 commit comments

Comments
 (0)