diff --git a/M2/cmake/build-libraries.cmake b/M2/cmake/build-libraries.cmake index e96138cc825..e09ae01a32f 100644 --- a/M2/cmake/build-libraries.cmake +++ b/M2/cmake/build-libraries.cmake @@ -517,13 +517,13 @@ _ADD_COMPONENT_DEPENDENCY(programs msolve "gmp;mpfr;flint" MSOLVE_FOUND) # https://numpi.dm.unipi.it/software/mpsolve # Known issue: tests don't work with static library ExternalProject_Add(build-mpsolve - URL ${M2_SOURCE_URL}/mpsolve-3.2.1.tar.gz - URL_HASH SHA256=3d11428ae9ab2e020f24cabfbcd9e4d9b22ec572cf70af0d44fe8dae1d51e78e + URL https://numpi.dm.unipi.it/wp-content/uploads/2025/03/mpsolve-3.2.2.tgz + URL_HASH SHA256=c951b37ad0bf0761da495544453ac470e6d716a208577599d78ce6f0bfd30317 PREFIX libraries/mpsolve SOURCE_DIR libraries/mpsolve/build DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/BUILD/tarfiles BUILD_IN_SOURCE ON - PATCH_COMMAND patch --batch -p1 < ${CMAKE_SOURCE_DIR}/libraries/mpsolve/patch-3.2.1 + PATCH_COMMAND patch --batch -p1 < ${CMAKE_SOURCE_DIR}/libraries/mpsolve/patch-3.2.2 CONFIGURE_COMMAND autoreconf -vif COMMAND ${CONFIGURE} --prefix=${M2_HOST_PREFIX} #-C --cache-file=${CONFIGURE_CACHE} diff --git a/M2/libraries/mpsolve/Makefile.in b/M2/libraries/mpsolve/Makefile.in index b8604b3816f..90243453bda 100644 --- a/M2/libraries/mpsolve/Makefile.in +++ b/M2/libraries/mpsolve/Makefile.in @@ -1,13 +1,12 @@ VPATH = @srcdir@ HOMEPAGE = https://numpi.dm.unipi.it/software/mpsolve -VERSION = 3.2.1 -URL = https://macaulay2.com/Downloads/OtherSourceCode +VERSION = 3.2.2 +TARFILE = $(LIBNAME)-$(VERSION).tgz +URL = https://numpi.dm.unipi.it/wp-content/uploads/2025/03 # obtained from https://numpi.dm.unipi.it/_media/software/mpsolve # https://numpi.dm.unipi.it/_media/software/mpsolve/mpsolve-3.2.1.tar.gz -# the patch disables the python tests, which don't know that the name of the -# sharable library in Mac OS is libmps.3.dylib instead of libmps.so.3 PATCHFILE = @abs_srcdir@/patch-$(VERSION) LICENSEFILES = README diff --git a/M2/libraries/mpsolve/patch-3.2.2 b/M2/libraries/mpsolve/patch-3.2.2 new file mode 100644 index 00000000000..a6448f749d8 --- /dev/null +++ b/M2/libraries/mpsolve/patch-3.2.2 @@ -0,0 +1,66 @@ +From 260432c9d1002261f60159d0520af7862d4471ed Mon Sep 17 00:00:00 2001 +From: Doug Torrance +Date: Fri, 8 Aug 2025 14:05:58 -0400 +Subject: [PATCH] Include cmath in C++ before defining isnan macro + +Otherwise we get the following compile error in macOS: + + /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:587:17: error: expected unqualified-id + return std::isnan(__lcpp_x); + ^ + ../../include/mps/types.h:27:3: note: expanded from macro 'isnan' + (sizeof(x) == sizeof(long double) ? isnan_ld (x) \ + ^ +--- + include/mps/types.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +From 449d608b360fea0056049d7f8e874ea022fadab5 Mon Sep 17 00:00:00 2001 +From: Doug Torrance +Date: Sat, 9 Aug 2025 09:49:08 -0400 +Subject: [PATCH] Use CPPFLAGS instead of CFLAGS for specifying header + directories + +CPPFLAGS appear before CFLAGS, so if the user passes some directories +manually using CPPFLAGS, they will appear first. This is a problem if +these directories contain older versions of the mpsolve headers. We +want to ensure that the current versions are found first. +--- + src/mpsolve/Makefile.am | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/include/mps/types.h ++++ mpsolve-3.2.2/include/mps/types.h +@@ -21,7 +21,11 @@ typedef bool mps_boolean; + typedef int mps_debug_level; + + /* Handle systems where isnan and isinf are not available */ +-#include ++#ifdef __cplusplus ++ #include ++#else ++ #include ++#endif + #ifndef isnan + # define isnan(x) \ + (sizeof(x) == sizeof(long double) ? isnan_ld (x) \ +--- a/src/mpsolve/Makefile.am ++++ mpsolve-3.2.2/src/mpsolve/Makefile.am +@@ -6,10 +6,12 @@ man_MANS = ${builddir}/mpsolve.1 + + EXTRA_DIST = mpsolve.1 + +-mpsolve_CFLAGS = \ ++mpsolve_CPPFLAGS = \ + -I${top_srcdir}/include \ + -I. \ +- -I${top_builddir}/include \ ++ -I${top_builddir}/include ++ ++mpsolve_CFLAGS = \ + $(GMP_CFLAGS) \ + $(GTK_CFLAGS) \ + $(PTHREAD_CFLAGS) \ +-- +2.43.0 +