Alien-TALib
view release on metacpan or search on metacpan
system and easy access by other perl modules in the methodology cited
by Alien::Base.
You can use it in the Build.PL file if you're using Module::Build or
Makefile.PL file if you're using ExtUtils::MakeMaker.
my $talib = Alien::TALib->new;
my $build = Module::Build->new(
...
extra_compiler_flags => $talib->cflags(),
extra_linker_flags => $talib->libs(),
...
);
VERSION
0.18
WARNING
This module is not supported on Windows unless running under Cygwin or
MSYS.
We are working to fix this soon.
METHODS
cflags
This method provides the compiler flags needed to use the library on
the system.
libs
This method provides the linker flags needed to use the library on
the system.
SEE ALSO
Alien::Base
Alien::Build
PDL::Finance::TA
use strict;
use warnings;
use alienfile;
use Path::Tiny qw(path);
### let's probe by compiling the code. on FreeBSD force the download and build
### the latest code since the pkg version is old
if ($^O !~ /freebsd|openbsd|netbsd/i) {
plugin 'Probe::CBuilder' => (
lang => 'C',
cflags => $ENV{TALIB_INCLUDES} ? "-I$ENV{TALIB_INCLUDES} -I$ENV{TALIB_INCLUDES}/ta-lib": "",
libs => $ENV{TALIB_LIBDIRS} ? "-L$ENV{TALIB_LIBDIRS} -lta-lib -lm" : "-lta-lib -lm",
program => <<'EOF');
#include <ta_libc.h>
int main(int argc, char **argv)
{
TA_Initialize();
TA_Shutdown();
return 0;
}
EOF
$static_libta_lib
));
$static_libta_lib_a->move( $static_libta_lib );
}
my $lib = $prefix->child('lib')->stringify;
my $include = $prefix->child('include');
## handle pre-installed TA-lib 0.4 and self built TA-lib 0.6
my $include2 = $prefix->child('include', 'ta-lib');
my $dynamic = $prefix->child('dynamic');
$build->runtime_prop->{cflags} = "-I$include -I$include2";
$build->runtime_prop->{libs} = "-L$dynamic -lta-lib -lm";
$build->runtime_prop->{libs_static} = "-L$lib -lta-lib -lm";
$build->runtime_prop->{inline_auto_include} = [ 'ta_libc.h' ];
};
};
lib/Alien/TALib.pm view on Meta::CPAN
analysis library TA-lib from "L<http://ta-lib.org>" on the system and easy
access by other perl modules in the methodology cited by C<Alien::Base>.
You can use it in the C<Build.PL> file if you're using C<Module::Build> or
C<Makefile.PL> file if you're using ExtUtils::MakeMaker.
my $talib = Alien::TALib->new;
my $build = Module::Build->new(
...
extra_compiler_flags => $talib->cflags(),
extra_linker_flags => $talib->libs(),
...
);
=head1 VERSION
0.18
=head1 WARNING
This module is not supported on Windows unless running under Cygwin or MSYS.
We are working to fix this soon.
=head1 METHODS
=over
=item B<cflags>
This method provides the compiler flags needed to use the library on the system.
=item B<libs>
This method provides the linker flags needed to use the library on the system.
=back
=head1 SEE ALSO
=over
=item C<Alien::Base>
=item C<Alien::Build>
use Test::More;
use Test::Alien;
BEGIN { use_ok Alien::TALib };
alien_ok 'Alien::TALib';
my $alien = new_ok 'Alien::TALib';
can_ok($alien, 'cflags');
isnt($alien->cflags, undef, "has cflags()");
note($alien->cflags);
can_ok($alien, 'libs');
isnt($alien->libs, undef, "has libs()");
note($alien->libs);
done_testing();
__END__
#### COPYRIGHT: Vikas N Kumar. All Rights Reserved
#### AUTHOR: Vikas N Kumar <vikas@cpan.org>
#### DATE: 12th Jan 2013
#### LICENSE: Refer LICENSE file.
( run in 0.795 second using v1.01-cache-2.11-cpan-94b05bcf43c )