簡體   English   中英

Matlab Mex編譯錯誤

[英]Matlab Mex compilation error

我正在使用Matlab的Random Forest庫( link )。 我正在使用它進行分類。 在Windows上,它開箱即用(預編譯的mex文件)效果很好,但我也想在CentOS群集上運行它。

我試圖通過執行make mex在集群上進行編譯,但出現錯誤。 輸出如下:

rm twonorm_test -rf
rm  tempbuild/*.o *.o -rf
rm *~ -rf
rm *.mexw32 twonorm_test -rf
rm *.mexa64 -rf
rm classRF -rf
rm *.exe -rf
echo 'Compiling classTree.cpp'
Compiling classTree.cpp
g++ -fpic -O2 -funroll-loops -msse3 -c src/classTree.cpp -o tempbuild/classTree.o
echo 'Compiling Cokus (random number generator)'
Compiling Cokus (random number generator)
g++ -fpic -O2 -funroll-loops -msse3 -c src/cokus.cpp -o tempbuild/cokus.o
echo 'Compiling rfsub.f (fortran subroutines)'
Compiling rfsub.f (fortran subroutines)
gfortran   -O2 -fpic  -c src/rfsub.f -o rfsub.o
echo 'Compiling rfutils.cpp'
Compiling rfutils.cpp
g++ -fpic -O2 -funroll-loops -msse3 -c src/rfutils.cpp -o tempbuild/rfutils.o
echo 'Generating Mex'
Generating Mex
mex src/mex_ClassificationRF_train.cpp  src/classRF.cpp tempbuild/classTree.o tempbuild/rfutils.o rfsub.o tempbuild/cokus.o  -o mexClassRF_train -lgfortran -lm -DMATLAB -g
Unknown MEX argument '-o'.
make: *** [mex_classRF] Error 255

有人知道如何解決這個問題嗎? 如果需要,可以從上面的鏈接中獲取RF_MexStandalone-v0.02.zip,然后轉到randomforest-matlab / RF_Reg_C / Makefile。

編輯:我將-o更改為-output,但是現在輸出如下:

rm twonorm_test -rf
rm  tempbuild/*.o *.o -rf
rm *~ -rf
rm *.mexw32 twonorm_test -rf
rm *.mexa64 -rf
rm classRF -rf
rm *.exe -rf
echo 'Compiling classTree.cpp'
Compiling classTree.cpp
g++ -fpic -O2 -funroll-loops -msse3 -c src/classTree.cpp -o tempbuild/classTree.o
echo 'Compiling Cokus (random number generator)'
Compiling Cokus (random number generator)
g++ -fpic -O2 -funroll-loops -msse3 -c src/cokus.cpp -o tempbuild/cokus.o
echo 'Compiling rfsub.f (fortran subroutines)'
Compiling rfsub.f (fortran subroutines)
gfortran   -O2 -fpic  -c src/rfsub.f -o rfsub.o
echo 'Compiling rfutils.cpp'
Compiling rfutils.cpp
g++ -fpic -O2 -funroll-loops -msse3 -c src/rfutils.cpp -o tempbuild/rfutils.o
echo 'Generating Mex'
Generating Mex
mex src/mex_ClassificationRF_train.cpp  src/classRF.cpp tempbuild/classTree.o tempbuild/rfutils.o rfsub.o tempbuild/cokus.o  -output mexClassRF_train -lgfortran -lm -DMATLAB -g
Building with 'g++'.
cc1plus: error: unrecognized command line option "-std=c++11"

make: *** [mex_classRF] Error 255

我在makefile中找不到選項-std=c++11

該錯誤是不言自明的:無法識別選項-o 如果鍵入mex -help則會看到mex接受的選項。 嘗試將-o替換為-output

編輯有關std=c++11選項的信息,您可能正在使用舊版本的gcc編譯器。 您可以將其更改為等效選項std=c++0x (但請注意,c ++ 11標准的某些功能可能不存在/未實現),或升級到最新版本的gcc

如果需要更多幫助,請報告g++ --version的輸出。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM