EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: dllPath.bat problem
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Mon, 16 Jan 2017 10:34:52 -0600
Hi Mark,

On 01/14/2017 05:14 PM, Mark Rivers wrote:
> The EPICS build system can construct a dllPath.bat file in an ioc boot
> directory.  This is very convenient when running IOCs built dynamically
> for Windows.  An example of such a file is the one built in
> asyn/iocBoot/iocTest.
>  
> corvette:asyn/iocBoot/ioctest>more dllPath.bat
> @ECHO OFF
> PATH
> %PATH%;/home/epics/support/asyn-4-31/bin/linux-x86_64;/corvette/home/epics/support/seq-2-2-4/bin/linux-x86_64;/corvette/usr/local/epics/base-3.15.5/bin/linux-x86_64
>  
> However, I think there is an issue with these files.  Note that it puts
> the current PATH at the beginning of the new path, rather than at the
> end.  This means that if the current path contains a DLL with the same
> name as a DLL created by EPICS, it will use the one in the current path,
> not the one that EPICS created.  It seems to me that this is the wrong
> thing to do, for several reasons:
>  
> -          What if the current path happens to contain, for example, a
> DLL called “com.dll” or “ca.dll” which is completely unrelated to
> EPICS.  It will use the wrong DLL.
> -          What if the current path contains an older version of one of
> the DLLs that EPICS built.  This is what just happened to me.  I have
> the Anaconda Python bin/ directory in my path, and it contains
> hdf5.dll.  It is an older version of the HDF5 library.  EPICS
> areaDetector builds hdf5.dll using the latest code, actually patched
> beyond anything the HDF5 group had yet released.  My IOC won’t run,
> because the old DLL does not contain the symbols added recently.
>  
> Are there any circumstances under which the current behavior would be
> desired?

Good point, I agree that for the reasons you describe the current output
is wrong.

An equivalent fix is also required for the relPaths.sh script, which is
the Cygwin equivalent of the dllPath.bat file for those running IOCs
under Cygwin and bash.

I will commit this change to Base (3.14 version):

> === modified file 'src/tools/convertRelease.pl'
> --- src/tools/convertRelease.pl 2016-07-07 21:43:29 +0000
> +++ src/tools/convertRelease.pl 2017-01-16 16:22:42 +0000
> @@ -119,15 +119,15 @@
>      unlink $outfile;
>      open(OUT, ">$outfile") or die "$! creating $outfile";
>      print OUT "\@ECHO OFF\n";
> -    print OUT "PATH \%PATH\%;", join(';', binDirs()), "\n";
> +    print OUT "PATH ", join(';', binDirs(), '%PATH%'), "\n";
>      close OUT;
>  }
>  
>  sub relPaths {
>      unlink $outfile;
>      open(OUT, ">$outfile") or die "$! creating $outfile";
> -    print OUT "export PATH=\$PATH:",
> -        join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs()), "\n";
> +    print OUT "export PATH=",
> +        join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs(), '$PATH'), "\n";
>      close OUT;
>  }
>  

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
RE: dllPath.bat problem Mark Rivers
References:
dllPath.bat problem Mark Rivers

Navigate by Date:
Prev: dllPath.bat problem Mark Rivers
Next: Re: CA server bind failure on Windows Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: dllPath.bat problem Mark Rivers
Next: RE: dllPath.bat problem Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024