Skip to content

Commit

Permalink
allow to link with libomp on macos with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Aug 24, 2023
1 parent 0119431 commit acfea7d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_manywheel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload Manylinux2014 Python Wheels
name: Build+Upload Manylinux2014 Python Wheels
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_macos_wheel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload macOS Python Wheels
name: Build+Upload MacOS Python Wheels
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_windows_wheel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload Windows Python Wheels
name: Build+Upload Windows Python Wheels
on:
push:
branches:
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ ifeq ($(findstring _NT-,$(PLATFORM)), _NT-)
export CC CXX
else ifeq ($(findstring Darwin,$(PLATFORM)), Darwin)
CUDA_STATIC=--cudart static
OMP=-Xclang -fopenmp
CPPOPT+=$(OMP)
LINKOPT+=-L/usr/local/lib
INCLUDEDIRS+=-I/usr/local/include
else
CPPOPT+=$(OMP)
CUCCOPT+=-Xcompiler $(OMP)
Expand Down
2 changes: 1 addition & 1 deletion src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ void mcx_kahanSum(float* sum, float* kahanc, float input) {
*/

float mcx_updatemua(unsigned int mediaid, Config* cfg) {
float mua;
float mua = 0.f;

if (cfg->mediabyte <= 4) {
mua = cfg->prop[mediaid & MED_MASK].mua;
Expand Down
3 changes: 2 additions & 1 deletion src/mcxlab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
cfg.prop[i + 1].mus /= cfg.unitinmm;
}

dimtype propdim[2] = {4, cfg.medianum};
dimtype propdim[2] = {4, 0};
propdim[1] = (dimtype)cfg.medianum;
mxSetFieldByNumber(plhs[0], jstruct, 3, mxCreateNumericArray(2, propdim, mxSINGLE_CLASS, mxREAL));
memcpy((float*)mxGetPr(mxGetFieldByNumber(plhs[0], jstruct, 3)), cfg.prop, cfg.medianum * 4 * sizeof(float));
}
Expand Down

0 comments on commit acfea7d

Please sign in to comment.