Cannot compile mex with openmp
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
When compiling some C++ code in Matlab 2016b using:
mex CXXFLAGS="\$CXXFLAGS -std=c++11 -fopenmp" CXXOPTIMFLAGS='\$CXXOPTIMFLAGS -Ofast -DNDEBUG mexMyFunction.cpp
I got the following errors:
undefined reference to `omp_get_thread_num'
undefined reference to `omp_get_num_threads'
System: Ubuntu 16.04, g++ version: 5.4.0.
If I remove '-fopenmp' from the above command then it worked fine. Compiling directly with g++ (without mex) also worked.
Could you please help me to resolve this?
Thank you so much in advance!
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Algorithm Design Basics についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!