|
| 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 = "MAiNGO" |
| 6 | +version = v"0.7.2" |
| 7 | + |
| 8 | +# Collection of sources required to complete build |
| 9 | +sources = [ |
| 10 | + GitSource("https://git.rwth-aachen.de/avt-svt/public/maingo.git", "252733413a29dbe5b84a4cdaf53e60e9934f372f"), |
| 11 | +] |
| 12 | + |
| 13 | +# Bash recipe for building across all platforms |
| 14 | +script = raw""" |
| 15 | +cd $WORKSPACE/srcdir/maingo/ |
| 16 | +git remote set-url origin https://git.rwth-aachen.de/avt-svt/public/maingo.git |
| 17 | +mkdir build |
| 18 | +cd build |
| 19 | +git submodule init |
| 20 | +git submodule update -j 1 |
| 21 | +
|
| 22 | +
|
| 23 | +common_cmake_options="-DCMAKE_BUILD_TYPE=Release \ |
| 24 | + -DMAiNGO_build_standalone=True \ |
| 25 | + -DMAiNGO_build_shared_c_api=True \ |
| 26 | + -DMAiNGO_build_parser=True \ |
| 27 | + -DMAiNGO_use_cplex=False \ |
| 28 | + -DMAiNGO_use_melon=False" |
| 29 | +
|
| 30 | +# GCC used because of https://github.com/JuliaPackaging/Yggdrasil/issues/7139 |
| 31 | +if [[ "${target}" == x86_64-apple-darwin* ]]; then |
| 32 | + export MACOSX_DEPLOYMENT_TARGET=10.15 |
| 33 | + cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ |
| 34 | + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_gcc.cmake \ |
| 35 | + ${common_cmake_options} \ |
| 36 | + .. |
| 37 | +else |
| 38 | + cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ |
| 39 | + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ |
| 40 | + ${common_cmake_options} \ |
| 41 | + .. |
| 42 | +fi |
| 43 | +
|
| 44 | +
|
| 45 | +
|
| 46 | +cmake --build . --config Release --parallel ${nproc} |
| 47 | +install -Dvm 755 "MAiNGO${exeext}" "${bindir}/MAiNGO${exeext}" |
| 48 | +install -Dvm 755 "MAiNGOcpp${exeext}" "${bindir}/MAiNGOcpp${exeext}" |
| 49 | +install -Dvm 755 "libmaingo-c-api.${dlext}" "${libdir}/libmaingo-c-api.${dlext}" |
| 50 | +install_license ../LICENSE |
| 51 | +""" |
| 52 | + |
| 53 | +# These are the platforms we will build for by default, unless further |
| 54 | +# platforms are passed in on the command line |
| 55 | + |
| 56 | + |
| 57 | +#Auditor complains about avx1. |
| 58 | +#Without march the Auditor detects avx2 |
| 59 | +#but with march="avx2" avx512 is detected, so we build without march |
| 60 | + |
| 61 | +platforms = supported_platforms() |
| 62 | +#FreeBSD is not supported |
| 63 | +filter!(!Sys.isfreebsd, platforms) |
| 64 | +#only x64 is supported |
| 65 | +filter!(p -> (arch(p) == "x86_64"), platforms) |
| 66 | +platforms = expand_cxxstring_abis(platforms) |
| 67 | +platforms = expand_gfortran_versions(platforms) |
| 68 | +#We filter out gfortan 3 (seem not to have std::variant) |
| 69 | +filter!(p -> !(libgfortran_version(p) == v"3"), platforms) |
| 70 | + |
| 71 | + |
| 72 | +# The products that we will ensure are always built |
| 73 | +products = [ |
| 74 | + LibraryProduct("libmaingo-c-api", :libmaingo_c_api), |
| 75 | + ExecutableProduct("MAiNGOcpp", :MAiNGOcpp), |
| 76 | + ExecutableProduct("MAiNGO", :MAiNGO) |
| 77 | +] |
| 78 | + |
| 79 | +# Dependencies that must be installed before this package can be built |
| 80 | +dependencies = [ |
| 81 | + Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")), |
| 82 | +] |
| 83 | + |
| 84 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 85 | +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version = v"9") |
0 commit comments