不需要修改路径,只需将matlab中的路径修改即可,如下图
下面是已经修改好的compile.m文件,可以供大家使用
clear all;
get_architecture;
%%%%%%%%%%%%% COMPILER CONFIGURATION %%%%%%%%%%%%%%%%
% set up the compiler you want to use. Possible choices are
% - 'mex' (default matlab compiler), this is the easy choice if your matlab
% is correctly configured. Note that this choice might not compatible
% with the option 'use_multithread=true'.
% - 'icc' (intel compiler), usually produces the fastest code, but the
% compiler is not free and not installed by default.
% - 'gcc' (gnu compiler), good choice (for Mac, use gcc >= 4.6 for
% the multi-threaded version, otherwise set use_multithread=false).
% For windows, you need to have cygwin installed.
% - 'clang'
% - 'vs' (visual studio compiler) for windows computers (10.0 or more is recommended)
% for some unknown reason, the performance obtained with vs is poor compared to icc/gcc
compiler='mex';
%%%%%%%%%%%% BLAS/LAPACK CONFIGURATION %%%%%%%%%%%%%%
% set up the blas/lapack library you want to use. Possible choices are
% - builtin: blas/lapack shipped with Matlab,
% same as mex: good choice if matlab is correctly configured.
% - mkl: (intel math kernel library), usually the fastest, but not free.
% - acml: (AMD Core math library), optimized for opteron cpus
% - blas: (netlib version of blas/lapack), free
% - atlas: (atlas version of blas/lapack), free,
% ==> you can also tweak this script to include your favorite blas/lapack library
blas='builtin';
%%%%%%%%%%%% MULTITHREADING CONFIGURATION %%%%%%%%%%%%%%
% set true if you want to use multi-threaded capabilities of the toolbox. You
% need an appropriate compiler for that (intel compiler, most recent gcc, or visual studio pro)
use_multithread=false; % (might not compatible with compiler=mex)
% if the compilation fails on Mac, try the single-threaded version.
% to run the toolbox on a cluster, it can be a good idea to deactivate this
use_64bits_integers=true;
% use this option if you have VERY large arrays/matrices
% this option allows such matrices, but may slightly reduce the speed of the computations.
use_mkl_threads=false;
% use this option is you use the mkl library and intends to use intensively BLAS3/lapack routines
% (for multiclass logistic regression, regularization with the trace norm for instance)
% this results in a loss of performance for many other functions
% if you use the options 'mex' and 'builtin', you can proceed with the compilation by
% typing 'compile' in the matlab shell. Otherwise, you need to set up a few path below.
path_matlab='/softs/bin/';
path_matlab='';
%%%%%%%%%%%% PATH CONFIGURATION %%%%%%%%%%%%%%%%%%%%
% only if you do not use the options 'mex' and 'builtin'
% set up the path to the compiler libraries that you intend to use below
add_flag='';
if strcmp(compiler,'gcc')
if linux || mac
% example when compiler='gcc' for Linux/Mac: (path containing the files libgcc_s.*)
path_to_compiler_libraries='/usr/lib/gcc/x86_64-redhat-linux/4.9.2/';
path_to_compiler_libraries='/usr/lib/gcc/x86_64-redhat-linux/4.7.2/';
path_to_compiler_libraries='/usr/lib/gcc/x86_64-linux-gnu/4.8.2/';
path_to_compiler_libraries='/usr/lib/gcc/x86_64-linux-gnu/5/';
path_to_compiler='/usr/bin/';
else
% example when compiler='gcc' for Windows+cygwin: (the script does not
% work at the moment in this configuration
path_to_compiler='C:\cygwin\bin\';
path_to_compiler_libraries='C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\';
end
elseif strcmp(compiler,'clang')
path_to_compiler='/usr/bin/';
path_to_compiler_libraries='/usr/lib/clang/3.5/lib/';
path_to_libstd='/usr/lib/gcc/x86_64-linux-gnu/4.8/';
elseif strcmp(compiler,'open64')
% example when compiler='gcc' for Linux/Mac: (path containing libgcc_s.*)
path_to_compiler_libraries='/opt/amdsdk/v1.0/x86_open64-4.2.4/lib/gcc-lib/x86_64-open64-linux/4.2.4/';
path_to_compiler='/opt/amdsdk/v1.0/x86_open64-4.2.4/bin/';
elseif strcmp(compiler,'icc')
if linux || mac
% example when compiler='icc' for Linux/Mac
path_to_gcccompiler_libraries='/usr/lib/gcc/x86_64-redhat-linux/4.7.2/';
path_to_gcccompiler_libraries='/usr/lib/gcc/x86_