aboutsummaryrefslogtreecommitdiff
path: root/math/dsdp
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2018-10-29 05:55:51 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2018-10-29 05:55:51 +0000
commit25457eaa8adb6a188f6bd30046558cdaad80a0ae (patch)
tree5c04cb5285c883956e27f995698c4065b580b6f5 /math/dsdp
parentc07032e2a4223e9a5380fd764416003adb369019 (diff)
downloadports-25457eaa8adb6a188f6bd30046558cdaad80a0ae.tar.gz
ports-25457eaa8adb6a188f6bd30046558cdaad80a0ae.zip
New port: math/dsdp: Implementation of interior-point method for semidefinite programming
Notes
Notes: svn path=/head/; revision=483369
Diffstat (limited to 'math/dsdp')
-rw-r--r--math/dsdp/Makefile47
-rw-r--r--math/dsdp/distinfo3
-rw-r--r--math/dsdp/files/patch-Makefile14
-rw-r--r--math/dsdp/files/patch-examples_Makefile67
-rw-r--r--math/dsdp/files/patch-make.include47
-rw-r--r--math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile17
-rw-r--r--math/dsdp/files/patch-src_sys_dsdploginfo.c10
-rw-r--r--math/dsdp/pkg-descr16
8 files changed, 221 insertions, 0 deletions
diff --git a/math/dsdp/Makefile b/math/dsdp/Makefile
new file mode 100644
index 000000000000..bee53a3bb684
--- /dev/null
+++ b/math/dsdp/Makefile
@@ -0,0 +1,47 @@
+# $FreeBSD$
+
+PORTNAME= dsdp
+DISTVERSION= 5.8
+CATEGORIES= math
+MASTER_SITES= https://www.mcs.anl.gov/hs/software/${PORTNAME:tu}/
+DISTNAME= ${PORTNAME:tu}${DISTVERSION}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Implementation of interior-point method for semidefinite programming
+
+LICENSE= DSDP_LICENSE
+LICENSE_NAME= DSDP License
+LICENSE_FILE= ${WRKSRC}/dsdp-license
+LICENSE_PERMS= auto-accept dist-mirror dist-sell pkg-mirror pkg-sell # do anything as long as the original copyright notice is retained
+
+LIB_DEPENDS= libblas.so:math/blas \
+ liblapack.so:math/lapack
+
+USES= fortran gmake localbase:ldflags
+USE_LDCONFIG= yes
+
+ALL_TARGET= all oshared all oshared
+
+BINARY_ALIAS= make=${GMAKE} gcc=${CC}
+MAKE_ENV= DSDPROOT=${WRKSRC} SH_LD="${CC} -shared"
+CFLAGS+= -fPIC
+
+PLIST_FILES= bin/dsdp5 \
+ include/dsdp/dsdp5.h \
+ include/dsdp/dsdpbasictypes.h \
+ include/dsdp/dsdplapack.h \
+ include/dsdp/dsdpmem.h \
+ include/dsdp/dsdpsys.h \
+ lib/libdsdp.so
+
+do-build: # the build fails to build all binaries without being called twice due to makefile convolution
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET}
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET}
+
+do-install:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/include/dsdp
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/dsdp5 ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_LIB} ${WRKSRC}/lib/libdsdp.so ${STAGEDIR}${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/dsdp
+
+.include <bsd.port.mk>
diff --git a/math/dsdp/distinfo b/math/dsdp/distinfo
new file mode 100644
index 000000000000..092eea89c51d
--- /dev/null
+++ b/math/dsdp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1540788627
+SHA256 (DSDP5.8.tar.gz) = 26aa624525a636de272c0b329e2dfd01a0d5b7827f1c1c76f393d71e37dead70
+SIZE (DSDP5.8.tar.gz) = 2608518
diff --git a/math/dsdp/files/patch-Makefile b/math/dsdp/files/patch-Makefile
new file mode 100644
index 000000000000..9d1d131f58f7
--- /dev/null
+++ b/math/dsdp/files/patch-Makefile
@@ -0,0 +1,14 @@
+--- Makefile.orig 2005-10-21 19:31:14 UTC
++++ Makefile
+@@ -53,8 +53,8 @@ oshared:
+ -@${RM} tmp; \
+ mkdir tmp; \
+ cd tmp; \
+- echo "building ${DSDPLIBSO}"; \
+- ${AR} x ${DSDPLIB} ;\
+- ${SH_LD} ${DSDPLIBSO} *.o -o ${DSDPLIBSO}; \
++ echo "building ${DSDPLIBSO}"
++ ${AR} x ${DSDPLIB}
++ $(CC) -shared $(LDFLAGS) -llapack -lblas -lm *.o -o ${DSDPLIBSO}; \
+ cd ../ ; \
+ ${RM} tmp
diff --git a/math/dsdp/files/patch-examples_Makefile b/math/dsdp/files/patch-examples_Makefile
new file mode 100644
index 000000000000..5aa14145b38a
--- /dev/null
+++ b/math/dsdp/files/patch-examples_Makefile
@@ -0,0 +1,67 @@
+--- examples/Makefile.orig 2005-10-21 19:31:14 UTC
++++ examples/Makefile
+@@ -7,31 +7,31 @@ include ../make.include
+ EXAMPLE_LIBS = ${DSDPLIB} ${LAPACKBLAS}
+
+ dsdp: exinfo clean
+- ${MEX} -I${DSDPROOT}/include dsdp.c ${DSDPLIB};
+- ${MV} dsdp.mex* ${DSDPMATLABDIR}
++ #${MEX} -I${DSDPROOT}/include dsdp.c ${DSDPLIB};
++ #${MV} dsdp.mex* ${DSDPMATLABDIR}
+
+ dsdpsdpa: exinfo clean readsdpa.o
+- ${CLINKER} readsdpa.o ${EXAMPLE_LIBS} -o dsdp5
++ ${CLINKER} ${LDFLAGS} readsdpa.o ${EXAMPLE_LIBS} -o dsdp5
+ ${MV} dsdp5 ${EXECDIR}
+ ${RM} readsdpa.o
+
+ maxcut: exinfo clean maxcut.o
+- ${CLINKER} -o maxcut maxcut.o ${EXAMPLE_LIBS}
++ ${CLINKER} ${LDFLAGS} -o maxcut maxcut.o ${EXAMPLE_LIBS}
+ ${MV} maxcut ${EXECDIR}
+ ${RM} maxcut.o
+
+ stable: exinfo clean stable.o
+- ${CLINKER} -o stable stable.o ${EXAMPLE_LIBS}
++ ${CLINKER} ${LDFLAGS} -o stable stable.o ${EXAMPLE_LIBS}
+ ${MV} stable ${EXECDIR}
+ ${RM} stable.o
+
+ color: exinfo clean color.o
+- ${CLINKER} -o color color.o ${EXAMPLE_LIBS}
++ ${CLINKER} ${LDFLAGS} -o color color.o ${EXAMPLE_LIBS}
+ ${MV} color ${EXECDIR}
+ ${RM} color.o
+
+ theta: exinfo clean theta.o
+- ${CLINKER} -o theta theta.o ${EXAMPLE_LIBS}
++ ${CLINKER} ${LDFLAGS} -o theta theta.o ${EXAMPLE_LIBS}
+ ${MV} theta ${EXECDIR}
+ ${RM} theta.o
+
+@@ -43,18 +43,18 @@ copysrc:
+
+ # On most Linux/Unix machines
+ dsdpagain: copysrc
+- ${MEX} -DDSDPMATLAB -DDSDP_TIME dsdp.c allc/*.c
+- ${MV} dsdp.mex* ${DSDPMATLABDIR}
+- make clean;
++ #${MEX} -DDSDPMATLAB -DDSDP_TIME dsdp.c allc/*.c
++ #${MV} dsdp.mex* ${DSDPMATLABDIR}
++ #make clean;
+
+ # On a Windows Machine
+ dsdpagain2: copysrc
+- ${MEX} -DDSDPMATLAB -DDSDP_MS_TIME -DNOUNDERBLAS dsdp.c allc/*.c
+- ${MV} dsdp.mex* ${DSDPMATLABDIR}
+- make clean;
++ #${MEX} -DDSDPMATLAB -DDSDP_MS_TIME -DNOUNDERBLAS dsdp.c allc/*.c
++ #${MV} dsdp.mex* ${DSDPMATLABDIR}
++ #make clean;
+
+ sdpaagain: copysrc
+- ${CC} -O3 -DDSDP_TIME readsdpa.c allc/*.c ${LAPACKBLAS} -o dsdp5
++ ${CC} $(CFLAGS) -DDSDP_TIME readsdpa.c allc/*.c ${LAPACKBLAS} -o dsdp5
+ ${MV} dsdp5 ${EXECDIR}
+ make clean;
+
diff --git a/math/dsdp/files/patch-make.include b/math/dsdp/files/patch-make.include
new file mode 100644
index 000000000000..86e14aaac4b5
--- /dev/null
+++ b/math/dsdp/files/patch-make.include
@@ -0,0 +1,47 @@
+--- make.include.orig 2005-10-21 19:31:14 UTC
++++ make.include
+@@ -21,7 +21,7 @@ CC = gcc
+
+ # STEP 3a: Compiler Optimization. You should probably add a -On where
+ # n is the maximum optimization allowed by your C compiler.
+-OPTFLAGS = -O3
++OPTFLAGS =
+ #OPTFLAGS = /O2
+
+ # STEP 3b: Add timing support by uncommenting one of the following lines.
+@@ -43,7 +43,7 @@ DSDPCFLAGS =
+
+
+ # STEP 4. Set Linker and FLAGS: Link the DSDP library to application
+-CFLAGS = ${OPTFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
++CFLAGS += ${OPTFLAGS} -I. -I${DSDPROOT}/include ${DSDPCFLAGS}
+ CLINKER = ${CC} ${OPTFLAGS}
+ #CLINKER = ${CXX} ${OPTFLAGS} -static
+ #CLINKER = link /out:dsdp5.exe
+@@ -55,7 +55,7 @@ CLINKER = ${CC} ${OPTFLAGS}
+ # Not needed to compile library or matlab executable
+ # Needed to link DSDP library to the driver ( read SDPA files, maxcut example, ...)
+ # Also include the math library and other libraries needed to link the BLAS to the C files that call them.
+-LAPACKBLAS = -llapack -lblas -lg2c -lm
++LAPACKBLAS = -llapack -lblas -lm
+ #LAPACKBLAS = -L/usr/lib/ -llapack -lblas -lg2c -lm
+ #LAPACKBLAS = -L/home/benson/ATLAS/Linux_P4SSE2/lib -llapack -lcblas -lf77blas -latlas -lg2c -lm
+ #LAPACKBLAS = -L/sandbox/benson/ATLAS-3.6/lib/Linux_P4SSE2 -llapack -lcblas -lf77blas -latlas -lg2c -lm
+@@ -79,7 +79,7 @@ EXECDIR = ${DSDPROOT}/bin/
+
+ # STEP 7 SET Operating system commands
+ # Other build information, archive, remove, move, copy
+-ARCH = ar cr
++ARCHX = ar cr
+ RANLIB = ranlib
+ #RANLIB = echo
+ RM = rm -f
+@@ -90,7 +90,7 @@ DD = ./
+ PP = ../
+
+ dsdplib: ${DSDPOBJ}
+- ${ARCH} ${DSDPLIB} ${DSDPOBJ}
++ ${ARCHX} ${DSDPLIB} ${DSDPOBJ}
+ ${RANLIB} ${DSDPLIB}
+ make clean
+
diff --git a/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile b/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile
new file mode 100644
index 000000000000..764439e61616
--- /dev/null
+++ b/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile
@@ -0,0 +1,17 @@
+--- pdsdp/ScaLAPACK/Makefile.orig 2018-10-29 04:57:01 UTC
++++ pdsdp/ScaLAPACK/Makefile
+@@ -31,12 +31,12 @@ FLINKER = mpicc
+
+ OBJS = readsdpa.o pdsdpscalapack.o
+ dsdpsdpa: ${OBJS}
+- ${FLINKER} -o pdsdp5 ${OBJS} ${ALLLIBS}
++ ${FLINKER} $(LDFLAGS) -o pdsdp5 ${OBJS} ${ALLLIBS}
+ ${RM} ${OBJS}
+
+ OBJS2 = maxcut.o pdsdpscalapack.o
+ maxcut: ${OBJS2}
+- ${CLINKER} -o pmaxcut ${OBJS2} ${ALLLIBS}
++ ${CLINKER} $(LDFLAGS) -o pmaxcut ${OBJS2} ${ALLLIBS}
+ ${RM} ${OBJS2}
+
+ info2:
diff --git a/math/dsdp/files/patch-src_sys_dsdploginfo.c b/math/dsdp/files/patch-src_sys_dsdploginfo.c
new file mode 100644
index 000000000000..9a399e0d7832
--- /dev/null
+++ b/math/dsdp/files/patch-src_sys_dsdploginfo.c
@@ -0,0 +1,10 @@
+--- src/sys/dsdploginfo.c.orig 2018-10-29 04:54:46 UTC
++++ src/sys/dsdploginfo.c
+@@ -6,7 +6,6 @@
+ #include <stdarg.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
+-#include <malloc.h>
+ #include "dsdpsys.h"
+ #include "dsdpbasictypes.h"
+
diff --git a/math/dsdp/pkg-descr b/math/dsdp/pkg-descr
new file mode 100644
index 000000000000..e1a952204b06
--- /dev/null
+++ b/math/dsdp/pkg-descr
@@ -0,0 +1,16 @@
+The DSDP software 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.
+
+WWW: https://www.mcs.anl.gov/hs/software/DSDP/