-
Notifications
You must be signed in to change notification settings - Fork 558
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
Wizard recipe: MAiNGO-v0.7.2 #7812
Wizard recipe: MAiNGO-v0.7.2 #7812
Conversation
Add comments explaining why certain platforms are not yet build. Add expansion over cxxstring and libgfortran 4 and 5.
script = raw""" | ||
cd $WORKSPACE/srcdir | ||
cd maingo/ | ||
git remote set-url origin https://git.rwth-aachen.de/avt-svt/public/maingo.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Isn't this already the case?
git remote set-url origin https://git.rwth-aachen.de/avt-svt/public/maingo.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into this problem before, at least in my tests locally the git remote is changed for caching.
See JuliaPackaging/BinaryBuilderBase.jl#355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in our tests, this did not work because of caching. For now we would leave this in.
You need a privileged runner to be able to delete files from the root file system: https://docs.binarybuilder.org/stable/environment_variables/. That's what we use here in CI, which is what eventually matters for actually building the pacakge. |
M/MAiNGO/build_tarballs.jl
Outdated
#FreeBsd builds only with gcc, that platform has not yet been sufficiently tested for inclusion. | ||
platforms = [ | ||
Platform("x86_64", "linux", libgfortran_version=v"4"), | ||
Platform("x86_64", "linux", libgfortran_version=v"5"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No v3
on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We expand only to gfortan 4 and 5 (3 seems not to have std::variant)
Apply directly useable suggestions. Co-authored-by: Mosè Giordano <[email protected]>
Add suggested commands for moving lib and bin targets. Co-authored-by: Mosè Giordano <[email protected]>
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.
@giordano maybe you could take another look. Using GCC the build is successful for MacOS, but FreeBSD did not succeed, which would have to be investigated further and fixed upstream. |
if [[ "${target}" == x86_64-apple-darwin* ]]; then | ||
export MACOSX_DEPLOYMENT_TARGET=10.15 | ||
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_gcc.cmake \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not clang? Also, at this point you could avoid the conditional and use gcc everywhere, but I'd prefer to understand what's wrong with clang, that's usually the best choice for macOS.
The error message on x86_64 macOS is (multiple times)
According to pytorch/pytorch#3192 (comment) there may be a missing #include <string> Also C++ docs shows that |
I agree that not including This has been noted and upstream will fix it in the next release. However, I believe this is not the reason the compilation failed, but an outdated SDK version. The first reason is that compilation outside of Binary Builder works with Clang on Linux. Instead, the problem is, as we had seen previously, #7139, that is shared_pointer to array is not yet supported. For now I suggest building for MacOS with GCC, which we have seen before works. |
@giordano Would you still have access to the logs of the failed pipeline of the lastest commit (8c2ce78) that I reference above, even after I add another commit ? |
Patching the offending file with diff --git a/M/MAiNGO/build_tarballs.jl b/M/MAiNGO/build_tarballs.jl
index 3a28c6fd9..3e0e32ba0 100644
--- a/M/MAiNGO/build_tarballs.jl
+++ b/M/MAiNGO/build_tarballs.jl
@@ -7,58 +7,52 @@ version = v"0.7.2"
# Collection of sources required to complete build
sources = [
- GitSource("https://git.rwth-aachen.de/avt-svt/public/maingo.git", "252733413a29dbe5b84a4cdaf53e60e9934f372f"),
+ GitSource("https://git.rwth-aachen.de/avt-svt/public/maingo.git",
+ "252733413a29dbe5b84a4cdaf53e60e9934f372f"),
+ ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz",
+ "2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
+ DirectorySource("./bundled"),
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/maingo/
git remote set-url origin https://git.rwth-aachen.de/avt-svt/public/maingo.git
-mkdir build
-cd build
-git submodule init
-git submodule update -j 1
+git submodule update --init
+atomic_patch -p1 -d dep/libale ../patches/libale-tensor-string.patch
-common_cmake_options="-DCMAKE_BUILD_TYPE=Release \
- -DMAiNGO_build_standalone=True \
- -DMAiNGO_build_shared_c_api=True \
- -DMAiNGO_build_parser=True \
- -DMAiNGO_use_cplex=False \
- -DMAiNGO_use_melon=False"
+common_cmake_options=(
+ -DCMAKE_BUILD_TYPE=Release
+ -DMAiNGO_build_standalone=True
+ -DMAiNGO_build_shared_c_api=True
+ -DMAiNGO_build_parser=True
+ -DMAiNGO_use_cplex=False
+ -DMAiNGO_use_melon=False
+)
-# GCC used because of https://github.com/JuliaPackaging/Yggdrasil/issues/7139
if [[ "${target}" == x86_64-apple-darwin* ]]; then
+ # Install a newer SDK which supports `std::to_string`
+ pushd $WORKSPACE/srcdir/MacOSX10.*.sdk
+ rm -rf /opt/${target}/${target}/sys-root/System
+ cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/."
+ cp -ra System "/opt/${target}/${target}/sys-root/."
+ popd
export MACOSX_DEPLOYMENT_TARGET=10.15
-# cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-# -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_gcc.cmake \
-# ${common_cmake_options} \
-# ..
fi
-#else
- cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
- ${common_cmake_options} \
- ..
-#fi
+cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
+ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
+ "${common_cmake_options[@]}" \
+ -B build
-
-cmake --build . --config Release --parallel ${nproc}
+cmake --build build --config Release --parallel ${nproc}
install -Dvm 755 "MAiNGO${exeext}" "${bindir}/MAiNGO${exeext}"
install -Dvm 755 "MAiNGOcpp${exeext}" "${bindir}/MAiNGOcpp${exeext}"
install -Dvm 755 "libmaingo-c-api.${dlext}" "${libdir}/libmaingo-c-api.${dlext}"
install_license ../LICENSE
"""
-# These are the platforms we will build for by default, unless further
-# platforms are passed in on the command line
-
-
-#Auditor complains about avx1.
-#Without march the Auditor detects avx2
-#but with march="avx2" avx512 is detected, so we build without march
-
platforms = supported_platforms()
#FreeBSD is not supported
filter!(!Sys.isfreebsd, platforms)
diff --git a/M/MAiNGO/bundled/patches/libale-tensor-string.patch b/M/MAiNGO/bundled/patches/libale-tensor-string.patch
new file mode 100644
index 000000000..720792bee
--- /dev/null
+++ b/M/MAiNGO/bundled/patches/libale-tensor-string.patch
@@ -0,0 +1,12 @@
+diff --git a/src/tensor.hpp b/src/tensor.hpp
+index 2cc67d3..baa8577 100644
+--- a/src/tensor.hpp
++++ b/src/tensor.hpp
+@@ -15,6 +15,7 @@
+ #include <array>
+ #include <stdexcept>
+ #include <vector>
++#include <string>
+
+ #include <memory>
+ got me past the
Ok, let's go back to using GCC, but the fact compilation is successful with a more forgiving compiler isn't an argument for good behaviour of the codebase. |
The point is not that the compiler is more forgiving. Indeed, Clang can compile the codebase. But only when C++17 is fully supported on the platform. However, the compiler + XCode combination used for MacOS in BinaryBuilder does not implement the whole set of C++17 standard library features. See "std::shared_ptr and std::weak_ptr with array support" under here (https://en.cppreference.com/w/cpp/compiler_support/17). |
* 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 <[email protected]> * Update M/MAiNGO/build_tarballs.jl Add suggested commands for moving lib and bin targets. Co-authored-by: Mosè Giordano <[email protected]> * 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 <[email protected]> Co-authored-by: Mosè Giordano <[email protected]>
This pull request contains a new build recipe we built using the BinaryBuilder.jl wizard:
@staticfloat please review and merge.
Auditor complains about AVX2
Without setting march the Auditor detects avx2.
However, after using
march="avx2"
, avx512 is detected.Thus, we build without
march
as it is either a false detection or some dependency adapts to themarch
setting.In both cases the selected setting should result in the most compatible binaries.
Why only Windows and Linux ?
MacOS support is held back by the following issue (XCode seems to be too old (?)): #7139
Note that we tried the suggestion in JuliaPackaging/BinaryBuilder.jl#1263 locally under Linux, but we received many errors for
similar to what was described in the issue comments.
FreeBSD was once successfully compiled using
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_/TARGET_TOOLCHAIN%.*}_gcc.cmake
, but MAiNGO is not properly tested on that platform.