AI-PredictionClient-Alien-TensorFlowServingProtos

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN

use alienfile;
use File::Copy;
use File::Copy::Recursive qw(dircopy dirmove);
use Archive::Extract;

use Alien::Google::GRPC;
use Env qw( @PATH );
unshift @PATH, Alien::Google::GRPC->bin_dir;

meta_prop->{my_libs}    = Alien::Google::GRPC->libs;
meta_prop->{my_cflags}  = Alien::Google::GRPC->cflags;

probe sub {
  return 'share';
};
 
share {
  download sub {
                  # The alien automagic obfuscates the actions taking place.
                  # Use some work arounds to make this work.
                  my $download_from_location = $ENV{'PWD'}; 

alienfile  view on Meta::CPAN

     $ae->extract;

                  my $additional_files = $build->install_prop->{download} . '/tds';
                  dirmove($additional_files, './tensorflowserving_pb/tds');
                  move('./tensorflowserving_pb/Makefile', './tensorflowserving_pb/stray_makefile');
                  move('./tensorflowserving_pb/tds/Makefile', './tensorflowserving_pb/');
               };

  build [
    [ 'prefix=%{.install.prefix} '
    . 'CPPFLAGS="%{.meta.my_cflags}" '
    . 'LDFLAGS="%{.meta.my_libs}" '
    . ' %{make}' ],
    [ 'prefix=%{.install.prefix} %{make} install' ],
  ];
};
 
gather [
  # Trust the force.
  # Automagic will rewrite your path.
  [ 'echo "3.0"', \'%{.runtime.version}' ],
  [ 'echo "-L%{.install.prefix}/lib -ltensorflow_serving_protos_so"', \'%{.runtime.libs}'    ],
  [ 'echo "-I%{.install.prefix}/include"', \'%{.runtime.cflags}'    ],
];

lib/AI/PredictionClient/Alien/TensorFlowServingProtos.pm  view on Meta::CPAN

In your Build.PL:

 use Module::Build;
 use AI::PredictionClient::Alien::TensorFlowServingProtos;
 my $builder = Module::Build->new(
   ...
   configure_requires => {
     'AI::PredictionClient::Alien::TensorFlowServingProtos' => '0',
     ...
   },
   extra_compiler_flags => AI::PredictionClient::Alien::TensorFlowServingProtos->cflags,
   extra_linker_flags   => AI::PredictionClient::Alien::TensorFlowServingProtos->libs,
   ...
 );
 
 $build->create_build_script;

In your Makefile.PL:

 use ExtUtils::MakeMaker;
 use Config;
 use AI::PredictionClient::Alien::TensorFlowServingProtos;
 
 WriteMakefile(
   ...
   CONFIGURE_REQUIRES => {
     'AI::PredictionClient::Alien::TensorFlowServingProtos' => '0',
   },
   CCFLAGS => AI::PredictionClient::Alien::TensorFlowServingProtos->cflags . " $Config{ccflags}",
   LIBS    => [ AI::PredictionClient::Alien::TensorFlowServingProtos->libs ],
   ...
 );

=cut

=head1 DESCRIPTION

This distribution builds a C++ library for use by other Perl XS modules to 
communicate with Google TensorFlow Serving model servers. It is primarily intended to be used 



( run in 0.277 second using v1.01-cache-2.11-cpan-94b05bcf43c )