Skip to content

Commit

Permalink
split outputs, build with rattler-build
Browse files Browse the repository at this point in the history
use rattler because this is a lot of outputs and it takes forever with conda-build

adds mongoose as an additional component
  • Loading branch information
minrk committed Nov 25, 2024
1 parent b93e974 commit 4690c47
Show file tree
Hide file tree
Showing 5 changed files with 684 additions and 79 deletions.
1 change: 1 addition & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions recipe/bld.bat → recipe/build-one.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
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
if errorlevel 1 exit 1

cmake --install build --verbose
if errorlevel 1 exit 1

25 changes: 20 additions & 5 deletions recipe/build.sh → recipe/build-one.sh
Original file line number Diff line number Diff line change
@@ -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/}

Expand All @@ -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
72 changes: 0 additions & 72 deletions recipe/meta.yaml

This file was deleted.

Loading

0 comments on commit 4690c47

Please sign in to comment.