EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Alter Perl hashbang in capr.pl
From: Ralph Lange <[email protected]>
To: EPICS Tech Talk <[email protected]>
Date: Fri, 18 Jan 2013 21:58:36 +0100
On Fri Jan 18 2013 19:45:37 GMT+0100 (CET), Shankar, Murali <[email protected]> wrote:

Hello,

 

I have a EPICS build facility question.

 

In our various environments, in addition to the default Linux perl in /usr/bin/perl, we have a customized perl (with extra modules) in /usr/local/bin/perl. This customized version is ahead of /usr/bin/perl in the PATH as that’s what we want all our Perl scripts to use.

 

In addition, I have added a PERL line in configure/CONFIG_SITE like so

 

PERL=/usr/local/bin/perl

 

to force use of /usr/local/bin/perl and I have confirmed that this is the Perl that’s being used. And EPICS build fine.

 

However, the capr.pl (and other perl scripts) still contain hardcoded references to /usr/bin/perl.

 

head ./bin/linux-x86_64-debug/capr.pl

#!/usr/bin/perl -w

 

#######################################################################

#

#    capr: A program that attempts to do a "dbpr" command via channel

 

This causes symbol lookup errors when running capr.pl as the libCap5.so was built using /usr/local/bin/perl but is executing using /usr/bin/perl.

 

Am I missing some additional configuration here? Any help is appreciated.


Hi Murali,

one way to get around this (this is what the EPICS build system does) would be not to use the hashbang by explicitly calling perl with the script as argument:
    perl ./bin/linux-x86_64-debug/capr.pl

Admittedly, this avoids the issue and does not fix it.

A more elegant portable solution is replacing the hashbang with

    eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
        if 0;

That will find perl in the PATH.

HTH,
~Ralph


Replies:
Re: Alter Perl hashbang in capr.pl J. Lewis Muir
Re: Alter Perl hashbang in capr.pl Andrew Johnson
References:
Alter Perl hashbang in capr.pl Shankar, Murali

Navigate by Date:
Prev: Alter Perl hashbang in capr.pl Shankar, Murali
Next: Re: Alter Perl hashbang in capr.pl J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Alter Perl hashbang in capr.pl Shankar, Murali
Next: Re: Alter Perl hashbang in capr.pl J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·