简体   繁体   中英

Export Library path & include in perl

I have a query with regards to exporting library path & include for Platypus variant caller. The htslib it requires and platypus are installed on the server and I don't have sudo permissions to change them.

I am trying the following code to export library & include for running the caller. Am i missing osmething because am not able to execute it?

Code:

#!usr/perl-w
use strict;
use warnings;

`export LIBRARY_PATH=/opt/htslib/lib/`;
`export LD_LIBRARY_PATH=/opt/htslib/lib/`;
`export INCLUDE_PATH=/opt/htslib/include/`;
system ("python /opt/Platypus_0.8.1/Platypus.py callVariants --help");

Any sort of help would be appreciated.

You're setting the env vars of freshly-made shells, not of the Perl process that is to parent python . For that, you need the following:

$ENV{LIBRARY_PATH} = '/opt/htslib/lib/';
$ENV{LD_LIBRARY_PATH} = '/opt/htslib/lib/';
$ENV{INCLUDE_PATH} = '/opt/htslib/include/';

The last line of your code is better written as follows, since it avoids a needless shell:

system("python", "/opt/Platypus_0.8.1/Platypus.py", "callVariants", "--help");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM