diff --git a/DSDP-int-in-bool-context.patch b/DSDP-int-in-bool-context.patch new file mode 100644 index 0000000..ba59d51 --- /dev/null +++ b/DSDP-int-in-bool-context.patch @@ -0,0 +1,20 @@ +--- src/solver/dsdpvec.h.orig 2005-10-21 13:31:14.000000000 -0600 ++++ src/solver/dsdpvec.h 2019-12-09 11:50:57.152412502 -0700 +@@ -27,14 +27,14 @@ typedef struct DSDPVec_C DSDPVec; + #define DSDPVecGetArray(a,b) 0;{ *(b)=((a).val); } + #define DSDPVecRestoreArray(a,b) 0;{ *(b)=0; } + #define DSDPVecGetSize(a,b) 0;{ *(b)=((a).dim); } +-#define DSDPVecAddElement(a,b,c) 0;{ if (c){((a).val[b])+=(c);} } ++#define DSDPVecAddElement(a,b,c) 0;{ if ((c)!=0){((a).val[b])+=(c);} } + #define DSDPVecSetElement(a,b,c) 0;{ {((a).val[b])=(c); } } + #define DSDPVecGetElement(a,b,c) 0;{ *(c)=((a).val[b]); } + #define DSDPVecSetR(a,b) 0;{ {((a).val[(a).dim-1])=(b); } } +-#define DSDPVecAddR(a,b) 0;{ if(b){((a).val[(a).dim-1])+=(b); } } ++#define DSDPVecAddR(a,b) 0;{ if((b)!=0){((a).val[(a).dim-1])+=(b); } } + #define DSDPVecGetR(a,b) 0;{ *(b)=((a).val[(a).dim-1]); } + #define DSDPVecSetC(a,b) 0;{ {((a).val[0])=(b); } } +-#define DSDPVecAddC(a,b) 0;{ if(b){((a).val[0])+=(b); } } ++#define DSDPVecAddC(a,b) 0;{ if((b)!=0){((a).val[0])+=(b); } } + #define DSDPVecGetC(a,b) 0;{ *(b)=((a).val[0]); } + #define DSDPVecCreateWArray(a,b,c) 0;{ (*(a)).val=(b); (*(a)).dim=(c);} + /* diff --git a/DSDP-overflow.patch b/DSDP-overflow.patch index 848ac7e..54debae 100644 --- a/DSDP-overflow.patch +++ b/DSDP-overflow.patch @@ -1,11 +1,27 @@ --- 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[]){ ++++ examples/readsdpa.c 2019-12-09 11:47:34.346905327 -0700 +@@ -87,7 +87,7 @@ int ReadSDPAFile(int argc,char *argv[]){ + double ddobj,ppobj,scl,dpot; + char problemname[100],thisline[100], filename[300],savefile[100]; + char directory[100]="/home/benson/sdpexamples/sdplib/"; +- char outputfile[50]="",suffix[20]=".dat-s", tablename[20]="results-dsdp-5.8"; ++ char outputfile[50]="",suffix[20]=".dat-s", tablename[90]="results-dsdp-5.8"; + char success='s',sformat; + FILE *fp1=0,*fp2=0,*fout; + DSDPData dddd; +@@ -106,12 +106,12 @@ int ReadSDPAFile(int argc,char *argv[]){ + if (strncmp(argv[i],"-benchmark",8)==0){ 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],"-directory",8)==0){strncpy(directory,argv[i+1],90);} ++ if (strncmp(argv[i],"-directory",8)==0){strncpy(directory,argv[i+1],100);} + if (strncmp(argv[i],"-table",4)==0){strncpy(tablename,argv[i+1],90);}; 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],"-save",5)==0){ strncpy(savefile,argv[i+1],40);saveit=1;}; ++ if (strncmp(argv[i],"-save",5)==0){ strncpy(savefile,argv[i+1],100);saveit=1;}; if (strncmp(argv[i],"-dlogsummary",8)==0){printsummary=atoi(argv[i+1]);} +- if (rank==0&&strncmp(argv[i],"-fout",5)==0){ strncpy(outputfile,argv[i+1],45);fileout=1;}; ++ if (rank==0&&strncmp(argv[i],"-fout",5)==0){ strncpy(outputfile,argv[i+1],50);fileout=1;}; + } + + if (runbenchmark || argc>2){ diff --git a/DSDP-type-mismatch.patch b/DSDP-type-mismatch.patch new file mode 100644 index 0000000..4e5492b --- /dev/null +++ b/DSDP-type-mismatch.patch @@ -0,0 +1,39 @@ +Description: Use correct integer type for Fortran prototypes and variables + GNU Fortran's default integer width is 32-bit, the same as GCC, therefore use + int rather than long int when interfacing with Fortran. This was an issue on + 64-bit big-endian systems, since the upper 32 bits of the long would be set, + which would also be lost when truncating to a 32-bit integer. +Author: James Clarke +Bug-Debian: https://bugs.debian.org/857067 +Last-Update: 2017-03-28 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- include/dsdplapack.h.orig ++++ include/dsdplapack.h +@@ -4,11 +4,11 @@ + \file dsdplapack.h + \brief DSDP uses BLAS and LAPACK for many of its operations. + */ +- +-typedef long int ffinteger; + /* +-typedef int ffinteger; ++typedef long int ffinteger; + */ ++typedef int ffinteger; ++ + /* + #define __DSDP_NONAMEMANGLING + #undef __DSDP_NONAMEMANGLING +--- src/vecmat/dtrsm2.c.orig ++++ src/vecmat/dtrsm2.c +@@ -1,7 +1,7 @@ + #include "dsdplapack.h" + +-typedef long int integer; +-typedef long int logical; ++typedef int integer; ++typedef int logical; + + #define max(a,b) ((a) >= (b) ? (a) : (b)) + #define dmax(a,b) (double)max(a,b) diff --git a/DSDP.Makefile b/DSDP.Makefile index 8febb44..7635e6e 100644 --- a/DSDP.Makefile +++ b/DSDP.Makefile @@ -11,11 +11,11 @@ # Forget it! I'm writing my own Makefile. CC = gcc -INCLUDES = -I/usr/include/atlas -Iinclude -Isrc/solver -Isrc/sdp -Isrc/vecmat +INCLUDES = -I/usr/include/flexiblas -Iinclude -Isrc/solver -Isrc/sdp -Isrc/vecmat CFLAGS = @RPM_OPT_FLAGS@ -fPIC -DDSDP_TIME $(INCLUDES) BFLAGS = @RPM_OPT_FLAGS@ -DDSDP_TIME -Iinclude -Lsrc -LDFLAGS = @RPM_LD_FLAGS@ -Wl,--as-needed -L@libdir@/atlas -lsatlas -lm -BDFLAGS = @RPM_LD_FLAGS@ -Wl,--as-needed -ldsdp -L@libdir@/atlas -lsatlas -lm +LDFLAGS = @RPM_LD_FLAGS@ -Wl,--as-needed -lflexiblas -lm +BDFLAGS = @RPM_LD_FLAGS@ -Wl,--as-needed -ldsdp -lflexiblas -lm SONAME = -Wl,-h,libdsdp.so.5 SOLVER_OBJS = src/solver/dualalg.o src/solver/dualimpl.o \ diff --git a/DSDP.spec b/DSDP.spec index 8ea7fb9..12452b4 100644 --- a/DSDP.spec +++ b/DSDP.spec @@ -1,52 +1,67 @@ Name: DSDP Version: 5.8 -Release: 15%{?dist} +Release: 40%{?dist} Summary: Software for semidefinite programming -License: DSDP -URL: http://www.mcs.anl.gov/software/applied-mathematics-software -# Upstream no longer offers a download or supports this software. -Source0: DSDP%{version}.tar.gz +# The content is DSDP. The remaining licenses cover the various fonts embedded +# in PDFs. +# AMS: OFL-1.1-RFN +# CM: Knuth-CTAN +License: DSDP AND OFL-1.1-RFN AND Knuth-CTAN +URL: https://www.mcs.anl.gov/hs/software/DSDP/ +Source0: https://www.mcs.anl.gov/hs/software/DSDP/%{name}%{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 +# Fix a buffer overflow in one of the examples. +Patch: %{name}-overflow.patch +# Fix -Wint-in-bool-context warnings. +Patch: %{name}-int-in-bool-context.patch +# Fix big endian problems (patch courtesy of Debian) +Patch: %{name}-type-mismatch.patch + +# See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} -BuildRequires: atlas-devel BuildRequires: doxygen-latex BuildRequires: gcc -BuildRequires: ghostscript-core +BuildRequires: ghostscript +BuildRequires: make +BuildRequires: pkgconfig(flexiblas) %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. +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 +# The content is DSDP. The remaining licenses cover the various fonts embedded +# in PDFs. +# AMS: OFL-1.1-RFN +# CM: Knuth-CTAN +License: DSDP AND OFL-1.1-RFN AND Knuth-CTAN Summary: Headers and libraries for developing with DSDP Requires: %{name}%{?_isa} = %{version}-%{release} -Provides: bundled(jquery) +Provides: bundled(js-jquery) %description devel Headers and libraries for developing with DSDP. %package examples +License: DSDP Summary: Example programs that use DSDP Requires: %{name}%{?_isa} = %{version}-%{release} @@ -54,18 +69,17 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Examples programs that use the DSDP library. %prep -%setup -q -n %{name}%{version} -%setup -q -n %{name}%{version} -T -D -a 1 -%patch0 +%autosetup -p0 -n %{name}%{version} -a 1 -sed -e "s|@RPM_OPT_FLAGS@|${RPM_OPT_FLAGS}|" \ - -e "s|@RPM_LD_FLAGS@|${RPM_LD_FLAGS}|" \ - -e "s|@libdir@|%{_libdir}|" \ - -e "s|@version@|%{version}|" \ +%conf +sed -e 's|@RPM_OPT_FLAGS@|%{build_cflags}|' \ + -e 's|@RPM_LD_FLAGS@|%{build_ldflags}|' \ + -e 's|@libdir@|%{_libdir}|' \ + -e 's|@version@|%{version}|' \ %{SOURCE2} > Makefile %build -make %{?_smp_mflags} +%make_build cd docs unzip DSDP5-api-html.zip cd dox @@ -97,14 +111,10 @@ 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 docs/DSDP5-Exe-UserGuide.pdf docs/DSDP5-P1289-0905.pdf %license dsdp-license -%{_libdir}/libdsdp.so.* +%{_libdir}/libdsdp.so.5{,.*} %files devel %doc docs/DSDP5-API-UserGuide.pdf docs/dox @@ -113,10 +123,89 @@ done %files examples %doc examples/Contents -%{_bindir}/* -%{_mandir}/man1/* +%{_bindir}/dsdp* +%{_mandir}/man1/dsdp* %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 5.8-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Wed Jul 23 2025 Fedora Release Engineering - 5.8-39 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Jan 16 2025 Fedora Release Engineering - 5.8-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Wed Jul 17 2024 Fedora Release Engineering - 5.8-37 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 5.8-36 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 5.8-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 18 2024 Fedora Release Engineering - 5.8-34 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jul 19 2023 Fedora Release Engineering - 5.8-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jan 18 2023 Fedora Release Engineering - 5.8-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Nov 23 2022 Jerry James - 5.8-31 +- Add SPDX License identifiers for PDF documentation +- Minor spec file cleanups + +* Wed Jul 20 2022 Fedora Release Engineering - 5.8-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jan 19 2022 Fedora Release Engineering - 5.8-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 5.8-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 3 2021 Jerry James - 5.8-28 +- Change ghostscript-core BR to ghostscript + +* Mon Jan 25 2021 Fedora Release Engineering - 5.8-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Aug 07 2020 Iñaki Úcar - 5.8-26 +- https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager + +* Mon Jul 27 2020 Fedora Release Engineering - 5.8-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 5.8-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 27 2020 Jerry James - 5.8-23 +- Add -type-mismatch patch from Debian to fix big endian issues + +* Wed Jul 24 2019 Fedora Release Engineering - 5.8-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 5.8-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Oct 2 2018 Jerry James - 5.8-20 +- Build with openblas instead of atlas (bz 1618936) + +* Thu Jul 12 2018 Fedora Release Engineering - 5.8-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 5.8-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 5.8-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 5.8-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Feb 10 2017 Fedora Release Engineering - 5.8-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/README.md b/README.md new file mode 100644 index 0000000..722dbbe --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# DSDP + +[DSDP](https://www.mcs.anl.gov/hs/software/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.