From 21918853a248e5ae43dc1494b61bd30cca3610c5 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Wed, 11 Sep 2024 19:49:47 -0400 Subject: [PATCH] [ci] allow make oct to link with OpenCL on macos --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index bb020df..feae4bc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -156,8 +156,10 @@ mex oct: CUCCOPT+=$(DLLFLAG) -DMCX_CONTAINER -DMATLAB_MEX_FILE mex oct: CCOPT+=$(DLLFLAG) -DMCX_CONTAINER -DMATLAB_MEX_FILE mex: LINKOPT+=mcxlabcl.cpp -outdir $(OUTPUT_DIR) $(INCLUDEDIRS) +OCT_LDFLAGS := $(shell mkoctfile -p LDFLAGS) + oct: BINARY=mcxcl.mex -oct: AR=XTRA_CFLAGS=' ' XTRA_CXXFLAGS=' ' CXXFLAGS='-std=c++11 $(CPPOPT) $(MEXCCOPT) $(USERCCOPT)' LFLAGS='$(LDFLAGS) -g -L$(LIBOPENCLDIR) $(LIBOPENCL)' DL_LDFLAGS='-shared $(LDFLAGS) -g -L$(LIBOPENCLDIR) $(LIBOPENCL) $(MEXLINKOPT)' mkoctfile -v +oct: AR=XTRA_CFLAGS=' ' XTRA_CXXFLAGS=' ' CXXFLAGS='-std=c++11 $(CPPOPT) $(MEXCCOPT) $(USERCCOPT)' LDFLAGS='$(OCT_LDFLAGS) -g -L$(LIBOPENCLDIR) $(LIBOPENCL)' DL_LDFLAGS='-shared $(LDFLAGS) -g -L$(LIBOPENCLDIR) $(LIBOPENCL) $(MEXLINKOPT)' mkoctfile -v oct: LINKOPT=--mex -DMATLAB_MEX_FILE mcxlabcl.cpp $(INCLUDEDIRS) $(EXTRALIB) OBJS := $(addsuffix $(OBJSUFFIX), $(FILES))