[DSDP] Initial import.
Jerry James
jjames at fedoraproject.org
Wed Jun 8 03:03:50 UTC 2011
commit 57a046cf87381bfe4109b6a15d5436832968c7a1
Author: Jerry James <loganjerry at gmail.com>
Date: Tue Jun 7 21:03:30 2011 -0600
Initial import.
.gitignore | 2 +
DSDP-overflow.patch | 11 +++++
DSDP.Makefile | 79 ++++++++++++++++++++++++++++++++
DSDP.spec | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 2 +
5 files changed, 217 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..eff2b4e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/DSDP-man.tar.xz
+/DSDP5.8.tar.gz
diff --git a/DSDP-overflow.patch b/DSDP-overflow.patch
new file mode 100644
index 0000000..848ac7e
--- /dev/null
+++ b/DSDP-overflow.patch
@@ -0,0 +1,11 @@
+--- examples/readsdpa.c.orig 2005-10-21 13:31:14.000000000 -0600
++++ examples/readsdpa.c 2011-05-21 13:26:38.967119006 -0600
+@@ -107,7 +107,7 @@ int ReadSDPAFile(int argc,char *argv[]){
+ strncpy(thisline,argv[i+1],90); fp1=fopen(thisline,"r");runbenchmark=1; justone=0;
+ };
+ if (strncmp(argv[i],"-directory",8)==0){strncpy(directory,argv[i+1],90);}
+- if (strncmp(argv[i],"-table",4)==0){strncpy(tablename,argv[i+1],90);};
++ if (strncmp(argv[i],"-table",4)==0){strncpy(tablename,argv[i+1],20);};
+ if (strncmp(argv[i],"-suffix",4)==0){strncpy(suffix,argv[i+1],20);};
+ if (strncmp(argv[i],"-save",5)==0){ strncpy(savefile,argv[i+1],40);saveit=1;};
+ if (strncmp(argv[i],"-dlogsummary",8)==0){printsummary=atoi(argv[i+1]);}
diff --git a/DSDP.Makefile b/DSDP.Makefile
new file mode 100644
index 0000000..a562f78
--- /dev/null
+++ b/DSDP.Makefile
@@ -0,0 +1,79 @@
+# The upstream Makefile is broken in multiple ways.
+# 1. It doesn't allow for parallel building, due to many missing dependencies.
+# 2. It only builds static libraries. Yes, there is an "oshared" target that
+# supposedly builds a shared library. Try it and see how it works for you.
+# 3. Each target starts by doing a clean. That means that if you want to build
+# more than one target (we want to build 3), then each invocation of make
+# destroys all the work you did in the previous target.
+# 4. A number of targets explicitly invoke make, when they should have done
+# their work in the context of the current invocation of make.
+#
+# Forget it! I'm writing my own Makefile.
+
+CC = gcc
+INCLUDES = -I/usr/include/atlas -Iinclude -Isrc/solver -Isrc/sdp -Isrc/vecmat
+CFLAGS = @RPM_OPT_FLAGS@ -fPIC -DDSDP_TIME $(INCLUDES)
+BFLAGS = @RPM_OPT_FLAGS@ -DDSDP_TIME -Iinclude -Lsrc
+SONAME = -Wl,-h,libdsdp.so.5
+
+SOLVER_OBJS = src/solver/dualalg.o src/solver/dualimpl.o \
+ src/solver/dsdpcops.o src/solver/dsdpschurmat.o src/solver/dsdpcg.o \
+ src/solver/dsdpconverge.o src/solver/dsdpsetup.o \
+ src/solver/dsdpcone.o src/solver/dsdpsetoptions.o \
+ src/solver/dsdpsetdata.o src/solver/dsdprescone.o \
+ src/solver/dsdpobjcone.o src/solver/dsdpprintout.o \
+ src/solver/dsdpschurmatadd.o src/solver/dsdpx.o
+
+SDP_OBJS = src/sdp/dsdpstep.o src/sdp/printsdpa.o src/sdp/sdpconevec.o \
+ src/sdp/sdpsss.o src/sdp/dsdpadddata.o src/sdp/dsdpadddatamat.o \
+ src/sdp/dsdpblock.o src/sdp/sdpcone.o src/sdp/sdpkcone.o \
+ src/sdp/sdpcompute.o src/sdp/sdpconesetup.o src/sdp/dsdpdsmat.o \
+ src/sdp/dsdpdatamat.o src/sdp/dsdpdualmat.o src/sdp/dsdpxmat.o
+
+LP_OBJS = src/lp/dsdplp.o
+
+VECMAT_OBJS = src/vecmat/vech.o src/vecmat/vechu.o src/vecmat/drowcol.o \
+ src/vecmat/dlpack.o src/vecmat/dufull.o src/vecmat/sdpvec.o \
+ src/vecmat/identity.o src/vecmat/spds.o src/vecmat/zeromat.o \
+ src/vecmat/onemat.o src/vecmat/diag.o src/vecmat/rmmat.o \
+ src/vecmat/cholmat.o src/vecmat/cholmat2.o src/vecmat/dtrsm2.o \
+ src/vecmat/sdpmatx.o src/vecmat/sdpnfac.o src/vecmat/sdporder.o \
+ src/vecmat/sdpalloc.o src/vecmat/sdpsymb.o src/vecmat/sdpxlist.o \
+ src/vecmat/sdpdvct.o src/vecmat/sdpexit.o
+
+SYS_OBJS = src/sys/dsdperror.o src/sys/dsdploginfo.o src/sys/dsdplog.o \
+ src/sys/dsdptime.o
+
+BOUNDS_OBJS = src/bounds/dbounds.o src/bounds/allbounds.o
+
+LIB_OBJS = $(SOLVER_OBJS) $(SDP_OBJS) $(LP_OBJS) $(VECMAT_OBJS) $(SYS_OBJS) \
+ $(BOUNDS_OBJS)
+
+EXAMPLES = examples/maxcut examples/theta examples/dsdp5 examples/stable \
+ examples/color
+
+all: $(EXAMPLES)
+
+src/libdsdp.so. at version@: $(LIB_OBJS)
+ $(CC) $(CFLAGS) -shared $(SONAME) -o $@ $^ -L at libdir@/atlas -llapack
+
+src/libdsdp.so.5: src/libdsdp.so. at version@
+ ln -s libdsdp.so. at version@ $@
+
+src/libdsdp.so: src/libdsdp.so.5
+ ln -s libdsdp.so.5 $@
+
+examples/maxcut: examples/maxcut.c src/libdsdp.so
+ $(CC) $(BFLAGS) $< -o $@ -ldsdp
+
+examples/theta: examples/theta.c src/libdsdp.so
+ $(CC) $(BFLAGS) $< -o $@ -ldsdp
+
+examples/dsdp5: examples/readsdpa.c src/libdsdp.so
+ $(CC) $(BFLAGS) $< -o $@ -ldsdp
+
+examples/stable: examples/stable.c src/libdsdp.so
+ $(CC) $(BFLAGS) $< -o $@ -ldsdp
+
+examples/color: examples/color.c src/libdsdp.so
+ $(CC) $(BFLAGS) $< -o $@ -ldsdp
diff --git a/DSDP.spec b/DSDP.spec
new file mode 100644
index 0000000..3ec451f
--- /dev/null
+++ b/DSDP.spec
@@ -0,0 +1,123 @@
+Name: DSDP
+Version: 5.8
+Release: 2%{?dist}
+Summary: Software for semidefinite programming
+
+Group: Applications/Engineering
+License: DSDP
+URL: http://www.mcs.anl.gov/hs/software/DSDP/
+Source0: http://www.mcs.anl.gov/hs/software/DSDP/DSDP%{version}.tar.gz
+# Man pages written by Jerry James using text from the sources.
+# Therefore, the man pages have the same copyright and license as the source.
+Source1: DSDP-man.tar.xz
+# A substitute makefile to fix the brokenness of the distributed Makefiles
+Source2: DSDP.Makefile
+# This patch fixes a buffer overflow in one of the examples. It has not yet
+# been sent upstream.
+Patch0: DSDP-overflow.patch
+
+BuildRequires: atlas-devel
+BuildRequires: doxygen
+BuildRequires: tex(latex)
+
+%description
+DSDP is a free open source implementation of an interior-point method
+for semidefinite programming. It provides primal and dual solutions,
+exploits low-rank structure and sparsity in the data, and has relatively
+low memory requirements for an interior-point method. It allows
+feasible and infeasible starting points and provides approximate
+certificates of infeasibility when no feasible solution exists. The
+dual-scaling algorithm implemented in this package has a convergence
+proof and worst-case polynomial complexity under mild assumptions on the
+data. The software can be used as a set of subroutines, through Matlab,
+or by reading and writing to data files. Furthermore, the solver offers
+scalable parallel performance for large problems and a well documented
+interface. Some of the most popular applications of semidefinite
+programming and linear matrix inequalities (LMI) are model control,
+truss topology design, and semidefinite relaxations of combinatorial and
+global optimization problems.
+
+%package devel
+Summary: Headers and libraries for developing with DSDP
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+Headers and libraries for developing with DSDP.
+
+%package examples
+Summary: Example programs that use DSDP
+Group: Applications/Engineering
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description examples
+Examples programs that use the DSDP library.
+
+%prep
+%setup -q -n %{name}%{version}
+%setup -q -n %{name}%{version} -T -D -a 1
+%patch0
+
+sed -e "s|@RPM_OPT_FLAGS@|${RPM_OPT_FLAGS}|" \
+ -e "s|@libdir@|%{_libdir}|" \
+ -e "s|@version@|%{version}|" \
+ %{SOURCE2} > Makefile
+
+%build
+make %{?_smp_mflags}
+cd docs
+unzip DSDP5-api-html.zip
+cd dox
+rm -fr html images
+doxygen
+
+%install
+# Install the library
+mkdir -p $RPM_BUILD_ROOT%{_libdir}
+install -p -m 0755 src/libdsdp.so.%{version} $RPM_BUILD_ROOT%{_libdir}
+ln -s libdsdp.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libdsdp.so.5
+ln -s libdsdp.so.5 $RPM_BUILD_ROOT%{_libdir}/libdsdp.so
+
+# Install the header files
+mkdir -p $RPM_BUILD_ROOT%{_includedir}
+cp -a include $RPM_BUILD_ROOT%{_includedir}/DSDP
+
+# Install the example programs with a dsdp- prefix, except for dsdp5
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+for f in maxcut theta stable color; do
+ install -p -m 0755 examples/$f $RPM_BUILD_ROOT%{_bindir}/dsdp-$f
+done
+install -p -m 0755 examples/dsdp5 $RPM_BUILD_ROOT%{_bindir}
+
+# Install the man pages
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+cd man
+for f in *.1; do
+ sed "s/@VERSION@/%{version}/" $f > $RPM_BUILD_ROOT%{_mandir}/man1/$f
+done
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%doc dsdp-license docs/DSDP5-Exe-UserGuide.pdf docs/DSDP5-P1289-0905.pdf
+%{_libdir}/libdsdp.so.*
+
+%files devel
+%doc docs/DSDP5-API-UserGuide.pdf docs/dox
+%{_libdir}/libdsdp.so
+%{_includedir}/DSDP
+
+%files examples
+%doc examples/Contents
+%{_bindir}/*
+%{_mandir}/man1/*
+
+%changelog
+* Tue Jun 7 2011 Jerry James <loganjerry at gmail.com> - 5.8-2
+- Ensure the libraries are installed with the execute bit on
+- Name the license according to the response from Fedora-Legal
+
+* Wed May 25 2011 Jerry James <loganjerry at gmail.com> - 5.8-1
+- Initial RPM
diff --git a/sources b/sources
index e69de29..81ef12f 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+faf430dc765c97f0c60737e8d85d09aa DSDP-man.tar.xz
+37c15a3c6c3f13e31262f65ac4364b5e DSDP5.8.tar.gz
More information about the scm-commits
mailing list