EPICS Home

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  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
<== Date ==> <== Thread ==>

Subject: Re: how is envPaths built?
From: Marco Filho via Tech-talk <tech-talk at aps.anl.gov>
To: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 28 Aug 2024 12:02:26 +0000

For some reason my emails aren't going to tech-talk... Re-sending it here

You kinda got me curious to this too.
I found this script segment which seems to be creating envPaths in epics-base/bin/linux-x86_64/convertRelease.pl:

#
# Generate envPaths file with epicsEnvSet commands for iocsh IOCs.
# Include parentheses anyway in case CEXP users want to use this.
#
sub envPaths {
    my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps;

    unlink($outfile);
    open(OUT,">$outfile") or die "$! creating $outfile";

    my $ioc = $cwd;
    $ioc =~ s/^.*\///;  # iocname is last component of directory name

    print OUT "epicsEnvSet(\"IOC\",\"$ioc\")\n";

    foreach my $app (@includes) {
        my $iocpath = my $path = $macros{$app};
        $iocpath =~ s/^$root/$iocroot/o if ($opt_t);
        $iocpath =~ s/([\\"])/\\$1/g; # escape back-slashes and double-quotes
        print OUT "epicsEnvSet(\"$app\",\"$iocpath\")\n" if (-d $path);
    }
    close OUT;
}

I don't know perl but it seems it gets the name from the directory and the directory itself is created from another mechanism from makeBaseApp?
I tried changing the directory name and recompiling and it really changes the IOC variable name in envPaths. I'm not sure where is the part of makeBaseApp that creates the directory though.




From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of William Kirstaedter via Tech-talk <tech-talk at aps.anl.gov>
Sent: 28 August 2024 10:38
To: tech-talk at aps.anl.gov
Subject: how is envPaths built?
 
Hello,

I'd like to know how the envPaths file in the iocBoot Directory is built.

I tried to load the IOC's main dbd file by using the $(IOC) variable
from envPaths, but noticed that it always will contain an "ioc" Prefix
to the actual IOC name, while the dbd file is called just like the IOC name.

for example, if you create a new empty IOC by using "makeBaseApp.pl -t
ioc test" and "makeBaseApp.pl -i -t ioc test":

you get a Makefile in $(TOP)/testApp/src/ that builds a test.dbd

while in iocBoot, envPaths with always have the $(IOC) variable set to
"ioctest".

Just curious,

--
William Kirstaedter
PP&B Computer Support Group
Fritz-Haber-Institut Berlin


Replies:
Re: how is envPaths built? Ralph Lange via Tech-talk
Re: how is envPaths built? William Kirstaedter via Tech-talk
References:
how is envPaths built? William Kirstaedter via Tech-talk

Navigate by Date:
Prev: how is envPaths built? William Kirstaedter via Tech-talk
Next: Re: how is envPaths built? Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
Navigate by Thread:
Prev: how is envPaths built? William Kirstaedter via Tech-talk
Next: Re: how is envPaths built? Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025