summaryrefslogtreecommitdiff
path: root/math/sdpa
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2003-10-04 04:21:13 +0000
committerMaho Nakata <maho@FreeBSD.org>2003-10-04 04:21:13 +0000
commit6004b8dfd695ad1294f9a8b94bc2a27c23f242e5 (patch)
tree89e0b799be4ab858a434e659f8d621024a329561 /math/sdpa
parentUpgrade to v5.5.2. (diff)
Add new port math/sdpa.
The SDPA (SemiDefinite Programming Algorithm) is a software package for solving semidefinite program (SDP). Extremely efficient, almost fastest around the world!
Notes
Notes: svn path=/head/; revision=90200
Diffstat (limited to 'math/sdpa')
-rw-r--r--math/sdpa/Makefile85
-rw-r--r--math/sdpa/distinfo4
-rw-r--r--math/sdpa/files/Makefile51
-rw-r--r--math/sdpa/files/patch-Makefile24
-rw-r--r--math/sdpa/files/patch-rsdpa_include.h19
-rw-r--r--math/sdpa/pkg-descr18
-rw-r--r--math/sdpa/pkg-plist28
7 files changed, 229 insertions, 0 deletions
diff --git a/math/sdpa/Makefile b/math/sdpa/Makefile
new file mode 100644
index 000000000000..de4e0131887a
--- /dev/null
+++ b/math/sdpa/Makefile
@@ -0,0 +1,85 @@
+# New ports collection makefile for: sdpa
+# Date created: October 4 2003
+# Whom: NAKATA, Maho <maho@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= sdpa
+PORTVERSION= 6.00
+CATEGORIES= math
+MASTER_SITES= http://www.is.titech.ac.jp/~yamashi9/sdpa/
+DISTFILES= ${PORTNAME}.${PORTVERSION}.src.tar.gz
+.if !defined(NOPORTDOCS)
+DISTFILES+= ${PORTNAME}.${PORTVERSION}.manual.ps.gz \
+ ${PORTNAME}.${PORTVERSION}.manual.pdf \
+ ${PORTNAME}.${PORTVERSION}.install.txt
+.endif
+DIST_SUBDIR= sdpa
+EXTRACT_ONLY= ${PORTNAME}.${PORTVERSION}.src.tar.gz
+
+MAINTAINER= maho@FreeBSD.org
+COMMENT= SDPA(SemiDefinite Programming Algorithm) Very efficent SDP Solver
+
+LIB_DEPENDS= lapack:${PORTSDIR}/math/lapack \
+ atlas:${PORTSDIR}/math/atlas
+
+RESTRICTED= "unsure distribution condition"
+
+USE_REINPLACE= yes
+USE_GMAKE= yes
+USE_REINPLACE= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
+LAPACK= -lalapack
+CBLAS= -lcblas -lf77blas -latlas -lg2c
+
+.if defined(WITH_OPTIMIZED_FLAGS)
+CFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double
+CXXFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double -Wno-multichar
+.if (${MACHINE_ARCH} == "i386")
+CFLAGS+= -mcpu=i686 -march=i686 -mfancy-math-387 -mpreferred-stack-boundary=3
+CXXFLAGS+= -mcpu=i686 -march=i686 -mfancy-math-387 -mpreferred-stack-boundary=3
+.endif # i386
+.endif
+
+pre-build:
+ ${CP} ${FILESDIR}/Makefile ${WRKDIR}
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
+ s|%%LAPACK%%|${LAPACK}|g ; \
+ s|%%LOCALBASE%%|${LOCALBASE}|g ; \
+ s|%%CBLAS%%|${CBLAS}|g' ${WRKDIR}/Makefile
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
+ s|%%LOCALBASE%%|${LOCALBASE}|g ; \
+ s|%%CXX%%|${CXX}| g ; \
+ s|%%CXXFLAGS%%|${CXXFLAGS}|g ; \
+ s|%%LAPACK%%|${LAPACK}|g ; \
+ s|%%CBLAS%%|${CBLAS}|g' ${WRKSRC}/Makefile
+.if !defined(WITH_OPTIMIZED_FLAGS)
+ @${ECHO} "You can optimize by setting WITH_OPTIMIZED_FLAGS=yes."
+.endif
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/sdpa ${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/libsdpa.a ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKSRC}/sdpa-lib.hpp ${PREFIX}/include
+ ${INSTALL_DATA} ${WRKSRC}/sdpa-lib2.hpp ${PREFIX}/include
+ @${MKDIR} ${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/param.sdpa ${DATADIR}
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for i in sdpa.6.00.manual.ps.gz sdpa.6.00.manual.pdf sdpa.6.00.install.txt
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${i} ${DOCSDIR}
+.endfor
+ @${MKDIR} ${EXAMPLESDIR}
+.for i in example1-1.cpp example1-2.cpp example1.dat example1.dat-s example1.ini \
+ example1.ini-s example1.result example2-1.cpp example2-2.cpp \
+ example2.dat example2.result example3.cpp example4.cpp \
+ example5.cpp example6.cpp
+ ${INSTALL_DATA} ${WRKSRC}/${i} ${EXAMPLESDIR}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/param.sdpa ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKDIR}/Makefile ${EXAMPLESDIR}
+
+.endif
+
+.include <bsd.port.mk>
diff --git a/math/sdpa/distinfo b/math/sdpa/distinfo
new file mode 100644
index 000000000000..18c806c6ee27
--- /dev/null
+++ b/math/sdpa/distinfo
@@ -0,0 +1,4 @@
+MD5 (sdpa/sdpa.6.00.src.tar.gz) = bde7645823b7e3a5a80e6fdf3aa0cc3b
+MD5 (sdpa/sdpa.6.00.manual.ps.gz) = f5bf16660f2980903a41dc377fd6d262
+MD5 (sdpa/sdpa.6.00.manual.pdf) = a2c22d9b56f2fe9e6895e4f1ada672ae
+MD5 (sdpa/sdpa.6.00.install.txt) = f1991302c8b93b0d8da058f0b9f773db
diff --git a/math/sdpa/files/Makefile b/math/sdpa/files/Makefile
new file mode 100644
index 000000000000..3dc028b57c00
--- /dev/null
+++ b/math/sdpa/files/Makefile
@@ -0,0 +1,51 @@
+#
+# Makefile for SDPA example(please use gmake)
+# Sample Makefile written by <maho@FreeBSD.org>
+#
+# $FreeBSD$
+
+PREFIX = %%PREFIX%%
+LOCALBASE = %%LOCALBASE%%
+LAPACK_LIB = %%LAPACK%% %%CBLAS%%
+SDPA_LIB = -lsdpa
+SDPA_EXAMPLES = example1-1.exe example1-2.exe \
+ example2-1.exe example2-2.exe \
+ example3.exe example4.exe \
+ example5.exe example6.exe
+
+SOURCES = example1-1.cpp example1-2.cpp \
+ example2-1.cpp example2-2.cpp \
+ example3.cpp example4.cpp \
+ example5.cpp example6.cpp
+
+all: $(SDPA_EXAMPLES)
+
+clean:
+ rm -f *.o *.exe
+
+example1-1.exe: example1-1.o
+ $(CXX) $(CXXFLAGS) -o $@ example1-1.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example1-2.exe: example1-2.o
+ $(CXX) $(CXXFLAGS) -o $@ example1-2.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example2-1.exe: example2-1.o
+ $(CXX) $(CXXFLAGS) -o $@ example2-1.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example2-2.exe: example2-2.o
+ $(CXX) $(CXXFLAGS) -o $@ example2-2.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example3.exe: example3.o
+ $(CXX) $(CXXFLAGS) -o $@ example3.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example4.exe: example4.o
+ $(CXX) $(CXXFLAGS) -o $@ example4.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example5.exe: example5.o
+ $(CXX) $(CXXFLAGS) -o $@ example5.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+example6.exe: example6.o
+ $(CXX) $(CXXFLAGS) -o $@ example6.o -L$(PREFIX)/lib -L$(LOCALBASE)/lib $(LAPACK_LIB) $(SDPA_LIB) -lm
+
+.cpp.o:
+ $(CXX) $(CXXFLAGS) -c -I$(PREFIX)/include -I$(LOCALBASE)/include -o $@ $< \ No newline at end of file
diff --git a/math/sdpa/files/patch-Makefile b/math/sdpa/files/patch-Makefile
new file mode 100644
index 000000000000..b36fa563eb36
--- /dev/null
+++ b/math/sdpa/files/patch-Makefile
@@ -0,0 +1,24 @@
+--- Makefile.orig Fri Jun 6 10:13:51 2003
++++ Makefile Sat Oct 4 11:33:31 2003
+@@ -1,8 +1,7 @@
+-LAPACK = $(HOME)/lib/b/lapack
++LAPACK = %%LOCALBASE%%
+ RSDPA = .
+
+-LAPACK_LIB = -llapack -lcblaswr -lcblas \
+- -lf77blas -lI77 -lF77 -latlas
++LAPACK_LIB = %%LAPACK%% %%CBLAS%%
+
+ # if you use BLAS in clapack.tgz, use next line
+ # and set NON_ATLAS_SDPA in rsdpa_include.h to 1.
+@@ -14,8 +13,8 @@
+ #RSDPA_LIB_NAME = rsdpa
+ RSDPA_LIB = -l$(RSDPA_LIB_NAME)
+
+-CC = g++
+-OPTION = -O3 # -Wall # -g
++CC = %%CXX%%
++OPTION = %%CXXFLAGS%%
+
+ TARGET_EXE = $(RSDPA_LIB_NAME)
+ #TARGET_EXE = rsdpa_main.exe
diff --git a/math/sdpa/files/patch-rsdpa_include.h b/math/sdpa/files/patch-rsdpa_include.h
new file mode 100644
index 000000000000..fd8d39bd5a09
--- /dev/null
+++ b/math/sdpa/files/patch-rsdpa_include.h
@@ -0,0 +1,19 @@
+--- rsdpa_include.h.orig Sat Nov 2 11:10:59 2002
++++ rsdpa_include.h Sun Aug 3 09:07:52 2003
+@@ -21,13 +21,13 @@
+ #include <cstring>
+
+ extern "C" {
+-#include <f2c.h>
++#include <g2c.h>
+ #if NON_ATLAS_SDPA
+ #include <blaswrap.h>
+ #endif
+-#include <fblaswr.h>
+ #include <cblas.h>
+-#include <clapack.h>
++#include <blas.h>
++#include <lapack.h>
+ };
+
+ using namespace std;
diff --git a/math/sdpa/pkg-descr b/math/sdpa/pkg-descr
new file mode 100644
index 000000000000..7274dcddb415
--- /dev/null
+++ b/math/sdpa/pkg-descr
@@ -0,0 +1,18 @@
+The SDPA (SemiDefinite Programming Algorithm) is a software package for
+solving semidefinite program (SDP). It is based on a Mehrotra-type
+predictor-corrector infeasible primal-dual interior-point method.
+The SDPA handles the standard form SDP and its dual. It is implemented in C++
+language utilizing the LAPACK for matrix computation. The SDPA incorporates
+dynamic memory allocation and deallocation. So, the maximum size of an SDP
+to be solved depends on the size of memory which users' computers install.
+The SDPA enjoys the following features:
+
+ 1. Callable library of the SDPA is available.
+ 2. Efficient method for computing the search directions when an SDP
+ to be solved is large scale and sparse.
+ 3. Block diagonal matrix structure and sparse matrix structure in
+ data matrices are available.
+ 4. Some information on infeasibility of a semidefinite program to be solved
+ is provided.
+
+WWW: http://www.is.titech.ac.jp/~yamashi9/sdpa/
diff --git a/math/sdpa/pkg-plist b/math/sdpa/pkg-plist
new file mode 100644
index 000000000000..c1e7ee5f65d0
--- /dev/null
+++ b/math/sdpa/pkg-plist
@@ -0,0 +1,28 @@
+bin/sdpa
+lib/libsdpa.a
+include/sdpa-lib.hpp
+include/sdpa-lib2.hpp
+share/examples/sdpa/Makefile
+share/examples/sdpa/example1-1.cpp
+share/examples/sdpa/example1-2.cpp
+share/examples/sdpa/example1.dat
+share/examples/sdpa/example1.dat-s
+share/examples/sdpa/example1.ini
+share/examples/sdpa/example1.ini-s
+share/examples/sdpa/example1.result
+share/examples/sdpa/example2-1.cpp
+share/examples/sdpa/example2-2.cpp
+share/examples/sdpa/example2.dat
+share/examples/sdpa/example2.result
+share/examples/sdpa/example3.cpp
+share/examples/sdpa/example4.cpp
+share/examples/sdpa/example5.cpp
+share/examples/sdpa/example6.cpp
+share/examples/sdpa/param.sdpa
+share/sdpa/param.sdpa
+@dirrm share/sdpa
+@dirrm share/examples/sdpa
+%%PORTDOCS%%%%DOCSDIR%%/sdpa.6.00.manual.ps.gz
+%%PORTDOCS%%%%DOCSDIR%%/sdpa.6.00.manual.pdf
+%%PORTDOCS%%%%DOCSDIR%%/sdpa.6.00.install.txt
+%%PORTDOCS%%@dirrm %%DOCSDIR%%