From af3e30dde2ea77c311d9855e65ebb6f73e3eb266 Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Thu, 8 Jun 2023 00:36:42 +0800 Subject: [PATCH] [mathgl] Fix GSL linakge (#31854) * fix link gsl * update version --- ports/mathgl/fix_link_gsl.patch | 37 +++++++++++++++++++++++++++++++++ ports/mathgl/portfile.cmake | 1 + ports/mathgl/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/m-/mathgl.json | 5 +++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 ports/mathgl/fix_link_gsl.patch diff --git a/ports/mathgl/fix_link_gsl.patch b/ports/mathgl/fix_link_gsl.patch new file mode 100644 index 00000000000..7715f808ac2 --- /dev/null +++ b/ports/mathgl/fix_link_gsl.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c931e2..4987f2d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -485,25 +485,13 @@ endif(enable-openmp) + + if(enable-gsl) + set(MGL_HAVE_GSL 1) +- find_library(GSL_LIB gsl) +- find_library(GSL_CBLAS_LIB gslcblas) +- find_path(GSL_INCLUDE_DIR gsl/gsl_fft_complex.h) +- if(NOT GSL_LIB OR NOT GSL_CBLAS_LIB OR NOT GSL_INCLUDE_DIR) +- message(SEND_ERROR "${GSL_LIB}") +- message(SEND_ERROR "${GSL_CBLAS_LIB}") +- message(SEND_ERROR "${GSL_INCLUDE_DIR}") +- message(SEND_ERROR "Couldn't find GSL libraries.") +- else(NOT GSL_LIB OR NOT GSL_CBLAS_LIB OR NOT GSL_INCLUDE_DIR) +- set(CMAKE_REQUIRED_INCLUDES ${GSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${GSL_LIB} ${GSL_CBLAS_LIB}) +- CHECK_CXX_SOURCE_COMPILES("#include +- int main(){gsl_multifit_fdfsolver *s=0;gsl_matrix *J = 0; +- gsl_multifit_fdfsolver_jac(s, J);}" MGL_HAVE_GSL2) +- unset(CMAKE_REQUIRED_INCLUDES) +- unset(CMAKE_REQUIRED_LIBRARIES) +- endif(NOT GSL_LIB OR NOT GSL_CBLAS_LIB OR NOT GSL_INCLUDE_DIR) +- set(MGL_DEP_LIBS ${GSL_LIB} ${GSL_CBLAS_LIB} ${MGL_DEP_LIBS}) +- include_directories(${GSL_INCLUDE_DIR}) ++ find_package(GSL REQUIRED) ++ set(MGL_DEP_LIBS GSL::gsl GSL::gslcblas ${MGL_DEP_LIBS}) ++ set(CMAKE_REQUIRED_LIBRARIES GSL::gsl GSL::gslcblas) ++ CHECK_CXX_SOURCE_COMPILES("#include ++ int main(){gsl_multifit_fdfsolver *s=0;gsl_matrix *J = 0; ++ gsl_multifit_fdfsolver_jac(s, J);}" MGL_HAVE_GSL2) ++ unset(CMAKE_REQUIRED_LIBRARIES) + else(enable-gsl) + set(MGL_HAVE_GSL 0) + endif(enable-gsl) diff --git a/ports/mathgl/portfile.cmake b/ports/mathgl/portfile.cmake index dff022719e6..708e5badae9 100644 --- a/ports/mathgl/portfile.cmake +++ b/ports/mathgl/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_sourceforge( fix-mgllab.patch include_functional.patch fix-include-property.patch + fix_link_gsl.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/addons/getopt") diff --git a/ports/mathgl/vcpkg.json b/ports/mathgl/vcpkg.json index dd59023718b..fc8363383d6 100644 --- a/ports/mathgl/vcpkg.json +++ b/ports/mathgl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "mathgl", "version": "8.0.1", - "port-version": 2, + "port-version": 3, "description": "MathGL is a free library of fast C++ routines for the plotting of the data varied in one or more dimensions", "license": "GPL-3.0-only", "supports": "!uwp", diff --git a/versions/baseline.json b/versions/baseline.json index f1399507cae..b52d1c7de4b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5154,7 +5154,7 @@ }, "mathgl": { "baseline": "8.0.1", - "port-version": 2 + "port-version": 3 }, "matio": { "baseline": "1.5.23", diff --git a/versions/m-/mathgl.json b/versions/m-/mathgl.json index d696bec6456..b82208067f1 100644 --- a/versions/m-/mathgl.json +++ b/versions/m-/mathgl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2c1da85e695d3767410b3acf59567da2faf32ea2", + "version": "8.0.1", + "port-version": 3 + }, { "git-tree": "34ffe72f88b0fa47c8bf8ad235ed3cf109560f65", "version": "8.0.1",