aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/suitesparse-config
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/suitesparse-config
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/suitesparse-config')
-rw-r--r--vcpkg/ports/suitesparse-config/SuiteSparseBLAS.cmake9
-rw-r--r--vcpkg/ports/suitesparse-config/portfile.cmake52
-rw-r--r--vcpkg/ports/suitesparse-config/vcpkg.json24
3 files changed, 85 insertions, 0 deletions
diff --git a/vcpkg/ports/suitesparse-config/SuiteSparseBLAS.cmake b/vcpkg/ports/suitesparse-config/SuiteSparseBLAS.cmake
new file mode 100644
index 0000000..7cd9522
--- /dev/null
+++ b/vcpkg/ports/suitesparse-config/SuiteSparseBLAS.cmake
@@ -0,0 +1,9 @@
+find_package(BLAS REQUIRED)
+set(BLA_SIZEOF_INTEGER 4)
+set(SuiteSparse_BLAS_integer int32_t)
+
+if(WIN32)
+ # OpenBLAS includes an underscore suffix on Windows for all of its symbols.
+ # This is not detected automatically by SuiteSparse or FindBLAS and needs to be set manually.
+ add_compile_definitions(BLAS64__SUFFIX=_)
+endif()
diff --git a/vcpkg/ports/suitesparse-config/portfile.cmake b/vcpkg/ports/suitesparse-config/portfile.cmake
new file mode 100644
index 0000000..ba9ce58
--- /dev/null
+++ b/vcpkg/ports/suitesparse-config/portfile.cmake
@@ -0,0 +1,52 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO DrTimothyAldenDavis/SuiteSparse
+ REF v7.8.3
+ SHA512 fc0fd0aaf55a6712a3b8ca23bf7536a31d52033e090370ebbf291f05d0e073c7dcfd991a80b037f54663f524804582b87af86522c2e4435091527f0d3c189244
+ HEAD_REF dev
+)
+
+set(PACKAGE_NAME SuiteSparse_config)
+
+# Avoid overriding of BLA_VENDOR and skip straight to find_package() as done here
+# https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v7.8.1/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake#L240-L245
+configure_file(
+ "${CMAKE_CURRENT_LIST_DIR}/SuiteSparseBLAS.cmake"
+ "${SOURCE_PATH}/SuiteSparse_config/cmake_modules/SuiteSparseBLAS.cmake"
+ COPYONLY
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ openmp SUITESPARSE_USE_OPENMP
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/${PACKAGE_NAME}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
+ -DSUITESPARSE_USE_CUDA=OFF # not applicable here, skip check
+ -DSUITESPARSE_USE_STRICT=ON # don't allow implicit dependencies
+ -DSUITESPARSE_USE_FORTRAN=OFF # use Fortran sources translated to C instead
+ -DSUITESPARSE_DEMOS=OFF
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+
+# Move SuiteSparseBLAS.cmake, SuiteSparsePolicy.cmake etc files
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share")
+file(RENAME "${CURRENT_PACKAGES_DIR}/lib/cmake/SuiteSparse" "${CURRENT_PACKAGES_DIR}/share/suitesparse")
+
+vcpkg_cmake_config_fixup(
+ PACKAGE_NAME ${PACKAGE_NAME}
+ CONFIG_PATH lib/cmake/${PACKAGE_NAME}
+)
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/suitesparse-config/vcpkg.json b/vcpkg/ports/suitesparse-config/vcpkg.json
new file mode 100644
index 0000000..908019f
--- /dev/null
+++ b/vcpkg/ports/suitesparse-config/vcpkg.json
@@ -0,0 +1,24 @@
+{
+ "$comment": "Use scripts/update_suitesparse.py to update all SuiteSparse ports",
+ "name": "suitesparse-config",
+ "version-semver": "7.8.3",
+ "description": "Configuration for SuiteSparse libraries",
+ "homepage": "https://people.engr.tamu.edu/davis/suitesparse.html",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ "blas",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "openmp": {
+ "description": "Enable OpenMP support (in SuiteSparse_config only)"
+ }
+ }
+}