diff --git a/conda-forge.yml b/conda-forge.yml index 602c285..2abf2ee 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -3,6 +3,7 @@ build_platform: osx_arm64: osx_64 conda_build: pkg_format: '2' +conda_build_tool: rattler-build conda_forge_output_validation: true github: branch_name: main diff --git a/recipe/bld.bat b/recipe/build-one.bat similarity index 73% rename from recipe/bld.bat rename to recipe/build-one.bat index 4753f33..7b05124 100644 --- a/recipe/bld.bat +++ b/recipe/build-one.bat @@ -1,17 +1,26 @@ setlocal EnableDelayedExpansion +if "%FC%"=="" ( + set HAS_FORTRAN=OFF +) else ( + set HAS_FORTRAN=ON +) + +cd "%SUBPKG_DIR%" +if errorlevel 1 exit 1 + cmake -B build ^ -G "Ninja" ^ - -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr" ^ -DBLA_VENDOR=Generic ^ -DBUILD_SHARED_LIBS=ON ^ -DBUILD_STATIC_LIBS=OFF ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^ - -DSUITESPARSE_HAS_FORTRAN:BOOL=ON ^ + -DSUITESPARSE_HAS_FORTRAN:BOOL="%HAS_FORTRAN%" ^ -DCMAKE_Fortran_COMPILER=flang.exe ^ %CMAKE_ARGS% + if errorlevel 1 exit 1 cmake --build build --verbose @@ -19,3 +28,4 @@ if errorlevel 1 exit 1 cmake --install build --verbose if errorlevel 1 exit 1 + diff --git a/recipe/build.sh b/recipe/build-one.sh similarity index 51% rename from recipe/build.sh rename to recipe/build-one.sh index e2efc5a..5cca486 100755 --- a/recipe/build.sh +++ b/recipe/build-one.sh @@ -1,11 +1,12 @@ #!/bin/bash - +set -eux +# common build script for all subpackages # conda compilers strip links that aren't used by default, # even if explicitly given. # This may result in undefined symbols # when libraries are intended to bundle others they may -# not use themselves (e.g. umfpack bundling cholmod-Wl,-dead_strip_dylibs) +# not use themselves (e.g. umfpack bundling cholmod) export LDFLAGS=${LDFLAGS/-Wl,--as-needed/} export LDFLAGS=${LDFLAGS/-Wl,-dead_strip_dylibs/} @@ -15,12 +16,26 @@ if [[ "${target_platform}" != "${build_platform}" ]]; then export CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_CROSSCOMPILING=ON" fi -# can add lagraph and -DSUITESPARSE_USE_SYSTEM_GRAPHBLAS after packaging 9.1 +if [[ -z "${FC:-}" || ! -f "${FC:-fc_compiler}" ]]; then + echo "Not using fortran" + export CMAKE_ARGS="${CMAKE_ARGS} -DSUITESPARSE_USE_FORTRAN=OFF" +fi + +cd "${SUBPKG_DIR}" + cmake -B build \ - -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr;spex" \ -DBLA_VENDOR="Generic" \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=OFF \ ${CMAKE_ARGS} -cmake --build build --parallel "${CPU_COUNT:-1}" --verbose +cmake --build build --parallel "${CPU_COUNT:-1}" cmake --install build --verbose + +# verify subpackage versions +if [[ "${PKG_NAME}" == lib* ]]; then + if [[ "$target_platform" == osx-* ]]; then + test -f ${PREFIX}/lib/${PKG_NAME}.${PKG_VERSION}${SHLIB_EXT} + else + test -f ${PREFIX}/lib/${PKG_NAME}${SHLIB_EXT}.${PKG_VERSION} + fi +fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml deleted file mode 100644 index d7d7044..0000000 --- a/recipe/meta.yaml +++ /dev/null @@ -1,72 +0,0 @@ -{% set version = "7.8.3" %} - -package: - name: suitesparse - version: {{ version }} - -source: - url: https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v{{ version }}.tar.gz - sha256: ce39b28d4038a09c14f21e02c664401be73c0cb96a9198418d6a98a7db73a259 - -build: - number: 1 - run_exports: - - {{ pin_subpackage("suitesparse") }} - -requirements: - build: - - {{ compiler('c') }} - - {{ stdlib('c') }} - - {{ compiler('cxx') }} - - {{ compiler('fortran') }} - - cmake - - make - - pkg-config - host: - - llvm-openmp # [osx] - - libgomp # [linux] - - libblas - - libcblas - - liblapack - - tbb-devel - - metis - - gmp # [not win] - - mpfr # [not win] - -test: - commands: - # graphblas and mongoose are omitted - - test ! -f ${PREFIX}/bin/mongoose # [not win] - - test ! -f ${PREFIX}/include/GraphBLAS.h # [not win] - - test ! -f ${PREFIX}/include/Mongoose.hpp # [not win] - - test ! -f ${PREFIX}/lib/libgraphblas${SHLIB_EXT} # [not win] - - test ! -f ${PREFIX}/lib/libmongoose${SHLIB_EXT} # [not win] - - test ! -f ${PREFIX}/lib/libgraphblas.a # [not win] - - test ! -f ${PREFIX}/lib/libmongoose.a # [not win] - - - test -f ${PREFIX}/include/suitesparse/amd.h # [not win] - - test -f ${PREFIX}/include/suitesparse/umfpack.h # [not win] - - if not exist %LIBRARY_PREFIX%\include\suitesparse\amd.h exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\include\suitesparse\umfpack.h exit 1 # [win] - - {% for name in ['amd', 'btf', 'camd', 'ccolamd', 'cholmod', 'colamd', 'cxsparse', 'klu', 'ldl', 'rbio', 'spqr', 'suitesparseconfig', 'umfpack'] %} - - test -f ${PREFIX}/lib/lib{{ name }}${SHLIB_EXT} # [not win] - - test ! -f ${PREFIX}/lib/lib{{ name }}.a # [not win] - - if not exist %LIBRARY_PREFIX%\\bin\\{{ name }}.dll exit 1 # [win] - - if not exist %LIBRARY_PREFIX%\\lib\\{{ name }}.lib exit 1 # [win] - {% endfor %} - -about: - home: http://faculty.cse.tamu.edu/davis/suitesparse.html - license: LGPL-2.1-or-later AND BSD-3-Clause AND GPL-2.0-or-later AND Apache-2.0 - license_file: LICENSE.txt - summary: A suite of sparse matrix algorithms - dev_url: https://github.com/DrTimothyAldenDavis/SuiteSparse - -extra: - recipe-maintainers: - - grlee77 - - jakirkham - - basnijholt - - minrk - - jayfurmanek diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml new file mode 100644 index 0000000..56c9ec6 --- /dev/null +++ b/recipe/recipe.yaml @@ -0,0 +1,651 @@ +context: + version: "7.8.3" + +recipe: + name: suitesparse + version: ${{ version }} + +source: + url: https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v${{ version }}.tar.gz + sha256: ce39b28d4038a09c14f21e02c664401be73c0cb96a9198418d6a98a7db73a259 + +build: + number: 2 + string: ss${{ version | replace('.', '') }}_h${{ hash }} + +outputs: + - package: + name: libsuitesparseconfig + about: + license: BSD-3-Clause + license_file: LICENSE.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: SuiteSparse_config + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('fortran') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - libblas + - libcblas + - liblapack + ignore_run_exports: + from_package: + - libblas + - libcblas + - liblapack + - ${{ fortran_compiler }} + run_exports: + - ${{ pin_subpackage('libsuitesparseconfig') }} + tests: + - package_contents: + lib: + - suitesparseconfig + - package: + name: libamd + version: 3.3.3 + about: + license: BSD-3-Clause + license_file: AMD/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: AMD + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('fortran') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libamd') }} + tests: + - package_contents: + lib: + - amd + - package: + name: libbtf + version: 2.3.2 + about: + license: LGPL-2.1-or-later + license_file: BTF/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: BTF + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libbtf') }} + tests: + - package_contents: + lib: + - btf + - package: + name: libcamd + version: 3.3.3 + about: + license: BSD-3-Clause + license_file: CAMD/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: CAMD + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libcamd') }} + tests: + - package_contents: + lib: + - camd + - package: + name: libccolamd + version: 3.3.4 + about: + license: BSD-3-Clause + license_file: CCOLAMD/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: CCOLAMD + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libccolamd') }} + tests: + - package_contents: + lib: + - ccolamd + - package: + name: libcholmod + version: 5.3.0 + about: + license: LGPL-2.1-or-later AND GPL-2.0-or-later AND Apache-2.0 + license_file: + - CHOLMOD/Doc/License.txt + - CHOLMOD/SuiteSparse_metis/LICENSE.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: CHOLMOD + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('cxx') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - libblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libamd', exact=True) }} + - ${{ pin_subpackage('libcamd', exact=True) }} + - ${{ pin_subpackage('libcolamd', exact=True) }} + - ${{ pin_subpackage('libccolamd', exact=True) }} + run_exports: + - ${{ pin_subpackage('libcholmod') }} + tests: + - package_contents: + lib: + - cholmod + - package: + name: libcolamd + version: 3.3.4 + about: + license: BSD-3-Clause + license_file: COLAMD/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: COLAMD + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libcolamd') }} + tests: + - package_contents: + lib: + - colamd + - package: + name: libcxsparse + version: 4.4.1 + about: + license: LGPL-2.1-or-later + license_file: CXSparse/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: CXSparse + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - libblas + - libcblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libcxsparse') }} + tests: + - package_contents: + lib: + - cxsparse + - package: + name: libklu + version: 2.3.5 + about: + license: LGPL-2.1-or-later + license_file: KLU/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: KLU + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - libblas + - libcblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libamd', exact=True) }} + - ${{ pin_subpackage('libbtf', exact=True) }} + - ${{ pin_subpackage('libcamd', exact=True) }} + - ${{ pin_subpackage('libccolamd', exact=True) }} + - ${{ pin_subpackage('libcholmod', exact=True) }} + - ${{ pin_subpackage('libcolamd', exact=True) }} + - metis + run_exports: + - ${{ pin_subpackage('libklu') }} + tests: + - package_contents: + lib: + - klu + - package: + name: libldl + version: 3.3.2 + about: + license: LGPL-2.1-or-later + license_file: LDL/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: LDL + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('libldl') }} + tests: + - package_contents: + lib: + - ldl + - package: + name: libparu + version: 1.0.0 + about: + license: GPL-3.0-or-later + license_file: ParU/LICENSE.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: ParU + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('cxx') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - libblas + - libcblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libumfpack', exact=True) }} + run_exports: + - ${{ pin_subpackage('libparu') }} + tests: + - package_contents: + lib: + - paru + - package: + name: librbio + version: 4.3.4 + about: + license: GPL-2.0-or-later + license_file: RBio/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: RBio + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('librbio') }} + tests: + - package_contents: + lib: + - rbio + - package: + name: libspex + version: 3.2.1 + about: + license_file: SPEX/LICENSE.txt + license: LGPL-2.0-or-later + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: SPEX + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + - if: not win + then: + - gmp + - mpfr + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libamd', exact=True) }} + - ${{ pin_subpackage('libcolamd', exact=True) }} + run_exports: + - ${{ pin_subpackage('libspex') }} + tests: + - package_contents: + lib: + - spex + - package: + name: libspqr + version: 4.3.4 + about: + license: GPL-2.0-or-later + license_file: SPQR/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: SPQR + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('cxx') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - libblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libcholmod', exact=True) }} + run_exports: + - ${{ pin_subpackage('libspqr') }} + tests: + - package_contents: + lib: + - spqr + - package: + name: libumfpack + version: 6.3.5 + about: + license: GPL-2.0-or-later + license_file: UMFPACK/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: UMFPACK + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - libblas + - libcblas + - liblapack + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libcamd', exact=True) }} + - ${{ pin_subpackage('libccolamd', exact=True) }} + - ${{ pin_subpackage('libcolamd', exact=True) }} + - ${{ pin_subpackage('libcholmod', exact=True) }} + run_exports: + - ${{ pin_subpackage('libumfpack') }} + tests: + - package_contents: + lib: + - umfpack + - package: + name: suitesparse-mongoose + version: 3.3.4 + about: + license: GPL-3.0-only + license_file: Mongoose/Doc/License.txt + build: + script: + file: ${{ 'build-one.sh' if not win else 'build-one.bat' }} + env: + SUBPKG_DIR: Mongoose + requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib('c') }} + - ${{ compiler('cxx') }} + - cmake + - if: win + then: + - ninja + else: + - make + - pkg-config + host: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + run_exports: + - ${{ pin_subpackage('suitesparse-mongoose') }} + tests: + - package_contents: + bin: + - suitesparse_mongoose + lib: + - suitesparse_mongoose + - package: + name: suitesparse + requirements: + run: + - ${{ pin_subpackage('libsuitesparseconfig', exact=True) }} + - ${{ pin_subpackage('libamd', exact=True) }} + - ${{ pin_subpackage('libbtf', exact=True) }} + - ${{ pin_subpackage('libcamd', exact=True) }} + - ${{ pin_subpackage('libccolamd', exact=True) }} + - ${{ pin_subpackage('libcolamd', exact=True) }} + - ${{ pin_subpackage('libcholmod', exact=True) }} + - ${{ pin_subpackage('libcxsparse', exact=True) }} + - ${{ pin_subpackage('libldl', exact=True) }} + - ${{ pin_subpackage('libklu', exact=True) }} + - ${{ pin_subpackage('libumfpack', exact=True) }} + - ${{ pin_subpackage('libparu', exact=True) }} + - ${{ pin_subpackage('librbio', exact=True) }} + - ${{ pin_subpackage('libspex', exact=True) }} + - ${{ pin_subpackage('libspqr', exact=True) }} + run_exports: + # export all subpackages which should give over-linking warnings + # most packages shouldn't have a host dependency on suitesparse + # now that packages are split + - ${{ pin_subpackage('libsuitesparseconfig') }} + - ${{ pin_subpackage('libamd') }} + - ${{ pin_subpackage('libbtf') }} + - ${{ pin_subpackage('libcamd') }} + - ${{ pin_subpackage('libccolamd') }} + - ${{ pin_subpackage('libcolamd') }} + - ${{ pin_subpackage('libcholmod') }} + - ${{ pin_subpackage('libcxsparse') }} + - ${{ pin_subpackage('libldl') }} + - ${{ pin_subpackage('libklu') }} + - ${{ pin_subpackage('libumfpack') }} + - ${{ pin_subpackage('libparu') }} + - ${{ pin_subpackage('librbio') }} + - ${{ pin_subpackage('libspex') }} + - ${{ pin_subpackage('libspqr') }} + - ${{ pin_subpackage('suitesparse') }} + tests: + - requirements: + run: + - python * + files: + recipe: + - run_test.py + script: + - python run_test.py + +about: + homepage: http://faculty.cse.tamu.edu/davis/suitesparse.html + license: LGPL-2.1-or-later AND BSD-3-Clause AND GPL-2.0-or-later AND Apache-2.0 + license_file: LICENSE.txt + summary: A suite of sparse matrix algorithms + repository: https://github.com/DrTimothyAldenDavis/SuiteSparse + +extra: + recipe-maintainers: + - grlee77 + - jakirkham + - basnijholt + - minrk + - jayfurmanek