import lpsolve-5.5.2.11-6.el10

i10cf changed/i10cf/lpsolve-5.5.2.11-6.el10
MSVSphere Packaging Team 5 days ago
commit 928c9c9834
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/lp_solve_5.5.2.11_source-repackaged.tar.gz

@ -0,0 +1 @@
ae1c2bc586cffb4aae85fa893fd2fe9146b4e12f SOURCES/lp_solve_5.5.2.11_source-repackaged.tar.gz

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

@ -0,0 +1,46 @@
From 11c6cd491bd192e0e3fef9fd2652297797e0fef1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 8 Jun 2023 16:11:00 +0200
Subject: [PATCH] Link a tool to a shared library
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Build first lpsolve55 (the library), then lp_solve (the tool). It will
save time and space.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lp_solve/ccc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lp_solve/ccc b/lp_solve/ccc
index f86be81..d3aaba8 100644
--- a/lp_solve/ccc
+++ b/lp_solve/ccc
@@ -1,5 +1,5 @@
:
-src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
c=${CC:-cc}
CFLAGS=${CFLAGS:--O3}
@@ -34,11 +34,14 @@ rm "$MYTMP"/isnan.c "$MYTMP"/isnan >/dev/null 2>&1
rmdir "$MYTMP"
def=
+LIBS=
if [ "$PLATFORM" = "SCO_UNIX" ]
then CFLAGS="${CFLAGS} -O0"
def='-dy -K PIC -DLLONG=long'
dl=-ldl
else dl=-ldl
+ LIBS="-L../lpsolve55/bin/$PLATFORM -llpsolve55"
+ src=''
fi
-$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $LDFLAGS -o bin/$PLATFORM/lp_solve $math $dl
+$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src lp_solve.c $LDFLAGS -o bin/$PLATFORM/lp_solve $math $dl $LIBS
--
2.40.1

@ -0,0 +1,92 @@
From a826560622624aefbe1df965a4887c35051de9d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 27 Jun 2023 14:58:25 +0200
Subject: [PATCH 2/2] Port lp_MDO to colamd-3.0.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The port was done intentionally without modifying the COLAMD sources.
That should ease any future rebases, or building against
a system-provided COLAMD library.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lp_MDO.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/lp_MDO.c b/lp_MDO.c
index 1217229..a617cf0 100644
--- a/lp_MDO.c
+++ b/lp_MDO.c
@@ -18,6 +18,7 @@
----------------------------------------------------------------------------------
*/
+#include <limits.h> /* for INT_MAX */
#include <string.h>
#include "commonlib.h"
#include "lp_lib.h"
@@ -28,6 +29,18 @@
# include "lp_fortify.h"
#endif
+/* COLAMD has explicit 32-bit and 64-bit interfaces. To keep polymorphic int
+ * type in this code, alias the functions here. */
+#if INT_MAX == (1<<31) - 1
+ /* Use default names. */
+#elif INT_MAX == (1<<63) - 1
+# define colamd colamd_l
+# define colamd_recommended colamd_l_recommended
+# define symamd symamd_l
+#else
+# error "Only 32-bit and 64-bit int types are supported"
+#endif
+
STATIC MYBOOL includeMDO(MYBOOL *usedpos, int item)
{
/* Legend: TRUE => A basic slack variable already in the basis
@@ -160,7 +173,8 @@ int __WINAPI getMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL
int nrows = lp->rows+1, ncols = colorder[0];
int i, j, kk, n;
int *col_end, *row_map = NULL;
- int Bnz, Blen, *Brows = NULL;
+ int Bnz, *Brows = NULL;
+ size_t Blen;
int stats[COLAMD_STATS];
double knobs[COLAMD_KNOBS];
@@ -187,7 +201,12 @@ int __WINAPI getMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL
/* Store row indeces of non-zero values in the basic columns */
Blen = colamd_recommended(Bnz, nrows, ncols);
- allocINT(lp, &Brows, Blen, FALSE);
+ if (Blen == 0 || Blen > INT_MAX) {
+ error = TRUE;
+ stats[COLAMD_STATUS] = COLAMD_ERROR_out_of_memory;
+ goto Transfer;
+ }
+ allocINT(lp, &Brows, (int)Blen, FALSE);
prepareMDO(lp, usedpos, colorder, Brows, row_map);
#ifdef Paranoia
verifyMDO(lp, col_end, Brows, nrows, ncols);
@@ -203,14 +222,14 @@ int __WINAPI getMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL
error = !symamd(nrows, colorder, col_end, Brows, knobs, stats, mdo_calloc, mdo_free);
}
else
- error = !colamd(nrows, ncols, Blen, Brows, col_end, knobs, stats);
+ error = !colamd(nrows, ncols, (int)Blen, Brows, col_end, knobs, stats);
#else
if(symmetric && (nrows == ncols)) {
MEMCOPY(colorder, Brows, ncols + 1);
error = !symamd(nrows, colorder, col_end, Brows, knobs, stats, mdo_calloc, mdo_free);
}
else
- error = !colamd(nrows, ncols, Blen, Brows, col_end, (double *) NULL, stats);
+ error = !colamd(nrows, ncols, (int)Blen, Brows, col_end, (double *) NULL, stats);
#endif
/* Transfer the estimated optimal ordering, adjusting for index offsets */
--
2.41.0

@ -0,0 +1,82 @@
From dc262b45ae8c63be64fa38c7db0296e0d3889895 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 7 Jun 2023 17:30:18 +0200
Subject: [PATCH] Port to C99
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Port the ccc build configuration detection tool to C99 by
specifying the return type of main as int.
Submitted upstream:
<https://groups.google.com/g/lp_solve/c/WjVf0dxrwfQ/m/rKMwf57tAwAJ>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
bfp/bfp_LUSOL/ccc | 2 +-
lp_solve/ccc | 4 ++--
lpsolve55/ccc | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/bfp/bfp_LUSOL/ccc b/bfp/bfp_LUSOL/ccc
index 86b274c..a349345 100644
--- a/bfp/bfp_LUSOL/ccc
+++ b/bfp/bfp_LUSOL/ccc
@@ -7,7 +7,7 @@ c=${CC:-cc}
>/tmp/platform.c
echo '#include <stdlib.h>'>>/tmp/platform.c
echo '#include <stdio.h>'>>/tmp/platform.c
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
$c $CFLAGS /tmp/platform.c $LDFLAGS -o /tmp/platform
PLATFORM=`/tmp/platform`
rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
diff --git a/lp_solve/ccc b/lp_solve/ccc
index 83f21df..2e99f39 100644
--- a/lp_solve/ccc
+++ b/lp_solve/ccc
@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
>"$MYTMP"/platform.c
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
PLATFORM=`"$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
@@ -22,7 +22,7 @@ math=-lm
echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
echo '#include <math.h>'>>"$MYTMP"/isnan.c
-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
+echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
if [ $? = 0 ]
then NOISNAN=
diff --git a/lpsolve55/ccc b/lpsolve55/ccc
index 49cd7dc..59c720f 100644
--- a/lpsolve55/ccc
+++ b/lpsolve55/ccc
@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
>"$MYTMP"/platform.c
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
PLATFORM=`"$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
@@ -20,7 +20,7 @@ mkdir bin bin/$PLATFORM >/dev/null 2>&1
echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
echo '#include <math.h>'>>"$MYTMP"/isnan.c
-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
+echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
if [ $? = 0 ]
then NOISNAN=
--
2.40.1

File diff suppressed because it is too large Load Diff

@ -0,0 +1,193 @@
From f29ae58ddc93d86504c7e646ec5e73befb36594c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 7 Jun 2023 17:16:50 +0200
Subject: [PATCH] Respect CC, CFLAGS, and LDFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The distributions use these environment variables to compile their
software uniformly. This patch modifies the ccc scripts to respect
them.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
bfp/bfp_LUSOL/ccc | 20 +++++++++-----------
demo/ccc | 7 +++----
lp_solve/ccc | 13 ++++++-------
lpsolve55/ccc | 14 ++++++--------
4 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/bfp/bfp_LUSOL/ccc b/bfp/bfp_LUSOL/ccc
index 754738b..3ec9596 100644
--- a/bfp/bfp_LUSOL/ccc
+++ b/bfp/bfp_LUSOL/ccc
@@ -1,37 +1,35 @@
:
src='../../shared/commonlib.c ../../colamd/colamd.c lp_LUSOL.c ../../lp_utils.c ../../shared/myblas.c LUSOL/lusol.c'
-c=cc
+c=${CC:-cc}
+CFLAGS=${CFLAGS:--O3}
#determine platform (32/64 bit)
>/tmp/platform.c
echo '#include <stdlib.h>'>>/tmp/platform.c
echo '#include <stdio.h>'>>/tmp/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
-$c /tmp/platform.c -o /tmp/platform
+$c $CFLAGS /tmp/platform.c $LDFLAGS -o /tmp/platform
PLATFORM=`/tmp/platform`
rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
mkdir bin bin/$PLATFORM >/dev/null 2>&1
-opts='-O3'
-#opts=''
-
if [ "$PLATFORM" = "RS6000" ]
-then opts="$opts"
+then
so="-bM:SRE -bE:../bfp_lpsolve.exp"
#so="$so -e _nostart"
so="$so -bnoentry"
elif [ "$PLATFORM" = "SCO_UNIX" ]
then
- opts='-O0'
so="-G -dy"
- opts="$opts -DNOLONGLONG $so"
-else opts="$opts -fpic"
+ CFLAGS="${CFLAGS} -O0 -DNOLONGLONG $so"
+else
+ CFLAGS="${CFLAGS} -fpic"
so="-shared -Wl,-Bsymbolic -Wl,-soname,libbfp_LUSOL.so"
fi
-$c -s -c $opts -I.. -I../.. -I../../colamd -I../../shared -ILUSOL -I. -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL $src
-$c $so -o bin/$PLATFORM/libbfp_LUSOL.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
+$c $CFLAGS -c -I.. -I../.. -I../../colamd -I../../shared -ILUSOL -I. -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL $src
+$c $LDFLAGS $so -o bin/$PLATFORM/libbfp_LUSOL.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
rm *.o >/dev/null
diff --git a/demo/ccc b/demo/ccc
index 38713a1..154b898 100644
--- a/demo/ccc
+++ b/demo/ccc
@@ -1,5 +1,6 @@
src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-c=cc
+c=${CC:-cc}
+CFLAGS=${CFLAGS:--O3}
math=-lm
@@ -10,6 +11,4 @@ then def='-dy -K PIC -DNOLONGLONG'
else dl=-ldl
fi
-opts='-O3'
-
-$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c $src -o demo $math $dl
+$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c $src $LDFLAGS -o demo $math $dl
diff --git a/lp_solve/ccc b/lp_solve/ccc
index bd5a938..fbb67d9 100644
--- a/lp_solve/ccc
+++ b/lp_solve/ccc
@@ -1,6 +1,7 @@
:
src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-c=cc
+c=${CC:-cc}
+CFLAGS=${CFLAGS:--O3}
MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
@@ -9,7 +10,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
-$c "$MYTMP"/platform.c -o "$MYTMP"/platform
+$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
PLATFORM=`"$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
@@ -23,23 +24,21 @@ echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
echo '#include <math.h>'>>"$MYTMP"/isnan.c
echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
-$c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1
+$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
if [ $? = 0 ]
then NOISNAN=
else NOISNAN=-DNOISNAN
fi
rm "$MYTMP"/isnan.c "$MYTMP"/isnan >/dev/null 2>&1
-opts='-O3'
-
rmdir "$MYTMP"
def=
if [ "$PLATFORM" = "SCO_UNIX" ]
-then opts='-O0'
+then CFLAGS="${CFLAGS} -O0"
def='-dy -K PIC -DLLONG=long'
dl=-ldl
else dl=-ldl
fi
-$c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl
+$c $CFLAGS -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $LDFLAGS -o bin/$PLATFORM/lp_solve $math $dl
diff --git a/lpsolve55/ccc b/lpsolve55/ccc
index 999f5f6..49cd7dc 100644
--- a/lpsolve55/ccc
+++ b/lpsolve55/ccc
@@ -1,6 +1,6 @@
:
src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-c=cc
+c=${CC:-cc}
MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
@@ -9,7 +9,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
-$c "$MYTMP"/platform.c -o "$MYTMP"/platform
+$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
PLATFORM=`"$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
@@ -21,7 +21,7 @@ echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
echo '#include <math.h>'>>"$MYTMP"/isnan.c
echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
-$c "$MYTMP"/isnan.c -o "$MYTMP"/isnan $math >/dev/null 2>&1
+$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
if [ $? = 0 ]
then NOISNAN=
else NOISNAN=-DNOISNAN
@@ -39,16 +39,14 @@ else dl=-ldl
so=y
fi
-opts='-O3'
-
-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
+$c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
ranlib bin/$PLATFORM/liblpsolve55.a
if [ "$so" != "" ]
then
- $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
- $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
+ $c $CFLAGS -fPIC -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
+ $c $LDFLAGS -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
fi
rm *.o 2>/dev/null
--
2.40.1

@ -0,0 +1,274 @@
Name: lpsolve
Version: 5.5.2.11
Release: 6%{?dist}
Summary: Mixed Integer Linear Programming (MILP) solver
# bfp/bfp_LUSOL/lp_LUSOL.c: LGPL-2.1-or-later
# lp_crash.c: LGPL-2.1-or-later
# lp_lib.c: LGPL-2.1-or-later
# lp_lib.h: LGPL-2.1-or-later
# lp_matrix.c: LGPL-2.1-or-later
# lp_MDO.c: LGPL-2.1-or-later
# lp_mipbb.c: LGPL-2.1-or-later
# lp_presolve.c: LGPL-2.1-or-later
# lp_price.c: LGPL-2.1-or-later
# lp_pricePSE.c: LGPL-2.1-or-later
# lp_report.c: LGPL-2.1-or-later
# lp_rlp.c: GPL-2.0-or-later WITH Bison-exception-2.2
# lp_scale.c: LGPL-2.1-or-later
# lp_simplex.c: LGPL-2.1-or-later
# lp_SOS.c: LGPL-2.1-or-later
# lp_utils.c: LGPL-2.1-or-later
# README.txt: LGPL-2.1-or-later
# lp_solve-5.5.2.11-Rebase-COLAMD-to-3.0.4.patch: BSD-3-clause
## Unused and nonpackaged
# bfp/bfp_LUSOL/LUSOL/hbio.c: xlock-like
# configure: FSFUL
License: LGPL-2.1-or-later AND GPL-2.0-or-later WITH Bison-exception-2.2 AND BSD-3-clause
# There is a mailing list at <https://groups.google.com/g/lp_solve>.
URL: https://sourceforge.net/projects/lpsolve
# A separate documention at
# <https://downloads.sourceforge.net/lpsolve/lp_solve_%%{version}_doc.tar.gz>
# contains proprietary JavaScript files and javascript trackers.
#
# This is a repackaged source tar ball from
# <https://downloads.sourceforge.net/lpsolve/lp_solve_%%{version}_source.tar.gz>.
# Original archive contained a nonfree COLAMD code (colamd/colamd.{c,h}),
# <https://gitlab.com/fedora/legal/fedora-license-data/-/issues/230>.
# A new upstream COLAMD code with an acceptable code is supplied in
# Rebase-COLAMD-to-3.0.4.patch.
Source: lp_solve_5.5.2.11_source-repackaged.tar.gz
# Use system-wide compiler, compiler and linker flags
Patch0: lp_solve-5.5.2.11-Respect-CC-CFLAGS-and-LDFLAGS.patch
# Port to C99, GCC 14 will remove support for previous standards, proposed to
# an upstream <https://groups.google.com/g/lp_solve/c/WjVf0dxrwfQ/m/rKMwf57tAwAJ>.
Patch1: lp_solve-5.5.2.11-Port-to-C99.patch
# Do not duplicate library code in the the tool
Patch2: lp_solve-5.5.2.11-Link-a-tool-to-a-shared-library.patch
# 1/2 Rebase bundled COLAMD to 3.0.4, proposed to the upstream.
Patch3: lp_solve-5.5.2.11-Rebase-COLAMD-to-3.0.4.patch
# 2/2 Rebase bundled COLAMD to 3.0.4, proposed to the upstream.
Patch4: lp_solve-5.5.2.11-Port-lp_MDO-to-colamd-3.0.4.patch
BuildRequires: bash
# binutils for ar and ranlib
BuildRequires: binutils
BuildRequires: coreutils
BuildRequires: gcc
# Tests:
BuildRequires: grep
Provides: bundled(colamd) = 3.0.4
%description
Mixed Integer Linear Programming (MILP) solver lpsolve solves pure linear,
(mixed) integer/binary, semi-continuous and special ordered sets (SOS) models.
%package devel
License: LGPL-2.1-or-later
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Files for developing with lpsolve
%description devel
Header files for developing with lpsolve library.
%prep
%autosetup -p1 -n lp_solve_5.5
mv colamd/License.txt colamd/colamd_license
chmod -x lp_lib.h
%build
%set_build_flags
pushd lpsolve55
sh -x ccc
rm bin/ux*/liblpsolve55.a
popd
pushd lp_solve
sh -x ccc
popd
%install
install -d %{buildroot}%{_bindir} %{buildroot}%{_libdir} %{buildroot}%{_includedir}/lpsolve
install -p -m 755 \
lp_solve/bin/ux*/lp_solve %{buildroot}%{_bindir}
install -p -m 755 \
lpsolve55/bin/ux*/liblpsolve55.so %{buildroot}%{_libdir}
install -p -m 644 \
lp*.h %{buildroot}%{_includedir}/lpsolve
%check
LP_PATH="$(echo lpsolve55/bin/ux*)"
# Verify lp_solve tool works
echo 'max: x; x < 42;' | \
LD_LIBRARY_PATH="$LP_PATH" ./lp_solve/bin/ux*/lp_solve -S1 | \
grep -e ': 42\.0*$'
# Verify a demo code is buildable
%set_build_flags
${CC} ${CFLAGS} -I. demo/demo.c ${LDFLAGS} -L"$LP_PATH" -llpsolve55
LD_LIBRARY_PATH="$LP_PATH" ./a.out </dev/null
%files
%license colamd/colamd_license
%doc README.txt
%{_bindir}/lp_solve
%{_libdir}/liblpsolve55.so
%files devel
%doc demo/demo.c
%{_includedir}/lpsolve
%changelog
* Sun Dec 22 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 5.5.2.11-6
- Rebuilt for MSVSphere 10
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Aug 01 2023 Petr Pisar <ppisar@redhat.com> - 5.5.2.11-3
- Rebase COLAMD to 3.0.4
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 07 2023 Petr Pisar <ppisar@redhat.com> - 5.5.2.11-1
- 5.5.2.11 bump
- Link lp_solve tool dynamically
* Wed Jun 07 2023 Petr Pisar <ppisar@redhat.com> - 5.5.2.0-33
- Modernize a spec file
- Partially correct a license tag
* Thu Feb 23 2023 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-32
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Nov 25 2022 Florian Weimer <fweimer@redhat.com> - 5.5.2.0-30
- Port the ccc build configuration tool to C99
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Feb 26 2018 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-20
- Related: rhbz#1548689 ... and LDFLAGS
* Mon Feb 26 2018 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-19
- Related: rhbz#1548689 there are two build scripts that need adjusting
* Mon Feb 26 2018 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-18
- Resolves: rhbz#1548689 use fedora compile/link flags
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Feb 15 2016 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-13
- Resolves: rhbz#1307751 FTBFS
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.2.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Tue Jun 17 2014 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-9
- Resolves: rhbz#1109265 lpsolve.i686 missing in x86_64 repo
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Dec 21 2010 Dan Horák <dan[at]danny.cz> - 5.5.2.0-2
- fix build on s390(x)
* Fri Aug 13 2010 Caolán McNamara <caolanm@redhat.com> - 5.5.2.0-1
- latest version
* Mon Dec 21 2009 Caolán McNamara <caolanm@redhat.com> - 5.5.0.15-3
- Preserve timestamps
* Thu Nov 05 2009 Caolán McNamara <caolanm@redhat.com> - 5.5.0.15-2
- upstream source silently changed content
* Sat Sep 12 2009 Caolán McNamara <caolanm@redhat.com> - 5.5.0.15-1
- latest version
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.0.14-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.0.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Feb 23 2009 Caolán McNamara <caolanm@redhat.com> - 5.5.0.14-2
- defuzz patch
* Mon Feb 02 2009 Caolán McNamara <caolanm@redhat.com> - 5.5.0.14-1
- latest version
* Fri Jan 02 2009 Dennis Gilmore <dennis@ausil.us> - 5.5.0.13-2
- use -fPIC on sparc and s390 arches
* Mon Aug 04 2008 Caolán McNamara <caolanm@redhat.com> - 5.5.0.13-1
- latest version
* Sat Aug 02 2008 Caolán McNamara <caolanm@redhat.com> - 5.5.0.12-2
- Mar 20 upstream tarball now differs from Mar 14 tarball
* Fri Mar 14 2008 Caolán McNamara <caolanm@redhat.com> - 5.5.0.12-1
- latest version
* Wed Feb 20 2008 Caolán McNamara <caolanm@redhat.com> - 5.5.0.11-1
- initial version
Loading…
Cancel
Save