Posted on 2008-07-31 05:51:31-07 by bazzoola
Compilation
I got this module to compile under Mac OS X 10.5 and MATLAB 2008a. However, it does not seem to function properly. May be this will help someone in the future. I had to update the include path and add a new definition to Makefile.PL
use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Math::Matlab::Engine', 'VERSION_FROM' => 'lib/Math/Matlab/Engine.pm', # finds $VERSION 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/Math/Matlab/Engine.pm', # retrieve abstract from module AUTHOR => 'Oliver Ebenhoeh <oliver.ebenhoeh@rz.hu-berlin.de>') : ()), 'LIBS' => ['-L/Applications/MATLAB_R2008a/sys/os/maci -L/Applications/MATLAB_R2008a/bin/maci -L/Applications/MATLAB_R2008a/extern/lib/maci -lmx -leng'], # e.g., '-lm' 'DEFINE' => '-DV5_COMPAT', # e.g., '-DHAVE_SOMETHING' # Insert -I. if you add *.h files later: 'INC' => '-I/Applications/MATLAB_R2008a/extern/include', # e.g., '-I/usr/include/other' # Un-comment this if you add C files to link with later: # 'OBJECT' => '$(O_FILES)', # link all the C files too );
then I tried the example
use Math::Matlab::Engine; $ep = Math::Matlab::Engine->new(); $ep->PutMatrix('N',2,3,[1,2,3,4,5,6]); $ep->EvalString("plot(N)");
But I dont see any figure. oh I forgot to mention that I also had to setup a custom LD path before running the example and possibly before compiling.
setenv DYLD_LIBRARY_PATH /Applications/MATLAB_R2008a/bin/maci:/Applications/MATLAB_R2008a/sys/os/ma +ci:/Applications/MATLAB_R2008a/extern/lib/maci
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.