I’ve been trying to build a package using BinaryBuilder. My package has a binary dependency that can be built with CMake. I need CMake version 3.18 because it has some CUDA definitions, but the CMake binary that I can use inside BinaryBuilder’s wizard is version 3.17.2. Is there any way to bump the version of CMake inside of the BinaryBuilder wizard, or do I have to modify my CMakelists.txt to make it work with 3.17.2?
For reference, I tried the following two compiler sets:
GCC 4.8.5 & LLVM 12.0.0
GCC 11.1.0 & LLVM 12.0.0
(I doubt that changing these will give different cmake versions but I still had to try…)
Try adding CMake_jll
as a HostBuildDependency
:
HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.28.1"))
From
LibraryProduct("libcholmod_cuda", :libcholmod),
LibraryProduct("libspqr_cuda", :libspqr),
LibraryProduct("libgpuqrengine_cuda", :libgpuqrengine),
LibraryProduct("libsuitesparse_gpuruntime_cuda", :libsuitesparse_gpuruntime),
]
# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("libblastrampoline_jll"; compat="5.8.0"),
BuildDependency("LLVMCompilerRT_jll",platforms=[Platform("x86_64", "linux"; sanitize="memory")]),
HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.24.3"))
]
Otherwise install the package from newer Alpine Linux repos:
apk add --upgrade cmake --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
See for example
# Collection of sources required to complete build
sources = [
ArchiveSource("https://downloads.sourceforge.net/project/gmat/GMAT/GMAT-R2020a/GMAT-src-R2020a.zip", "943f403ac04d958b313b1d99d64fd09e3fa8e4c65363809d5bb88dd8c66e43e4"),
DirectorySource("./bundled"),
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
apk add --upgrade cmake --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
cd GMAT-R2020a/
cp -r $WORKSPACE/srcdir/patches/cmake .
dos2unix plugins/EstimationPlugin/src/base/measurement/Ionosphere/Ionosphere.hpp
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0001-Remove-hard-coded-CSPICE-paths.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0002-Remove-MSVC-flags.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0003-Fix-non-portable-cast.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0004-Use-std-chrono-on-all-platforms.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0005-Use-Linux-typedefs-for-cross-compile.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0006-Use-standard-CMake-boost-module.patch"
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0007-Remove-explicit-Ws2_32-linking.patch"
2 Likes
@giordano Does the CMake_jll
also require
script = raw"""
apk del cmake
...
"""
as in Yggdrasil/S/SuiteSparse/SuiteSparse@7/build_tarballs.j ?
Possibly, yes, because it looks like at the moment packages installed via HostBuildDependency
don’t take precedence over system binaries:
# Default alpine PATH
mapping["PATH"],
# Host tools, installed as `HostBuildDependency`
mapping["host_bindir"],
(system PATH
is before host_bindir
)
1 Like