Skip to content

Commit

Permalink
openmp link args
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumgizmos committed Nov 26, 2023
1 parent 033533e commit f1e9bab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ project(main
# Set the C++ standard to C++20 for this project
set(CMAKE_CXX_STANDARD 20)

# Enable OpenMP support for parallel programming
SET(CMAKE_CXX_FLAGS "-fopenmp")

# Ensure that the necessary C++11 features are available, as required by the RapidCSV library
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"tqdm",
"pytest"
]
version = "2.0.11"
version = "2.0.12"

[tool.setuptools.packages.find]
where = ["src_python"]
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ def generate_cython_stub_file(pyx_filepath: str, output_filepath: str) -> None:


if sys.platform == "win32":
compile_flags = ["/Ox", "/std:c++20"]
compile_flags = ["/Ox", "/std:c++20",'-fopenmp']
extra_link_args =['-lgomp','-fopenmp'],
else:
compile_flags = ["-std=c++2a", "-O3"]

compile_flags = ["-std=c++2a", "-O3",'-fopenmp']
extra_link_args =['-lgomp','-fopenmp'],

this_directory = Path(__file__).parent

Expand All @@ -124,7 +125,7 @@ def generate_cython_stub_file(pyx_filepath: str, output_filepath: str) -> None:
library_dirs=[],
include_dirs=[np.get_include(),'src_cpp', 'include/robin_map','include/ldpc/src_cpp'],
extra_compile_args=compile_flags,
extra_link_args=[],
extra_link_args=extra_link_args,
language="c++",
)
)
Expand Down

0 comments on commit f1e9bab

Please sign in to comment.