How to link during Matlab's MEX compilation

后端 未结 3 1968
春和景丽
春和景丽 2020-12-10 16:44

I\'ve written a program of the following form:

#include \"stuff_I_need.h\"

int main(){

construct_array(); // uses OpenMP pragma\'s
print_array();

return(0         


        
3条回答
  •  没有蜡笔的小新
    2020-12-10 17:21

    Try not putting the -l, -L, or -I arguments in those environment variables. The mex function will handle those types of arguments directly. So perhaps something like:

    mex -v CC="gcc44" CFLAGS="\$CFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" -I/home/matteson/sundials/include/ -L/home/matteson/sundials/lib -lsundials_cvode -lsundials_nvecserial mex_cvode.c
    

提交回复
热议问题