[] Matlab matlab installation package liblinear

Need to use LIBLINEAR, but encountered some problems during installation, here we are summarized below, hope to be useful.

We hope and share with everyone here, learn together and progress together.

 

Installation Environment:

System: Win7 (64 bits)

MATLAB Version: MATLAB R2017a

LIBLINEAR version: liblinear-2.11

 

Specific steps are as follows:

1. Download liblinear-2.11 installation package.

Download: http: //www.csie.ntu.edu.tw/~cjlin/liblinear

The specific location within the blue block

After downloading available , and unzip it.

2. decompressed in to the search path of MATLAB.

Method One: Open matlab (Version: MATLAB
R2017a) Select the home page (home), then select Settings path (SetPath)

Method 2: Open matlab (various versions available), the command line window (command
input pathtool window), and press Enter

Both methods can be obtained at FIG, click
Add and contains subfolders (Add withSubfolders)

Select matlab folder, and then click Select Folder

Select Save (save) and then select Off (close)

In the command line window (command window) enter mex -setup being given (note: there is a space between mex and -setup)

To solve this problem, you need to install the compiler.

3. Download TDM-GCC (64 bit) and install

Download: http: //tdm-gcc.tdragon.net/download

Select an installation package downloaded here is 64-bit (corresponding to the 64-bit computer Win7)

 

Open and install (Note: the installation path without spaces) Once downloaded, click Next until the installation has been completed.

然后,新建环境变量MW_MINGW64_LOC,设置为TDM-GCC-64的安装位置

具体操作步骤:
打开电脑桌面上的计算机图标,选择 打来控制面板

在控制面板中选择 系统

在系统界面选择 高级系统设置

在高级系统设置中选择 环境变量

点击新建,变量名:MW_MINGW64_LOC,变量值:TDM-GCC-64所在的安装位置,如我的安装位置是D:\TDM-GCC-64,之后选择 确定,再选择 保存

现在,在MATLAB命令行窗口(command window)内运行命令setenv('MW_MINGW64_LOC',folder),folder为TDM-GCC的安装位置,要加单引号,如我的是 setenv('MW_MINGW64_LOC',' D:\TDM-GCC-64'),输入后点击回车。

重启matlab

在MATLAB命令行窗口(command window)输入mex -setup(注意mex和-setup之间有一个空格),之后点击 回车,选择 mex -setup C++

之后显示

至此,编译器安装完成。

4. 在MATLAB命令行内运行命令make

在MATLAB命令行窗口(command
window)输入make

按 回车 后出现

解决办法:

修改make.m文件,将红色方框内的8个CFLAGS换成8个COMPFLAGS

再次在MATLAB命令行窗口(command
window)输入make

点击回车后出现

至此,我们成功安装了Liblinear。同时,我们发现解压后的中的文件夹中的内容

变为多了4个后缀为mexw64的文件。

 

参考博客:

1. Matlab Liblinear安装及测试过程

http://blog.csdn.net/xiaopihaierletian/article/details/54317707

2. Matlab安装MinGW-w64编译器

http://blog.csdn.net/desire121/article/details/60466845

3. Matlab2016a mex -setup出错的解决方法(VS2013)

 

转载自:https://blog.csdn.net/gdengden/article/details/79861185

Guess you like

Origin blog.csdn.net/zkq_1986/article/details/91126309