I don't know why I wrote this log. Maybe Matlab is rarely used in Linux in the future, and this Perl and Matlab interfaces will not be used.
After the installation is complete, simply record the process.
For the installation of Matlab, please refer to the teacher's blog: http://blog.sina.com.cn/s/blog_5f0fbdee0100mfkq.html
CPAN download math-MATLAB Installation File http://search.cpan.org /~ Math-Matlab-0.08/Zman/
Install file for Math-Matlab-0.08
Step 2: Install a mod_perl enabled web server (http://perl.apache.org/). Okay, first install mod_perl:
Mod_perl installation:
Download mpd_perl 2.0 http://perl.apache.org/download/index.html
The Installation Method in the install file in the mod_perl-2.0.4 folder is:
% Perl makefile. pl mp_apxs =/usr/local/apache2/bin/apxs
% Make & make test
% Make install
However, apxs cannot be found in my centos 5.4 system. Solution:
[Root @ zhuliting MATLAB] # Yum search apxs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* Base: mirrors.163.com
* Updates: mirrors.163.com
* Addons: mirrors.163.com
* Extras: mirrors.163.com
========================================================== === Matched: apxs =================================================== =====
Httpd-devel.i386: development tools for the Apache HTTP Server.
[Root @ zhuliting MATLAB] # Yum install httpd-devel
...
...
[Root @ zhuliting MATLAB] # Find/-name apxs
/Usr/sbin/apxs
This is the path of apxs, which will be used below.
[Root @ zhuliting mod_perl-2.0.4] # Perl makefile. pl mp_apxs =/usr/sbin/apxs
[Root @ zhuliting mod_perl-2.0.4] #/usr/sbin/apxs-Q libexecdir
The modelus path is displayed:
/Usr/lib/httpd/modules
Append httpd. conf: [you do not need to append it here. If you modify httpd. conf, the HTTP service cannot be enabled.]
Loadmodule perl_module/usr/lib/httpd/modules/mod_perl.so
Last
[Root @ zhuliting mod_perl-2.0.4] # Make & make install
Here, mod_perl installation is complete, we go back to the installation of the Math_Matlab-0.08 ......
[Root @ zhuliting Math-Matlab-0.08] # Perl makefile. pl mp_apxs =/usr/sbin/apxs
Enter command to execute matlab [/usr/local/bin/Matlab-nodisplay-nojvm]:
You cannot press enter here. I use the find command and find that the MATLAB command is in/usr/local/Matlab/bin/MATLAB. Therefore, I manually enter: /usr/local/Matlab/bin/Matlab-nodisplay-nojvm
After you press enter, the following message is displayed:
Attempting to run MATLAB... which: No shopt in (/usr/lib/qt-3.3/bin:/usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin: /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/x11r6/bin:/root/bin)
OK
Checking if your kit is complete...
Looks good
'Mp _ apxs 'is not a known makemaker parameter name.
Writing makefile for math-MATLAB
Most of the tests for the server and remote classes of
Math: MATLAB package are not run by default.
In order to test them, you will need to set up a server according to
Instructions in the install file, then edit the 'server. config' File
With the appropriate values and re-run 'make test '.
Execute step 2 of the install file for the Math-Matlab-0.08
[Root @ zhuliting Math-Matlab-0.08] # make install
Steps 5 to 3rd are not clear
If you don't quite understand what to do, do nothing. So far, math-MATLAB can be used on a local computer.
I wrote a test program and succeeded ...... That's it.
Attached Perl testing program:
#! /Usr/bin/perl
Use math: MATLAB: local;
$ MATLAB = Math: MATLAB: local-> New ({
Cmd => '/usr/local/Matlab/bin/Matlab-nodisplay-nojvm ',
Root_mwd => '/etc/httpd/Matlab-Server'
});
# My $ code = Q/fprintf ('Hello world! /N ');/;
My $ code = Q/disp (pinv ([1 2; 3 4; 5 6;]);/;
If ($ Matlab-> execute ($ Code )){
Print $ Matlab-> fetch_result;
} Else {
Print $ Matlab-> err_msg;
}
In addition:
# $ Matlab-> execute ($ code, "/etc/httpd/Matlab-server", "zlt. m") can execute M files in the specified directory
For example:
#! /Usr/bin/perl
Use math: MATLAB: local;
$ MATLAB = Math: MATLAB: local-> New ({
Cmd => '/usr/local/MATLAB 2009a/bin/Matlab-nodisplay-nojvm ',
Root_mwd => '/etc/httpd/Matlab-Server'
});
My $ code = '';
If ($ Matlab-> execute ($ code, "/etc/httpd/Matlab-server", "zlt. m ")){
Print $ Matlab-> fetch_result;
} Else {
Print $ Matlab-> err_msg;
}