-
Notifications
You must be signed in to change notification settings - Fork 573
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
[SIRIUS] New package SIRIUS v7.6.0 #9315
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Note that this script can accept some limited command-line arguments, run | ||
# `julia build_tarballs.jl --help` to see a usage message. | ||
using BinaryBuilder, Pkg | ||
using Base.BinaryPlatforms | ||
const YGGDRASIL_DIR = "../.." | ||
include(joinpath(YGGDRASIL_DIR, "platforms", "mpi.jl")) | ||
|
||
name = "SIRIUS" | ||
version = v"7.6.0" | ||
|
||
sources = [ | ||
GitSource("https://github.com/electronic-structure/SIRIUS.git", | ||
"21c8fd5019d85ca3181d895e3bc209cb8bba55bb") | ||
] | ||
|
||
|
||
script = raw""" | ||
apk del cmake | ||
|
||
cd $WORKSPACE/srcdir/SIRIUS | ||
|
||
#For GSL to be correctly linked to cblas | ||
export LDFLAGS="-lgsl -lgslcblas -lblastrampoline" | ||
|
||
CMAKE_ARGS="-DSIRIUS_CREATE_FORTRAN_BINDINGS=ON \ | ||
-DSIRIUS_USE_OPENMP=ON \ | ||
-DSIRIUS_USE_PUGIXML=ON \ | ||
-DSIRIUS_USE_MEMORY_POOL=OFF \ | ||
-DSIRIUS_BUILD_APPS=OFF \ | ||
-DSIRIUS_USE_PROFILER=OFF \ | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ | ||
-DCMAKE_FIND_ROOT_PATH='${prefix}/lib/mpich;${prefix}' \ | ||
-DCMAKE_INSTALL_PREFIX=$prefix \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DMPI_C_COMPILER=$bindir/mpicc \ | ||
-DMPI_CXX_COMPILER=$bindir/mpicxx" | ||
|
||
#need to pass various results of CMake's try_run() for MPI compilers for succesful build | ||
CMAKE_ARGS="${CMAKE_ARGS} -DMPI_RUN_RESULT_C_libver_mpi_normal=0 \ | ||
-DMPI_RUN_RESULT_C_libver_mpi_normal__TRYRUN_OUTPUT='' \ | ||
-DMPI_RUN_RESULT_CXX_libver_mpi_normal=0 \ | ||
-DMPI_RUN_RESULT_CXX_libver_mpi_normal__TRYRUN_OUTPUT='' \ | ||
-DMPI_RUN_RESULT_Fortran_libver_mpi_F90_MODULE=0 \ | ||
-DMPI_RUN_RESULT_Fortran_libver_mpi_F90_MODULE__TRYRUN_OUTPUT='' \ | ||
-DMPI_RUN_RESULT_Fortran_libver_mpi_F08_MODULE=0 \ | ||
-DMPI_RUN_RESULT_Fortran_libver_mpi_F08_MODULE__TRYRUN_OUTPUT=''" | ||
|
||
cmake -B build ${CMAKE_ARGS} | ||
|
||
#On MacOS, need to explicitly remove the -fallow-argument-mismatch flag, because not recognized by Clang | ||
if [[ "${target}" == *-apple* ]]; then | ||
cmake -B build "-DMPI_Fortran_COMPILE_OPTIONS=''" | ||
fi | ||
|
||
cmake --build build --parallel ${nproc} | ||
cmake --install build | ||
""" | ||
|
||
augment_platform_block = """ | ||
using Base.BinaryPlatforms | ||
$(MPI.augment) | ||
augment_platform!(platform::Platform) = augment_mpi!(platform) | ||
""" | ||
platforms = [Platform("x86_64", "linux"), Platform("aarch64", "linux"), Platform("aarch64", "macos")] | ||
filter!(p -> !(libc(p) == "musl"), platforms) | ||
platforms = expand_cxxstring_abis(platforms) | ||
|
||
platforms = expand_gfortran_versions(platforms) | ||
filter!(p -> !(libgfortran_version(p) < v"5"), platforms) | ||
|
||
products = [ | ||
LibraryProduct("libsirius", :libsirius) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
Dependency("GSL_jll"; compat="~2.7.2"), | ||
Dependency("pugixml_jll"), | ||
#Using either MKL or OPENBLAS32 | ||
Dependency("libblastrampoline_jll"; compat="5.4.0"), | ||
Dependency("Libxc_jll"), | ||
Dependency("HDF5_jll"), | ||
giordano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Dependency("spglib_jll"), | ||
Dependency("spla_jll"), | ||
Dependency("SpFFT_jll"), | ||
Dependency("COSTA_jll"), | ||
Dependency("CompilerSupportLibraries_jll"), | ||
Dependency("LLVMOpenMP_jll", platforms=filter(Sys.isapple, platforms)), | ||
HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.28.1")) | ||
] | ||
|
||
platforms, platform_dependencies = MPI.augment_platforms(platforms; MPItrampoline_compat="5.2.1", OpenMPI_compat="4.1.6, 5") | ||
# Avoid platforms where the MPI implementation isn't supported | ||
# OpenMPI | ||
platforms = filter(p -> !(p["mpi"] == "openmpi" && arch(p) == "armv6l" && libc(p) == "glibc"), platforms) | ||
# MPItrampoline | ||
platforms = filter(p -> !(p["mpi"] == "mpitrampoline" && (Sys.iswindows(p) || libc(p) == "musl")), platforms) | ||
platforms = filter(p -> !(p["mpi"] == "mpitrampoline" && Sys.isfreebsd(p)), platforms) | ||
|
||
append!(dependencies, platform_dependencies) | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; | ||
augment_platform_block, julia_compat="1.9", preferred_gcc_version = v"10") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should say I'm a bit confused by this comment:
-fallow-argument-mismatch
is a gfortran option and we use gfortran as fortran compiler on all platforms. If this flag is being passed to a C/C++ compiler that looks like a bug of the build system.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed
clang++
that complains with this flag. I had a quick look on the SIRIUS side, and I could not find any explicit mention of the flag. The source of this issue is somewhat hidden