Skip to content

Commit 0c3db04

Browse files
MAiNGO-githubAron Zinglergiordano
authored andcommitted
Wizard recipe: MAiNGO-v0.7.2 (JuliaPackaging#7812)
* New Recipe: MAiNGO v0.7.2 * Delete unused patch and cleanup build_tarballs.jl. Add comments explaining why certain platforms are not yet build. Add expansion over cxxstring and libgfortran 4 and 5. * Lower preferred_gcc_version to 9 * Apply suggestions from code review Apply directly useable suggestions. Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Update M/MAiNGO/build_tarballs.jl Add suggested commands for moving lib and bin targets. Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Try building for MacOS and FreeBSD * Filter out non-working platforms instead of picking ones that work * Fix CMake options * Fix missing build folder in first CMake command * Fix missing build folder in first CMake command (again) * Fix typo in CMAKE_TARGET_TOOLCHAIN * Remove FreeBSD build. Not supported upstream and fails on trial build with /workspace/srcdir/maingo/build/dep/ipopt/IpoptConfig/include/config.h:17:4: error: #error "No finite/_finite function available" [16:31:28] 17 | #error "No finite/_finite function available" Likely would need deeper investigation and modification of the CMake files, as Ipopt without CMake seems to build. * Fix bash script error * Test Clang for MacOS * Try forcing SDK 10.15 for std::variant * Fix where if statement ends * Revert to using GCC for MacOS --------- Co-authored-by: Aron Zingler <aron.zingler@rwth-aachen.de> Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
1 parent 2915ecb commit 0c3db04

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

M/MAiNGO/build_tarballs.jl

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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

Comments
 (0)