Skip to content

Commit c1bd28a

Browse files
committed
clang native build on macos, retry numpy import on macos (any warning generated causes import error with more recent numpy versions)
1 parent 6428797 commit c1bd28a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

conda-recipe/meta.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ build:
99
detect_binary_files_with_prefix: False
1010
script_env:
1111
QLIC
12+
overlinking_ignore_patterns:
13+
- "q/*/p.so"
1214

1315
requirements:
1416
build:
15-
- m2w64-make [win]
16-
- {{ compiler('c') }}
17+
- m2w64-make # [win]
18+
- {{ compiler('c') }} # [not osx]
1719
host:
1820
- python
1921
- kdb

makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ ifeq ($(UNAME_S),Linux)
1717
else ifeq ($(UNAME_S),Darwin)
1818
OSFLAG = m
1919
LDFLAGS = -bundle -undefined dynamic_lookup
20+
CC=clang
21+
CFLAGS += -arch arm64 -arch x86_64
2022
endif
2123

2224
TGT = p.so

py.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Z K1(setpyerr){P(xt!=-KJ,ktrr())P(!errfmt,krr("traceback.format_exception"))pyer
5252
ZV*t;EXP K3(init){ZI i=0;I f;S l,h,hh;K n,v;P a,b,c=0;P(i,0)l=zs(x),h=zs(y),hh=zs(z);f=pyl(l);free(l);P(!f,krr("libpython"))
5353
Py_SetPythonHome(Py_DecodeLocale(h,0));Py_SetProgramName(Py_DecodeLocale(hh,0));free(hh);free(h);Py_InitializeEx(0);if(PyEval_ThreadsInitialized()&&!PyGILState_Check())t0(PyGILState_GetThisThreadState());PyEval_InitThreads();
5454
M=PyModule_GetDict(PyImport_AddModule("__main__"));cf=k(0,"::",0);n=ktn(KS,0);v=ktn(0,0);
55-
if((a=PyImport_ImportModule("numpy.core.multiarray"))||(PyErr_Print(),c=PyImport_ImportModule("numpy.core.multiarray"))){N=PyCapsule_GetPointer(b=PyObject_GetAttrString(a?a:c,"_ARRAY_API"),0);if(!N||!pyn(N))N=0;p0(b);p0(a);p0(c);}PyErr_Clear();
55+
if((a=PyImport_ImportModule("numpy.core.multiarray"))||(PyErr_Clear(),c=PyImport_ImportModule("numpy.core.multiarray"))){N=PyCapsule_GetPointer(b=PyObject_GetAttrString(a?a:c,"_ARRAY_API"),0);if(!N||!pyn(N))N=0;p0(b);p0(a);p0(c);}PyErr_Clear();
5656
if(a=PyImport_ImportModule("traceback")){errfmt=PyObject_GetAttrString(a,"format_exception");p0(a);}PyErr_Clear();
5757
#define F(f,i) js(&n,ss(#f));jk(&v,dl(f,i));
5858
F(setpyerr,1)F(getpyerr,1)F(eval,1)F(e,1)F(py2q,1)F(q2py,1)F(get,1)F(set,2)F(import,1)F(getattr,2)F(call,3)F(isp,1)F(setconv,1)F(getconv,1)js(&n,ss("numpy"));

0 commit comments

Comments
 (0)