Skip to content

Fixes Macos CI issue #5854

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

Merged
merged 1 commit into from
Jun 22, 2021
Merged
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
41 changes: 22 additions & 19 deletions build/libomp.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# typed: false
# frozen_string_literal: true

class Libomp < Formula
desc "LLVM's OpenMP runtime library"
homepage "https://openmp.llvm.org/"
url "https://releases.llvm.org/7.0.0/openmp-7.0.0.src.tar.xz"
sha256 "30662b632f5556c59ee9215c1309f61de50b3ea8e89dcc28ba9a9494bba238ff"

bottle do
cellar :any
sha256 "c8788028105e9ec32e29bcdba8c7b550c2afd96b3f0a7bd0d6b6136a8729174a" => :mojave
sha256 "046f659ad8a2cc336049a1e7f7be0dac2f2e28ce322409f10396f9582b94b660" => :high_sierra
sha256 "ba1b9a78326c671fb864a95d93f2fcf47f3af2ef8f12f6c7ee54a7c0cf7802b4" => :sierra
sha256 "0ea5b6ae3e9e0b32a2b49a7430fb0f653430107164089b067a7b0039e91ce527" => :el_capitan
sha256 cellar: :any, mojave: "c8788028105e9ec32e29bcdba8c7b550c2afd96b3f0a7bd0d6b6136a8729174a"
sha256 cellar: :any, high_sierra: "046f659ad8a2cc336049a1e7f7be0dac2f2e28ce322409f10396f9582b94b660"
sha256 cellar: :any, sierra: "ba1b9a78326c671fb864a95d93f2fcf47f3af2ef8f12f6c7ee54a7c0cf7802b4"
sha256 cellar: :any, el_capitan: "0ea5b6ae3e9e0b32a2b49a7430fb0f653430107164089b067a7b0039e91ce527"
end

depends_on "cmake" => :build
depends_on :macos => :yosemite
depends_on macos: :yosemite

def install
system "cmake", ".", *std_cmake_args
Expand All @@ -22,20 +24,21 @@ def install
system "make", "install"
end

def caveats; <<~EOS
On Apple Clang, you need to add several options to use OpenMP's front end
instead of the standard driver option. This usually looks like
-Xpreprocessor -fopenmp -lomp
def caveats
<<~EOS
On Apple Clang, you need to add several options to use OpenMP's front end
instead of the standard driver option. This usually looks like
-Xpreprocessor -fopenmp -lomp

You might need to make sure the lib and include directories are discoverable
if #{HOMEBREW_PREFIX} is not searched:
You might need to make sure the lib and include directories are discoverable
if #{HOMEBREW_PREFIX} is not searched:

-L#{opt_lib} -I#{opt_include}
-L#{opt_lib} -I#{opt_include}

For CMake, the following flags will cause the OpenMP::OpenMP_CXX target to
be set up correctly:
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I#{opt_include}" -DOpenMP_CXX_LIB_NAMES="omp" -DOpenMP_omp_LIBRARY=#{opt_lib}/libomp.dylib
EOS
For CMake, the following flags will cause the OpenMP::OpenMP_CXX target to
be set up correctly:
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I#{opt_include}" -DOpenMP_CXX_LIB_NAMES="omp" -DOpenMP_omp_LIBRARY=#{opt_lib}/libomp.dylib
EOS
end

test do
Expand All @@ -56,7 +59,7 @@ def caveats; <<~EOS
}
EOS
system ENV.cxx, "-Werror", "-Xpreprocessor", "-fopenmp", "test.cpp",
"-L#{lib}", "-lomp", "-o", "test"
"-L#{lib}", "-lomp", "-o", "test"
system "./test"
end
end
end