our
$VERSION
= 0.002_000;
sub
cpp_load {
{
my
void::method
$RETURN_TYPE
};
my
$need_load_cpp
= 0;
if
( (
exists
$main::
{
'RPerl__DataStructure__GSLMatrix__MODE_ID'
} )
and (
defined
&{
$main::
{
'RPerl__DataStructure__GSLMatrix__MODE_ID'
} } ) )
{
if
(
$RPerl::MODES
->{main::RPerl__DataStructure__GSLMatrix__MODE_ID()}->{ops} ne
'CPP'
) {
$need_load_cpp
= 1;
}
}
else
{
$need_load_cpp
= 1;
}
if
(
$need_load_cpp
) {
my
$eval_string
=
<<"EOF";
package main;
use RPerl::Inline;
BEGIN { RPerl::diag("[[[ BEGIN 'use Inline' STAGE for 'RPerl/DataStructure/GSLMatrix.cpp' ]]]\n" x 1); }
use Inline (CPP => '$RPerl::INCLUDE_PATH' . '/RPerl/DataStructure/GSLMatrix.cpp', \%RPerl::Inline::ARGS);
RPerl::diag("[[[ END 'use Inline' STAGE for 'RPerl/DataStructure/GSLMatrix.cpp' ]]]\n" x 1);
1;
EOF
$RPerl::Inline::ARGS
{ccflagsex} =
$RPerl::Inline::CCFLAGSEX
.
$RPerl::TYPES_CCFLAG
. rperltypessizes::type_integer_native_ccflag() . rperltypessizes::type_number_native_ccflag();
$RPerl::Inline::ARGS
{cppflags} =
$RPerl::TYPES_CCFLAG
. rperltypessizes::type_integer_native_ccflag() . rperltypessizes::type_number_native_ccflag();
$RPerl::Inline::ARGS
{libs} =
'-lgsl'
;
$RPerl::Inline::ARGS
{inc} .=
' -I'
.
$RPerl::Inline::gsl_include_dir
;
$RPerl::Inline::ARGS
{auto_include} = [ @{
$RPerl::Inline::ARGS
{auto_include} },
'#include <gsl_matrix.h>'
]; # enable GSL support
eval
$eval_string
or croak(
$OS_ERROR
.
"\n"
.
$EVAL_ERROR
);
if
(
$EVAL_ERROR
) { croak(
$EVAL_ERROR
); }
}
return
;
}
1;