help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with genpath reproducibility


From: Mike Miller
Subject: Re: Issues with genpath reproducibility
Date: Fri, 5 Jul 2019 10:18:05 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]