Issues with genpath reproducibility

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Issues with genpath reproducibility

Sorina Camarasu Pop
Dear all,

I have recently stumbled on a strange issue when executing an octave
application inside a Docker container: everything run smoothly on a
CentOS6 host, while it failed on a CentOS7 host. After a few hours of
debug, I realized the difference came from the order in which folders
were added to the path when executing the following command:
"addpath(genpath('octave_packages'))". The Octave version used is 3.8.2

Here is an excerpt of the octave path in the two situations (printed
with "path()" ) :

Octave's search path contains the following directories:

1. on the CentOS6 host :
octave_packages
octave_packages/tsa-4.2.4
octave_packages/tsa-4.2.4/packinfo
octave_packages/strings-1.1.0
octave_packages/strings-1.1.0/packinfo
octave_packages/java-1.2.8
octave_packages/java-1.2.8/packinfo
octave_packages/statistics-1.1.3
octave_packages/statistics-1.1.3/packinfo
octave_packages/gsl-1.0.8
octave_packages/gsl-1.0.8/packinfo

[...]


2. on the CentOS7 host :
octave_packages/fixed-0.7.10
octave_packages/fixed-0.7.10/packinfo
octave_packages/sockets-1.0.8
octave_packages/sockets-1.0.8/packinfo
octave_packages/general-1.3.1
octave_packages/general-1.3.1/packinfo
octave_packages/financial-0.4.0
octave_packages/financial-0.4.0/packinfo
octave_packages/vrml-1.0.13
octave_packages/vrml-1.0.13/packinfo
octave_packages/audio-1.1.4
octave_packages/audio-1.1.4/packinfo
octave_packages/communications-1.1.1
octave_packages/communications-1.1.1/packinfo
octave_packages/nurbs-1.3.6
octave_packages/nurbs-1.3.6/packinfo
octave_packages/dataframe-0.9.1
octave_packages/dataframe-0.9.1/packinfo
[...]


The order is clearly not the same.

Is this a bug ?... Are there any options that can be given in order to
ensure the exact same order of the folders listed ?

Thank you for your help,

Sorina

--
Sorina Pop, PhD
CNRS Research Engineer
CREATIS
Tel : +33 (0)4 72 44 62 87



Reply | Threaded
Open this post in threaded view
|

Re: Issues with genpath reproducibility

Mike Miller-4
On Thu, Jul 04, 2019 at 16:26:19 +0200, Sorina Camarasu Pop wrote:
> I have recently stumbled on a strange issue when executing an octave
> application inside a Docker container: everything run smoothly on a CentOS6
> host, while it failed on a CentOS7 host. After a few hours of debug, I
> realized the difference came from the order in which folders were added to
> the path when executing the following command:
> "addpath(genpath('octave_packages'))". The Octave version used is 3.8.2

If you are able to upgrade your version of Octave, you will find that
the order is sorted reliably. In Octave version 4.0.0 and later, the
list of directories returned by genpath is sorted by name. In Octave
3.8.2 and earlier versions, it was probably ordered by raw filesystem
traversal order, effectively meaningless.

If you need to continue using Octave 3.8.2, then you should probably
arrange for the list to be sorted in your code if necessary, for example

  strjoin (sort (strsplit (genpath (...), ":")), ":")

When you are able to upgrade later, you can drop that workaround.

--
mike



signature.asc (849 bytes) Download Attachment