Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 05:55:52 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r483369 - in head/math: . dsdp dsdp/files
Message-ID:  <201810290555.w9T5tq34075089@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Mon Oct 29 05:55:51 2018
New Revision: 483369
URL: https://svnweb.freebsd.org/changeset/ports/483369

Log:
  New port: math/dsdp: Implementation of interior-point method for semidefinite programming

Added:
  head/math/dsdp/
  head/math/dsdp/Makefile   (contents, props changed)
  head/math/dsdp/distinfo   (contents, props changed)
  head/math/dsdp/files/
  head/math/dsdp/files/patch-Makefile   (contents, props changed)
  head/math/dsdp/files/patch-examples_Makefile   (contents, props changed)
  head/math/dsdp/files/patch-make.include   (contents, props changed)
  head/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile   (contents, props changed)
  head/math/dsdp/files/patch-src_sys_dsdploginfo.c   (contents, props changed)
  head/math/dsdp/pkg-descr   (contents, props changed)
Modified:
  head/math/Makefile

Modified: head/math/Makefile
==============================================================================
--- head/math/Makefile	Mon Oct 29 04:37:45 2018	(r483368)
+++ head/math/Makefile	Mon Oct 29 05:55:51 2018	(r483369)
@@ -180,6 +180,7 @@
     SUBDIR += dieharder
     SUBDIR += djbfft
     SUBDIR += drgeo
+    SUBDIR += dsdp
     SUBDIR += dynare
     SUBDIR += e
     SUBDIR += ecos

Added: head/math/dsdp/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/Makefile	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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>

Added: head/math/dsdp/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/distinfo	Mon Oct 29 05:55:51 2018	(r483369)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1540788627
+SHA256 (DSDP5.8.tar.gz) = 26aa624525a636de272c0b329e2dfd01a0d5b7827f1c1c76f393d71e37dead70
+SIZE (DSDP5.8.tar.gz) = 2608518

Added: head/math/dsdp/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/files/patch-Makefile	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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

Added: head/math/dsdp/files/patch-examples_Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/files/patch-examples_Makefile	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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;
+ 

Added: head/math/dsdp/files/patch-make.include
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/files/patch-make.include	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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
+ 

Added: head/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/files/patch-pdsdp_ScaLAPACK_Makefile	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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:

Added: head/math/dsdp/files/patch-src_sys_dsdploginfo.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/files/patch-src_sys_dsdploginfo.c	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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"
+ 

Added: head/math/dsdp/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/dsdp/pkg-descr	Mon Oct 29 05:55:51 2018	(r483369)
@@ -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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810290555.w9T5tq34075089>