Skip to content

Commit 42ca324

Browse files
committed
Test SCIP_PaPILO
1 parent a9a12f0 commit 42ca324

File tree

3 files changed

+73
-30
lines changed

3 files changed

+73
-30
lines changed

.github/julia/build_tarballs.jl

Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# `julia build_tarballs.jl --help` to see a usage message.
33
using BinaryBuilder, Pkg
44

5-
name = "SCIP"
5+
name = "SCIP_PaPILO"
6+
67
upstream_version = v"9.2.1"
78
version = VersionNumber(upstream_version.major * 100, upstream_version.minor * 100, upstream_version.patch * 100)
89

@@ -12,72 +13,114 @@ sources = [
1213
"https://scipopt.org/download/release/scipoptsuite-$(upstream_version).tgz",
1314
"41b71a57af773403e9a6724f78c37d8396ac4b6b270a9bbf3716d67f1af12edf"
1415
),
16+
ArchiveSource(
17+
"https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.13.sdk.tar.xz",
18+
"a3a077385205039a7c6f9e2c98ecdf2a720b2a819da715e03e0630c75782c1e4"
19+
),
20+
DirectorySource("./bundled/")
1521
]
1622

1723
# Bash recipe for building across all platforms
1824
script = raw"""
19-
# needed for now
20-
# clock_gettime requires linking to librt -lrt with old glibc
21-
# remove when CMake accounts for this
22-
if [[ "${target}" == *86*-linux-gnu ]]; then
23-
export LDFLAGS="-lrt"
24-
elif [[ "${target}" == *-mingw* ]]; then
25-
# this is required to link to bliss on mingw
26-
export LDFLAGS=-L${libdir}
25+
# This requires macOS 10.13
26+
if [[ "${target}" == x86_64-apple-darwin* ]]; then
27+
pushd $WORKSPACE/srcdir/MacOSX10.*.sdk
28+
rm -rf /opt/${target}/${target}/sys-root/System
29+
cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/."
30+
cp -ra System "/opt/${target}/${target}/sys-root/."
31+
export MACOSX_DEPLOYMENT_TARGET=10.13
32+
popd
2733
fi
2834
2935
cd scipoptsuite*
3036
37+
# for soplex threadlocal
38+
export CXXFLAGS="-DTHREADLOCAL=''"
39+
40+
# Enable large file support on mingw
41+
if [[ "${target}" == *-mingw* ]]; then
42+
export CXXFLAGS="-Wa,-mbig-obj"
43+
fi
44+
45+
# Patch to fix linking with gfortran's library on mingw
46+
# https://github.com/JuliaPackaging/Yggdrasil/pull/8224#issuecomment-2034941690
47+
atomic_patch -p0 $WORKSPACE/srcdir/patches/papilo_cmake.patch
48+
3149
mkdir build
3250
cd build/
3351
cmake -DCMAKE_INSTALL_PREFIX=$prefix\
3452
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}\
3553
-DCMAKE_BUILD_TYPE=Release\
36-
-DPAPILO=0\
3754
-DZIMPL=OFF\
38-
-DGCG=0\
3955
-DUG=0\
4056
-DAMPL=0\
57+
-DGCG=0\
4158
-DBOOST=ON\
4259
-DSYM=snauty\
4360
-DTPI=tny\
4461
-DIPOPT_DIR=${prefix} \
4562
-DIPOPT_LIBRARIES=${libdir} \
63+
-DBLISS_INCLUDE_DIR=${includedir} \
64+
-DBLISS_LIBRARY=bliss \
65+
-DBUILD_TESTING=OFF \
4666
..
47-
make -j${nproc}
67+
make -j${nproc} scip
68+
make papilo-executable
69+
4870
make install
71+
cp bin/papilo${exeext} "${bindir}/papilo${exeext}"
4972
50-
mkdir -p ${prefix}/share/licenses/SCIP
51-
for dir in scip soplex; do
52-
cp $WORKSPACE/srcdir/scipoptsuite*/${dir}/LICENSE ${prefix}/share/licenses/SCIP/LICENSE_${dir}
73+
mkdir -p ${prefix}/share/licenses/SCIP_PaPILO
74+
for dir in scip soplex gcg; do
75+
cp $WORKSPACE/srcdir/scipoptsuite*/${dir}/LICENSE ${prefix}/share/licenses/SCIP_PaPILO/LICENSE_${dir}
5376
done
54-
cp $WORKSPACE/srcdir/scipoptsuite*/papilo/COPYING ${prefix}/share/licenses/SCIP/LICENSE_papilo
77+
cp $WORKSPACE/srcdir/scipoptsuite*/papilo/COPYING ${prefix}/share/licenses/SCIP_PaPILO/LICENSE_papilo
5578
"""
5679

5780
# These are the platforms we will build for by default, unless further
5881
# platforms are passed in on the command line
59-
platforms = expand_cxxstring_abis(supported_platforms())
82+
platforms = expand_gfortran_versions(expand_cxxstring_abis(supported_platforms(; experimental=true)))
83+
84+
# Filter out the aarch64 FreeBSD and RISC-V architectures because oneTBB isn't available there yet.
85+
filter!(p -> !(Sys.isfreebsd(p) && arch(p) == "aarch64"), platforms)
86+
filter!(p -> !(Sys.islinux(p) && arch(p) == "riscv64"), platforms)
87+
6088
filter!(platforms) do p
61-
!(Sys.isfreebsd(p) && arch(p) == "aarch64") && !occursin("riscv", arch(p))
89+
libgfortran_version(p) >= v"4"
6290
end
6391

92+
6493
# The products that we will ensure are always built
6594
products = [
95+
ExecutableProduct("papilo", :papilo),
96+
ExecutableProduct("scip", :scip),
6697
LibraryProduct("libscip", :libscip),
67-
ExecutableProduct("scip", :scipexe),
68-
LibraryProduct("libsoplexshared", :libsoplex),
6998
]
7099

71-
# Dependencies that must be installed before this package can be built
72100
dependencies = [
101+
Dependency(PackageSpec(name="bliss_jll", uuid="508c9074-7a14-5c94-9582-3d4bc1871065"), compat="=0.77.0"),
73102
Dependency(PackageSpec(name="boost_jll", uuid="28df3c45-c428-5900-9ff8-a3135698ca75"); compat="=1.79.0"),
74103
Dependency(PackageSpec(name="Bzip2_jll", uuid="6e34b625-4abd-537c-b88f-471c36dfa7a0"); compat="1.0.9"),
75104
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
76-
Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"), v"6.2.1"),
77-
Dependency(PackageSpec(name="Ipopt_jll", uuid="9cc047cb-c261-5740-88fc-0cf96f7bdcc7"); compat="300.1400.1400"),
105+
Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"); compat="6.2.1"),
106+
Dependency(PackageSpec(name="Ipopt_jll", uuid="9cc047cb-c261-5740-88fc-0cf96f7bdcc7"); compat="=300.1400.1400"),
107+
Dependency(PackageSpec(name="OpenBLAS32_jll", uuid="656ef2d0-ae68-5445-9ca0-591084a874a2"); compat="0.3.10"),
108+
Dependency(PackageSpec(name="oneTBB_jll", uuid="1317d2d5-d96f-522e-a858-c73665f53c3e"); compat="2022.0.0"),
78109
Dependency(PackageSpec(name="Readline_jll", uuid="05236dd9-4125-5232-aa7c-9ec0c9b2c25a")),
79110
Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")),
80111
]
81112

82113
# Build the tarballs, and possibly a `build.jl` as well.
83-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"12", julia_compat="1.6")
114+
build_tarballs(
115+
ARGS,
116+
name,
117+
version,
118+
sources,
119+
script,
120+
platforms,
121+
products,
122+
dependencies;
123+
preferred_gcc_version=v"10",
124+
julia_compat="1.6",
125+
clang_use_lld=false,
126+
)

.github/workflows/build_test_windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
2828
julia --color=yes .github/julia/build_tarballs.jl x86_64-w64-mingw32-cxx11 --verbose --deploy=local
29-
file=/home/runner/.julia/dev/SCIP_jll/Artifacts.toml
29+
file=/home/runner/.julia/dev/SCIP_PaPILO_jll/Artifacts.toml
3030
sha1=$(grep '^git-tree-sha1' "$file" | cut -d '"' -f2)
3131
echo "artifact_path=${sha1}" >> $GITHUB_ENV
3232
echo "SHA1=${sha1}" >> $GITHUB_OUTPUT
@@ -51,13 +51,13 @@ jobs:
5151
path: override
5252
- shell: julia --color=yes --project=. {0}
5353
run: |
54-
import SCIP_jll
55-
sha = last(splitpath(SCIP_jll.artifact_dir))
54+
import SCIP_PaPILO_jll
55+
sha = last(splitpath(SCIP_PaPILO_jll.artifact_dir))
5656
dir = escape_string(joinpath(ENV["GITHUB_WORKSPACE"], "override"))
5757
content = "$sha = \"$(dir)\"\n"
5858
@show content
5959
write(
60-
replace(SCIP_jll.artifact_dir, sha => "Overrides.toml"),
60+
replace(SCIP_PaPILO_jll.artifact_dir, sha => "Overrides.toml"),
6161
content,
6262
)
6363
- uses: julia-actions/julia-runtest@v1

src/init.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ if isfile(depsjl_path)
1111
include(depsjl_path)
1212
else
1313
# Artifact from BinaryBuilder package
14-
using SCIP_jll: libscip
14+
# using SCIP_jll: libscip
1515
# import SCIP_PaPILO_jll
1616
# if SCIP_PaPILO_jll.is_available()
17-
# using SCIP_PaPILO_jll: libscip
17+
using SCIP_PaPILO_jll: libscip
1818
# else
1919
# end
2020
end

0 commit comments

Comments
 (0)