Skip to content

Commit

Permalink
[primecount] Update to v7.2.0 and build for multiple microarchitectures
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Mar 23, 2022
1 parent 086a862 commit 4cddd26
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions P/primecount/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

include(joinpath(@__DIR__, "..", "..", "platforms", "microarchitectures.jl"))

name = "primecount"
version = v"6.5.0"
version = v"7.2.0"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/kimwalisch/primecount.git", "fe433f39fa16eaeab41d7caaef90a9caefa32474"),
GitSource("https://github.com/kimwalisch/primecount.git", "d65b5f1e17fc2689549d3a373c1765298caf78ba"),
DirectorySource("./bundled"),
]

Expand All @@ -16,11 +18,14 @@ script = raw"""
cd $WORKSPACE/srcdir/primecount/
atomic_patch -p1 ../patches/0001-Allow-disabling-building-static-library-for-Windows.patch
mkdir build && cd build
# We disable popcnt in CMake settings, but we expand the microarchitectures to
# let the compiler deal with the appropriate flags.
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DWITH_POPCNT=OFF \
..
make -j${nproc}
make install
Expand All @@ -29,10 +34,17 @@ make install
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

# code contains std::string values, this is needed for GCC 4/5 version boundary compat
# code contains std::string values
platforms = expand_cxxstring_abis(platforms)
platforms = expand_microarchitectures(platforms)

augment_platform_block = """
$(MicroArchitectures.augment)
function augment_platform!(platform::Platform)
augment_microarchitecture!(platform)
end
"""

# The products that we will ensure are always built
products = [
Expand All @@ -43,8 +55,11 @@ products = [

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
# For OpenMP we use libomp from `LLVMOpenMP_jll` where we use LLVM as compiler (BSD
# systems), and libgomp from `CompilerSupportLibraries_jll` everywhere else.
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"); platforms=filter(!Sys.isbsd, platforms)),
Dependency(PackageSpec(name="LLVMOpenMP_jll", uuid="1d63c593-3942-5779-bab2-d838dc0a180e"); platforms=filter(Sys.isbsd, platforms)),
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"5.2.0")
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"5.2.0", julia_compat="1.6", augment_platform_block)

0 comments on commit 4cddd26

Please sign in to comment.