-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1258 from mrapp-ke/compile-libomp
Compile libomp from source on macOS
- Loading branch information
Showing
18 changed files
with
260 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
pygithub >= 2.5, < 2.6 | ||
pyyaml >= 6.0, < 6.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
Author: Michael Rapp ([email protected]) | ||
Defines targets and modules for compiling native library dependencies on macOS. This is necessary when building | ||
pre-built packages via "cibuildwheel", because the de facto package manager "homebrew" will install libraries that are | ||
compiled for the specific macOS version the build machine is running, instead of using the proper version for the target | ||
platform (see https://cibuildwheel.pypa.io/en/stable/faq/#missing-dependencies). | ||
""" | ||
from core.build_unit import BuildUnit | ||
from core.targets import PhonyTarget, TargetBuilder | ||
|
||
from targets.dependencies.macos.targets import compile_libomp | ||
|
||
TARGETS = TargetBuilder(BuildUnit.for_file(__file__)) \ | ||
.add_phony_target('dependency_libomp').set_functions(compile_libomp) \ | ||
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Author: Michael Rapp ([email protected]) | ||
Provides classes that allow to run the external program "cmake". | ||
""" | ||
from util.run import Program | ||
|
||
|
||
class Cmake(Program): | ||
""" | ||
Allows to run the external program "cmake". | ||
""" | ||
|
||
def __init__(self, *arguments: str): | ||
""" | ||
:param arguments: Optional arguments to be passed to the program "cmake" | ||
""" | ||
super().__init__('cmake', *arguments) | ||
self.install_program(False) | ||
self.print_arguments(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Author: Michael Rapp ([email protected]) | ||
Provides classes that allow to run the external program "curl". | ||
""" | ||
from typing import Optional | ||
|
||
from util.cmd import Command | ||
from util.run import Program | ||
|
||
|
||
class CurlDownload(Program): | ||
""" | ||
Allows to run the external program "curl" for downloading a file from a specific URL. | ||
""" | ||
|
||
def __init__(self, | ||
url: str, | ||
authorization_header: Optional[str] = None, | ||
file_name: Optional[str] = None, | ||
follow_redirects: bool = True): | ||
""" | ||
:param url: The URL of the file to be downloaded | ||
:param authorization_header: The authorization header to be set or None, if no such header should be set | ||
:param file_name: The name of the file to be saved or None, if the original name should be used | ||
:param follow_redirects: True, if redirects should be followed, False otherwise | ||
""" | ||
super().__init__('curl') | ||
self.add_conditional_arguments(follow_redirects, '--location') | ||
self.add_conditional_arguments(file_name is not None, '-o', file_name) | ||
self.add_conditional_arguments(file_name is None, '-O') | ||
self.add_arguments(url) | ||
self.use_authorization = authorization_header is not None | ||
self.add_conditional_arguments(self.use_authorization, '-H', 'Authorization: ' + str(authorization_header)) | ||
self.install_program(False) | ||
self.print_arguments(not self.use_authorization) | ||
|
||
def __str__(self) -> str: | ||
print_options = Command.PrintOptions() | ||
print_options.print_arguments = not self.use_authorization | ||
return print_options.format(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Author: Michael Rapp ([email protected]) | ||
Provides classes that allow to run the external program "tar". | ||
""" | ||
from util.run import Program | ||
|
||
|
||
class TarExtract(Program): | ||
""" | ||
Allows to run the external program "tar" for extracting a file. | ||
""" | ||
|
||
def __init__(self, file_to_extract: str, into_directory: str): | ||
""" | ||
:param file_to_extract: The path to the file to be extracted | ||
:param into_directory: The path to the directory where the extracted files should be stored | ||
""" | ||
super().__init__('tar', '--extract', '--file', file_to_extract, '--directory', into_directory) | ||
self.install_program(False) | ||
self.print_arguments(True) |
Oops, something went wrong.