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

Update release.yml #54

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
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
54 changes: 50 additions & 4 deletions .github/julia/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ version = VersionNumber(ENV["UNO_RELEASE"])

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/cvanaret/Uno.git", ENV["UNO_COMMIT"])
GitSource("https://github.com/cvanaret/Uno.git", ENV["UNO_COMMIT"]),
ArchiveSource("https://mumps-solver.org/MUMPS_5.7.3.tar.gz", "84a47f7c4231b9efdf4d4f631a2cae2bdd9adeaabc088261d15af040143ed112")
]

# Bash recipe for building across all platforms
Expand All @@ -31,6 +32,52 @@ chmod -R u=rwx deps
tar -czvf deps.tar.gz deps
rm -r deps

# Compile MUMPS
mkdir -p ${libdir}
cd $WORKSPACE/srcdir/MUMPS*

makefile="Makefile.G95.SEQ"
cp Make.inc/${makefile} Makefile.inc

# Add `-fallow-argument-mismatch` if supported
: >empty.f
FFLAGS=()
if gfortran -c -fallow-argument-mismatch empty.f >/dev/null 2>&1; then
FFLAGS+=("-fallow-argument-mismatch")
fi
rm -f empty.*

if [[ "${target}" == *apple* ]]; then
SONAME="-install_name"
else
SONAME="-soname"
fi

make_args+=(OPTF="-O3"
OPTL="-O3"
OPTC="-O3"
CDEFS=-DAdd_
LMETISDIR=${libdir}
IMETIS=-I${includedir}
LMETIS="-L${libdir} -lmetis"
ORDERINGSF="-Dpord -Dmetis"
LIBEXT_SHARED=".${dlext}"
SHARED_OPT="-shared"
SONAME="${SONAME}"
CC="$CC ${CFLAGS[@]}"
FC="gfortran ${FFLAGS[@]}"
FL="gfortran"
RANLIB="echo"
LIBBLAS="-L${libdir} -lopenblas"
LAPACK="-L${libdir} -lopenblas")

make -j${nproc} dshared "${make_args[@]}"

mkdir ${includedir}/libseq
cp include/*.h ${includedir}
cp libseq/*.h ${includedir}/libseq
cp lib/*.${dlext} ${libdir}

# Compile Uno
cd $WORKSPACE/srcdir/Uno
mkdir -p build
Expand Down Expand Up @@ -71,7 +118,7 @@ install -v -m 755 "uno_ampl${exeext}" -t "${bindir}"
# We just check that we can generate it, but we don't include it in the tarballs.
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -lopenblas -ldmumps -lmetis -lhsl
cp libuno.a ${prefix}/lib/libuno.a
cp libuno.${dlext} "${libdir}/libuno.${dlext}
cp libuno.${dlext} ${libdir}/libuno.${dlext}
"""

# These are the platforms we will build for by default, unless further
Expand All @@ -81,6 +128,7 @@ platforms = expand_gfortran_versions(platforms)

# The products that we will ensure are always built
products = [
LibraryProduct("libdmumps", :libdmumps),
ExecutableProduct("uno_ampl", :amplexe),
LibraryProduct("libuno", :libuno),
FileProduct("lib/libuno.a", :libuno_a),
Expand All @@ -91,8 +139,6 @@ dependencies = [
Dependency(PackageSpec(name="HSL_jll", uuid="017b0a0e-03f4-516a-9b91-836bbd1904dd")),
Dependency(PackageSpec(name="METIS_jll", uuid="d00139f3-1899-568f-a2f0-47f597d42d70")),
Dependency(PackageSpec(name="ASL_jll", uuid="ae81ac8f-d209-56e5-92de-9978fef736f9"), compat="0.1.3"),
# Most recent version compiled with OpenBLAS and not LBT
Dependency(PackageSpec(name="MUMPS_seq_jll", uuid="d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d"), compat="=5.4.1"),
Dependency(PackageSpec(name="OpenBLAS32_jll", uuid="656ef2d0-ae68-5445-9ca0-591084a874a2")),
# For OpenMP we use libomp from `LLVMOpenMP_jll` where we use LLVM as compiler (BSD systems),
# and libgomp from `CompilerSupportLibraries_jll` everywhere else.
Expand Down
2 changes: 1 addition & 1 deletion .github/julia/build_tarballs_yggdrasil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ install -v -m 755 "uno_ampl${exeext}" -t "${bindir}"
# Currently, Uno does not provide a shared library. This may be useful in the future once it has a C API.
# We just check that we can generate it, but we don't include it in the tarballs.
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -l${LBT} -ldmumps -lmetis -lhsl
# cp libuno.${dlext} "${libdir}/libuno.${dlext}
# cp libuno.${dlext} ${libdir}/libuno.${dlext}
"""

platforms = supported_platforms()
Expand Down
12 changes: 3 additions & 9 deletions .github/julia/generate_binaries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ for (platform, libdir, ext) in platforms
# Unzip the tarball of the dependencies
run(`tar -xzf products/$platform/deps.tar.gz -C products/$platform`)

# Copy the license of each dependency
for folder in readdir("products/$platform/deps/licenses")
cp("products/$platform/deps/licenses/$folder", "products/$platform/share/licenses/$folder")
end
rm("products/$platform/deps/licenses", recursive=true)

# Copy the shared library of each dependency
for file in readdir("products/$platform/deps")
cp("products/$platform/deps/$file", "products/$platform/$libdir/$file")
Expand All @@ -69,15 +63,15 @@ for (platform, libdir, ext) in platforms

# Create a folder with the version number of the package
mkdir("$(package)_binaries.$version2")
for folder in ("share", "modules", "lib", "bin")
for folder in ("lib", "bin")
cp(folder, "$(package)_binaries.$version2/$folder")
end

cd("$(package)_binaries.$version2")
if ext == "dll"
run(`zip -r --symlinks ../../../$(package)_binaries.$version2.$platform.zip share modules lib bin`)
run(`zip -r --symlinks ../../../$(package)_binaries.$version2.$platform.zip lib bin`)
else
run(`tar -czf ../../../$(package)_binaries.$version2.$platform.tar.gz share modules lib bin`)
run(`tar -czf ../../../$(package)_binaries.$version2.$platform.tar.gz lib bin`)
end
cd("../../..")

Expand Down