Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sundials 3.1] Build with OpenBLAS support #378

Merged
merged 2 commits into from
Feb 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions S/Sundials/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ patch -p0 < $WORKSPACE/srcdir/patches/Sundials_windows.patch
CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE="${CMAKE_TARGET_TOOLCHAIN}")
CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=Release -DEXAMPLES_ENABLE_C=OFF)
CMAKE_FLAGS+=(-DKLU_ENABLE=ON -DKLU_INCLUDE_DIR="$prefix/include" -DKLU_LIBRARY_DIR="$libdir")
CMAKE_FLAGS+=(-DBLAS_ENABLE=OFF -DLAPACK_ENABLE=OFF)

### Disable BLAS and LAPACK because sundials 3.1 cannot use 64-bit ints with these libraries
#CMAKE_FLAGS+=(-DBLAS_ENABLE=ON -DLAPACK_ENABLE=ON)
#if [[ ${nbits} == 64 ]] && [[ ${target} != aarch64* ]]; then
# patch -p0 < $WORKSPACE/srcdir/patches/Sundials_ilp64.patch
# CMAKE_FLAGS+=(-DBLAS_LIBRARIES="${libdir}/libopenblas64_.${dlext}" -DLAPACK_LIBRARIES="${libdir}/libopenblas64_.${dlext}")
# CMAKE_FLAGS+=(-DBLAS_LIBRARIES="-L${libdir} -lopenblas64_" -DLAPACK_LIBRARIES="-L${libdir} -lopenblas64_")
#else
# CMAKE_FLAGS+=(-DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}" -DLAPACK_LIBRARIES="${libdir}/libopenblas.${dlext}")
# CMAKE_FLAGS+=(-DBLAS_LIBRARIES="-L${libdir} -lopenblas" -DLAPACK_LIBRARIES="-L${libdir} -lopenblas")
#fi

if [[ ${target} != *darwin* ]]; then
# Needed to find libgfortran for OpenBLAS.
export CFLAGS="-Wl,-rpath-link,/opt/${target}/${target}/lib -Wl,-rpath-link,/opt/${target}/${target}/lib64"
fi

mkdir build
cd build
cmake "${CMAKE_FLAGS[@]}" ..
Expand All @@ -43,24 +49,24 @@ fi
platforms = supported_platforms()

products = [
LibraryProduct("libsundials_sunlinsolspfgmr", :libsundials_sunlinsolspfgmr),
LibraryProduct("libsundials_ida", :libsundials_ida),
LibraryProduct("libsundials_arkode", :libsundials_arkode),
LibraryProduct("libsundials_cvode", :libsundials_cvode),
LibraryProduct("libsundials_cvodes", :libsundials_cvodes),
LibraryProduct("libsundials_sunmatrixdense", :libsundials_sunmatrixdense),
LibraryProduct("libsundials_sunlinsolspbcgs", :libsundials_sunlinsolspbcgs),
LibraryProduct("libsundials_ida", :libsundials_ida),
LibraryProduct("libsundials_idas", :libsundials_idas),
LibraryProduct("libsundials_kinsol", :libsundials_kinsol),
LibraryProduct("libsundials_nvecserial", :libsundials_nvecserial),
LibraryProduct("libsundials_sunlinsolband", :libsundials_sunlinsolband),
LibraryProduct("libsundials_sunlinsoldense", :libsundials_sunlinsoldense),
LibraryProduct("libsundials_sunlinsolspgmr", :libsundials_sunlinsolspgmr),
LibraryProduct("libsundials_sunlinsolklu", :libsundials_sunlinsolklu),
LibraryProduct("libsundials_sunlinsolpcg", :libsundials_sunlinsolpcg),
LibraryProduct("libsundials_sunlinsolspbcgs", :libsundials_sunlinsolspbcgs),
LibraryProduct("libsundials_sunlinsolspfgmr", :libsundials_sunlinsolspfgmr),
LibraryProduct("libsundials_sunlinsolspgmr", :libsundials_sunlinsolspgmr),
LibraryProduct("libsundials_sunlinsolsptfqmr", :libsundials_sunlinsolsptfqmr),
LibraryProduct("libsundials_sunlinsolklu", :libsundials_sunlinsolklu),
LibraryProduct("libsundials_sunmatrixsparse", :libsundials_sunmatrixsparse),
LibraryProduct("libsundials_sunlinsolband", :libsundials_sunlinsolband),
LibraryProduct("libsundials_sunmatrixband", :libsundials_sunmatrixband),
LibraryProduct("libsundials_kinsol", :libsundials_kinsol),
LibraryProduct("libsundials_arkode", :libsundials_arkode),
LibraryProduct("libsundials_sunmatrixdense", :libsundials_sunmatrixdense),
LibraryProduct("libsundials_sunmatrixsparse", :libsundials_sunmatrixsparse),
]

dependencies = [
Expand Down