Skip to content

Commit c6395f6

Browse files
committed
fix: windows openmap missing
1 parent 99598cf commit c6395f6

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
MSYS2_PATH_TYPE=inherit
5858
CC=x86_64-w64-mingw32-gcc
5959
CXX=x86_64-w64-mingw32-g++
60-
CFLAGS="-O3 -fopenmp"
61-
LDFLAGS="-fopenmp"
60+
CFLAGS="-O3 -I{project}/src/scloop/utils/linear_algebra_gf2/include"
61+
LDFLAGS="-L{project}/src/scloop/utils/linear_algebra_gf2"
6262
config_settings_windows: >
6363
--global-option=build_ext --global-option=--compiler=mingw32
6464

‎setup.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23

34
from Cython.Build import cythonize
45
from setuptools import Extension, setup
@@ -7,6 +8,14 @@
78
gf2_dir = os.path.join(project_root, "src/scloop/utils/linear_algebra_gf2")
89
gf2toolkit_srcs = os.path.join(gf2_dir, "GF2toolkit/srcs")
910

11+
is_windows = sys.platform.startswith("win")
12+
if is_windows:
13+
openmp_compile = ["-fopenmp"]
14+
openmp_link = ["-fopenmp", "-static"]
15+
else:
16+
openmp_compile = ["-fopenmp"]
17+
openmp_link = ["-fopenmp"]
18+
1019
extensions = [
1120
Extension(
1221
"scloop.data.ripser_lib",
@@ -19,8 +28,8 @@
1928
sources=["./src/scloop/utils/linear_algebra_gf2/m4ri_lib.pyx"],
2029
include_dirs=[os.path.join(gf2_dir, "include")],
2130
extra_objects=[os.path.join(gf2_dir, "libm4ri.a")],
22-
extra_compile_args=["-fopenmp"],
23-
extra_link_args=["-fopenmp"],
31+
extra_compile_args=openmp_compile,
32+
extra_link_args=openmp_link,
2433
),
2534
# Extension(
2635
# "scloop.utils.linear_algebra_gf2.gf2toolkit_lib",

0 commit comments

Comments
 (0)