|
| 1 | +# Note that this script can accept some limited command-line arguments, run |
| 2 | +# `julia build_tarballs.jl --help` to see a usage message. |
| 3 | +using BinaryBuilder, Pkg |
| 4 | + |
| 5 | +name = "SCIP" |
| 6 | +upstream_version = v"9.2.1" |
| 7 | +version = VersionNumber(upstream_version.major * 100, upstream_version.minor * 100, upstream_version.patch * 100) |
| 8 | + |
| 9 | +# Collection of sources required to complete build |
| 10 | +sources = [ |
| 11 | + ArchiveSource( |
| 12 | + "https://scipopt.org/download/release/scipoptsuite-$(upstream_version).tgz", |
| 13 | + "41b71a57af773403e9a6724f78c37d8396ac4b6b270a9bbf3716d67f1af12edf" |
| 14 | + ), |
| 15 | +] |
| 16 | + |
| 17 | +# Bash recipe for building across all platforms |
| 18 | +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} |
| 27 | +fi |
| 28 | +
|
| 29 | +if [[ "${target}" == *w64* ]]; then |
| 30 | + export CFLAGS="-O0" |
| 31 | +fi |
| 32 | +
|
| 33 | +cd scipoptsuite* |
| 34 | +
|
| 35 | +# for soplex threadlocal |
| 36 | +export CXXFLAGS="-DTHREADLOCAL=''" |
| 37 | +
|
| 38 | +mkdir build |
| 39 | +cd build/ |
| 40 | +cmake -DCMAKE_INSTALL_PREFIX=$prefix\ |
| 41 | + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}\ |
| 42 | + -DCMAKE_BUILD_TYPE=Release\ |
| 43 | + -DPAPILO=0\ |
| 44 | + -DZIMPL=OFF\ |
| 45 | + -DGCG=0\ |
| 46 | + -DUG=0\ |
| 47 | + -DAMPL=0\ |
| 48 | + -DBOOST=ON\ |
| 49 | + -DSYM=snauty\ |
| 50 | + -DTPI=tny\ |
| 51 | + -DIPOPT_DIR=${prefix} \ |
| 52 | + -DIPOPT_LIBRARIES=${libdir} \ |
| 53 | + .. |
| 54 | +make -j${nproc} |
| 55 | +make install |
| 56 | +
|
| 57 | +mkdir -p ${prefix}/share/licenses/SCIP |
| 58 | +for dir in scip soplex; do |
| 59 | + cp $WORKSPACE/srcdir/scipoptsuite*/${dir}/LICENSE ${prefix}/share/licenses/SCIP/LICENSE_${dir} |
| 60 | +done |
| 61 | +cp $WORKSPACE/srcdir/scipoptsuite*/papilo/COPYING ${prefix}/share/licenses/SCIP/LICENSE_papilo |
| 62 | +""" |
| 63 | + |
| 64 | +# These are the platforms we will build for by default, unless further |
| 65 | +# platforms are passed in on the command line |
| 66 | +platforms = expand_cxxstring_abis(supported_platforms()) |
| 67 | +filter!(platforms) do p |
| 68 | + !(Sys.isfreebsd(p) && arch(p) == "aarch64") && !occursin("riscv", arch(p)) |
| 69 | +end |
| 70 | + |
| 71 | +# The products that we will ensure are always built |
| 72 | +products = [ |
| 73 | + LibraryProduct("libscip", :libscip), |
| 74 | + ExecutableProduct("scip", :scipexe), |
| 75 | + LibraryProduct("libsoplexshared", :libsoplex), |
| 76 | +] |
| 77 | + |
| 78 | +# Dependencies that must be installed before this package can be built |
| 79 | +dependencies = [ |
| 80 | + Dependency(PackageSpec(name="boost_jll", uuid="28df3c45-c428-5900-9ff8-a3135698ca75"); compat="=1.79.0"), |
| 81 | + Dependency(PackageSpec(name="Bzip2_jll", uuid="6e34b625-4abd-537c-b88f-471c36dfa7a0"); compat="1.0.9"), |
| 82 | + Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")), |
| 83 | + Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"), v"6.2.1"), |
| 84 | + Dependency(PackageSpec(name="Ipopt_jll", uuid="9cc047cb-c261-5740-88fc-0cf96f7bdcc7"); compat="300.1400.1400"), |
| 85 | + Dependency(PackageSpec(name="Readline_jll", uuid="05236dd9-4125-5232-aa7c-9ec0c9b2c25a")), |
| 86 | + Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")), |
| 87 | +] |
| 88 | + |
| 89 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 90 | +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"6", julia_compat="1.6") |
0 commit comments