Skip to content
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

Fix some compilation errors on MacOS due to an old SDK #96

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/julia/build_tarballs_release.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ using BinaryBuilder, Pkg

haskey(ENV, "UNO_RELEASE") || error("The environment variable UNO_RELEASE is not defined.")
haskey(ENV, "UNO_COMMIT") || error("The environment variable UNO_COMMIT is not defined.")
haskey(ENV, "UNO_URL") || error("The environment variable UNO_URL is not defined.")

name = "Uno"
version = VersionNumber(ENV["UNO_RELEASE"])

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/cvanaret/Uno.git", ENV["UNO_COMMIT"]),
ArchiveSource("https://mumps-solver.org/MUMPS_5.7.3.tar.gz", "84a47f7c4231b9efdf4d4f631a2cae2bdd9adeaabc088261d15af040143ed112")
GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]),
ArchiveSource("https://mumps-solver.org/MUMPS_5.7.3.tar.gz",
"84a47f7c4231b9efdf4d4f631a2cae2bdd9adeaabc088261d15af040143ed112"),
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz",
"2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
]

# Bash recipe for building across all platforms
Expand Down Expand Up @@ -83,6 +87,23 @@ cd $WORKSPACE/srcdir/Uno
mkdir -p build
cd build

if [[ "${target}" == x86_64-apple-darwin* ]]; then
# Work around the issue
# /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14
# Presets::set(options, optional_preset.value());
# ^
# /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here
# constexpr value_type const& value() const&
# ^
export MACOSX_DEPLOYMENT_TARGET=10.15
# ...and install a newer SDK which supports `std::filesystem`
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
fi

if [[ "${target}" == *mingw* ]]; then
LIBHIGHS=${prefix}/lib/libhighs.dll.a
else
Expand Down
21 changes: 20 additions & 1 deletion .github/julia/build_tarballs_yggdrasil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ version = VersionNumber(ENV["UNO_RELEASE"])

# Collection of sources required to complete build
sources = [
GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"])
GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]),
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz",
"2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
]

# The remainder of the file is similar to the content found at the following link:
Expand All @@ -21,6 +23,23 @@ cd $WORKSPACE/srcdir/Uno
mkdir -p build
cd build
if [[ "${target}" == x86_64-apple-darwin* ]]; then
# Work around the issue
# /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14
# Presets::set(options, optional_preset.value());
# ^
# /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here
# constexpr value_type const& value() const&
# ^
export MACOSX_DEPLOYMENT_TARGET=10.15
# ...and install a newer SDK which supports `std::filesystem`
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
fi
if [[ "${target}" == *mingw* ]]; then
LBT=blastrampoline-5
LIBHIGHS=${prefix}/lib/libhighs.dll.a
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
echo "UNO_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
echo "UNO_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
echo "UNO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
- name: Cross-compilation of Uno -- x86_64-linux-gnu-cxx11
run: |
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
Expand Down