octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #54287] error when running function 'units' fr


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #54287] error when running function 'units' from 'miscellaneous' toolbox
Date: Wed, 11 Jul 2018 08:05:54 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48

Update of bug #54287 (project octave):

              Item Group: Missed Error or Warning => Unexpected Error       
             Assigned to:                lostbard => None                   
                 Release:                   4.4.0 => dev                    

    _______________________________________________________

Follow-up Comment #2:

Confirmed with Octave-5.0.0 on Win 7.
The lack of octave_config_info is a showstopper on 5.0.0, but that can be
worked around, the actual problem lies deeper and I'm unsure whether it is an
octave-forge or an mxe-octave cross-build issue.

Firstly, the octave-config_info() call in subfunc check_units (L.115-122) can
be replaced by __octave_config_info__(). 
With that out of the way, I get similar errors:

units: cannot open units data file
'/home/philip/devel/octdev/mxe/mxe_64b20180621/usr/x86_64-w64-mingw32/share/units/definitions.units'.
 No such file or directory
:


... where Octave-5.0.0's units files on my Windows 7 box live in
C:\Programs\Octave\Octave-5.0.0_20180711\share\units

Clearly the install directories for the cross-build on the linux side (before
zipping it up into the installer) get to be hard-coded in the units.exe
program, see attached pic.

Next, specifying the units files on the command line gets me this:

>> system ('units -f
C:\Programs\Octave\Octave-5.0.0_20180711\share\units\definitions.units')
units: cannot find locale map--program directory not set
ans =  1


.. and asking for program info gives a few clues:

>> system ("units -I")
GNU Units version 2.16
with readline, without utf8, locale Dutch_Netherlands

units program is C:\Programs\Octave\OCTAVE~1.0_2\bin/units.exe

Environment variable UNITSFILE not set
Default units data file is
'/home/philip/devel/octdev/mxe/mxe_64b20180621/usr/x86_64-w64-mingw32/s
hare/units/definitions.units'
*** Units data file not found ***

Environment variable MYUNITSFILE not set
Personal units data file is 'C:\Users\philip/unitdef.units'
  (file does not exist)

Default readline history file is 'C:\Users\philip/.units_history'

Environment variable UNITSLOCALEMAP not set
Default locale map is
'/home/philip/devel/octdev/mxe/mxe_64b20180621/usr/x86_64-w64-mingw32/share/
units/locale_map.txt'
*** Locale map not found ***


Copyright (C) 2017 Free Software Foundation, Inc.
GNU Units comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Units
under the terms of the GNU General Public License.

ans = 0


Setting the environment variables UNITSFILE and UNITSLOCALEMAP makes the units
program and the units function work:

>> setenv ("UNITSFILE",
'C:\Programs\Octave\Octave-5.0.0_20180711\share\units\definitions.units')
>> setenv ("UNITSLOCALEMAP",
'C:\Programs\Octave\Octave-5.0.0_20180711\share\units\locale_map.txt')
>> units ('bar', 'Pa')
ans =  100000
>>

A workaround could be to automatically set these environment variables when
the miscellaneous package gets loaded. Quite an involved operation.

I tried adding the actual location of the definitions.units file using
units.exe's -f command line option to the template command in L.121 and L.130,
to no avail.
Same for the locale.

Adding the setenv() calls to the start of units.m gives:

>> units ('bar','Pa')
units: cannot open units file
'/c/Programs/Octave/Octave-5.0.0_20180711/share/units/definitions.units'.  No
such file or directory
units: cannot open units file
'/c/Programs/Octave/Octave-5.0.0_20180711/share/units/definitions.units'.  No
such file or directory
ans =  100000


..so that does work to some extent.

I'm running out of time, hopefully my experiments may help someone to get
further.


(file #44539)
    _______________________________________________________

Additional Item Attachment:

File name: units_binary.PNG               Size:116 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54287>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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