Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
borisbolliet authored Sep 28, 2024
1 parent 8268bb3 commit d0443f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ def package_files(directory, exclude_dirs):
if b"mvec" not in MVEC_STRING:
liblist += ["mvec", "m"]

# Check the platform to determine the correct OpenMP library
openmp_flag = '-lgomp' if sys.platform.startswith('linux') else '-lomp'


# Define Cython extension
classy_sz_ext = Extension(
"classy_sz",
[os.path.join("class-sz/python", "classy.pyx")],
include_dirs=[np.get_include(), os.path.join("class-sz", "include")],
libraries=liblist,
library_dirs=["class-sz", GCCPATH],
extra_link_args=['-lgomp', '-lgsl', '-lfftw3', '-lgslcblas']
extra_link_args=[openmp_flag, '-lgsl', '-lfftw3', '-lgslcblas']
)

classy_sz_ext.cython_directives = {'language_level': "3" if sys.version_info.major >= 3 else "2"}
Expand Down

0 comments on commit d0443f9

Please sign in to comment.