Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cornac
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Batel
cornac
Commits
5ee20fc3
Commit
5ee20fc3
authored
4 years ago
by
tqtg
Browse files
Options
Downloads
Patches
Plain Diff
add environment variables for macos gcc build
parent
54f0fc6e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/python-publish.yml
+1
-1
1 addition, 1 deletion
.github/workflows/python-publish.yml
setup.py
+16
-13
16 additions, 13 deletions
setup.py
with
17 additions
and
14 deletions
.github/workflows/python-publish.yml
+
1
−
1
View file @
5ee20fc3
...
...
@@ -37,7 +37,7 @@ jobs:
-
name
:
Install GCC for MacOS using Homebrew
if
:
matrix.os == 'macos-latest'
run
:
|
brew install gcc libomp
llvm
brew install gcc libomp
brew link gcc
-
name
:
Install dependencies
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
16
−
13
View file @
5ee20fc3
...
...
@@ -16,7 +16,6 @@
import
os
import
sys
import
glob
import
platform
from
setuptools
import
Extension
,
setup
,
find_packages
try
:
...
...
@@ -43,10 +42,12 @@ USE_OPENMP = True
def
extract_gcc_binaries
():
"""
Try to find GCC on OSX for OpenMP support.
"""
patterns
=
[
"
/opt/local/bin/g++-mp-[0-9].[0-9]
"
,
"
/opt/local/bin/g++-mp-[0-9]
"
,
"
/usr/local/bin/g++-[0-9].[0-9]
"
,
"
/usr/local/bin/g++-[0-9]
"
,
]
if
"
darwin
"
in
platform
.
platform
().
lower
(
):
if
sys
.
platform
.
startswith
(
"
darwin
"
):
gcc_binaries
=
[]
for
pattern
in
patterns
:
gcc_binaries
+=
glob
.
glob
(
pattern
)
...
...
@@ -80,20 +81,25 @@ else:
"
-ffast-math
"
,
]
if
"
darwin
"
in
platform
.
platform
().
lower
(
):
if
sys
.
platform
.
startswith
(
"
darwin
"
):
if
gcc
is
not
None
:
os
.
environ
[
"
CC
"
]
=
gcc
os
.
environ
[
"
CXX
"
]
=
gcc
else
:
USE_OPENMP
=
False
print
(
"
No GCC available. Install gcc from Homebrew
"
"
using brew install gcc.
"
os
.
environ
[
"
CPPFLAGS
"
]
=
os
.
environ
[
"
CPPFLAGS
"
]
+
"
-Xpreprocessor -fopenmp
"
os
.
environ
[
"
CFLAGS
"
]
=
os
.
environ
[
"
CFLAGS
"
]
+
"
-I/usr/local/opt/libomp/include
"
os
.
environ
[
"
CXXFLAGS
"
]
=
(
os
.
environ
[
"
CXXFLAGS
"
]
+
"
-I/usr/local/opt/libomp/include
"
)
os
.
environ
[
"
LDFLAGS
"
]
=
(
os
.
environ
[
"
LDFLAGS
"
]
+
"
-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp
"
)
else
:
print
(
"
No GCC available. Install gcc from Homebrew
"
"
using brew install gcc.
"
)
# required arguments for default gcc of OSX
compile_args
.
extend
([
"
-O2
"
,
"
-stdlib=libc++
"
,
"
-mmacosx-version-min=10.7
"
])
link_args
.
extend
([
"
-O2
"
,
"
-stdlib=libc++
"
,
"
-mmacosx-version-min=10.7
"
])
if
USE_OPENMP
:
elif
USE_OPENMP
:
compile_args
.
append
(
"
-fopenmp
"
)
link_args
.
append
(
"
-fopenmp
"
)
...
...
@@ -139,10 +145,7 @@ extensions = [
),
Extension
(
"
cornac.models.hpf.hpf
"
,
sources
=
[
"
cornac/models/hpf/cython/hpf
"
+
ext
,
"
cornac/models/hpf/cpp/cpp_hpf.cpp
"
,
],
sources
=
[
"
cornac/models/hpf/cython/hpf
"
+
ext
,
"
cornac/models/hpf/cpp/cpp_hpf.cpp
"
,],
include_dirs
=
[
"
cornac/models/hpf/cpp/
"
,
"
cornac/utils/external/eigen/Eigen
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment