Skip to content

Commit e66e5d0

Browse files
committed
fixing Sleef_Quad issue on Mac-Silicon
1 parent 81769dc commit e66e5d0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/build_wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ jobs:
127127
MACOSX_DEPLOYMENT_TARGET="11.0"
128128
DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
129129
CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS"
130-
CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS"
131-
LDFLAGS="-L/usr/local/lib $LDFLAGS"
130+
CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -Xpreprocessor -fopenmp $CXXFLAGS"
131+
LDFLAGS="-L/usr/local/lib -lomp $LDFLAGS"
132132
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
133133
CIBW_REPAIR_WHEEL_COMMAND: >
134134
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}

quaddtype/meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ incdir_numpy = run_command(py,
2626
# Add OpenMP dependency (optional, for threading)
2727
openmp_dep = dependency('openmp', required: false)
2828
dependencies = [sleef_dep, py_dep]
29-
if openmp_dep.found()
29+
if build_machine.system() == 'darwin'
30+
add_project_arguments('-Xpreprocessor', '-fopenmp', language : ['c', 'cpp'])
31+
if openmp_dep.found()
3032
dependencies += openmp_dep
33+
endif
34+
else
35+
if openmp_dep.found()
36+
dependencies += openmp_dep
37+
endif
3138
endif
3239

3340
includes = include_directories(

quaddtype/numpy_quaddtype/src/quadblas_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#define NO_IMPORT_ARRAY
66
#define NO_IMPORT_UFUNC
77

8+
#include "../QBLAS/include/quadblas/quadblas.hpp"
9+
810
extern "C" {
911
#include <Python.h>
1012
#include "numpy/arrayobject.h"
@@ -17,8 +19,6 @@ extern "C" {
1719
#include "quad_common.h"
1820
#include "quadblas_interface.h"
1921

20-
#include "../QBLAS/include/quadblas/quadblas.hpp"
21-
2222
static QuadBLAS::Layout
2323
get_quadblas_layout(PyArrayObject *arr)
2424
{

0 commit comments

Comments
 (0)