matlab---SPAMS稀疏建模工具箱(对另一个博主的文章进行的补充说明)

不需要修改路径,只需将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_
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值