How to compile mex file
古いコメントを表示
I am trying to use a Matlab use function Boosted Binary Regression Trees but according to the readme I have to complie a mex file first. To be exact here are the instructions given in the readme:
First you need to compile C++ code to get mex file. To compile with OpenMP support, do the following:
mex findBestSplit.cpp COMPFLAGS="/openmp $COMPFLAGS"
I have never used OpenMP before so I am not sure what I am supposed to do exactly, can someone walk me through the steps to get this to work?
回答 (1 件)
James Tursa
2021 年 3 月 8 日
編集済み: James Tursa
2021 年 3 月 8 日
0 投票
You are simply supposed to type (or copy & paste) that text into the command line at the > prompt. Just be in the directory where the source code is located when you execute this mex command.
Note that the mex instructions given may need to be adjusted if your system is different from the author's system. The OpenMP option may be different, the COMPFLAGS may be different, etc.
10 件のコメント
Sergio Palomo
2021 年 3 月 9 日
James Tursa
2021 年 3 月 11 日
編集済み: James Tursa
2021 年 3 月 11 日
Try to compile with the verbose option and see if there are any messages:
mex('-v','findBestSplit.cpp','COMPFLAGS="/openmp $COMPFLAGS"')
Sergio Palomo
2021 年 3 月 11 日
James Tursa
2021 年 3 月 11 日
What does "get the same thing" mean? The mex command is giving you this response? Or when you try to run the function it is displaying some response to you? Can you post a copy of what you are actually typing in and the entire response you are getting?
Sergio Palomo
2021 年 3 月 11 日
James Tursa
2021 年 3 月 11 日
Surely more must have been printed out after the mex command? The verbose option should have caused lots of printout. This didn't happen?
Sergio Palomo
2021 年 3 月 11 日
James Tursa
2021 年 3 月 11 日
Type the following at the command line:
which mex -all
Sergio Palomo
2021 年 3 月 11 日
James Tursa
2021 年 3 月 11 日
編集済み: James Tursa
2021 年 3 月 11 日
Huh?
Are you running MATLAB?
カテゴリ
ヘルプ センター および File Exchange で Write C Functions Callable from MATLAB (MEX Files) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!