Skip to content

test_mc01td_D failure on Windows #102

Description

@roryyorke

See attached build log. The failure is

======================================================================
FAIL: test_mc01td_D (test_mc.test_mc)
test_mc01td_D: test discrete option
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\Users\rory\Documents\slycot\slycot\tests\test_mc.py", line 27, in test_mc01td_D
    self.assertEqual(stable, 1)
AssertionError: -1 != 1

----------------------------------------------------------------------

Build script:

set CONDA=%HOMEDRIVE%%HOMEPATH%\Miniconda3\condabin\conda.bat

echo %CONDA%

CALL %CONDA% --version
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% activate base
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% remove --yes --all --name build-slycot-py35
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% create --quiet --yes --channel conda-forge --name build-slycot-py35 python=3.5 scikit-build flang numpy scipy
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% activate build-slycot-py35
@if errorlevel 1 exit /b %ERRORLEVEL%

cd slycot
@if errorlevel 1 exit /b %ERRORLEVEL%

git describe --always --dirty
@if errorlevel 1 exit /b %ERRORLEVEL%

git status --ignored
@if errorlevel 1 exit /b %ERRORLEVEL%

@rem a hack; no f2py.exe
where f2py > %TMP%\F2PYPATH.txt
@if errorlevel 1 exit /b %ERRORLEVEL%
set /P F2PYPATH=< %TMP%\F2PYPATH.txt
@if errorlevel 1 exit /b %ERRORLEVEL%

python setup.py install -- -DF2PY_EXECUTABLE=%F2PYPATH%
@if errorlevel 1 exit /b %ERRORLEVEL%

cd slycot\tests
python -m unittest -v

build log: slycot-win-build.txt

Activity

  1. bnavigator commented on Apr 13, 2020

    @bnavigator
    Collaborator

    Can you switch to pytest instead of old unittest?

  2. bnavigator commented on Apr 13, 2020

    @bnavigator
    Collaborator

    C STABLE (output) LOGICAL
    C Contains the value .TRUE. if P(x) is stable and the value
    C .FALSE. otherwise (see also NUMERICAL ASPECTS).

    logical intent(out) :: stable

    Slycot/slycot/math.py

    Lines 50 to 51 in ac53a0a

    stable : int
    Equal to 1 if P(x) if stable, 0 otherwise.

    out = _wrapper.mc01td(dico,dp,p)

    def test_mc01td(self):
    """ test_mc01td: doc example
    data from http://slicot.org/objects/software/shared/doc/MC01TD.html
    """
    (dp, stable, nz) = mc01td('C', 4, [2, 0, 1, -1, 1])
    self.assertEqual(dp, 4)
    self.assertEqual(stable, 0)
    self.assertEqual(nz, 2)
    def test_mc01td_D(self):
    """ test_mc01td_D: test discrete option """
    (dp, stable, nz) = mc01td('D', 3, [1, 2, 3, 4])
    self.assertEqual(dp, 3)
    self.assertEqual(stable, 1)
    self.assertEqual(nz, 0)
    (dp, stable, nz) = mc01td('D', 3, [4, 3, 2, 1])
    self.assertEqual(dp, 3)
    self.assertEqual(stable, 0)
    self.assertEqual(nz, 3)

    There is something wrong with the documented but nowhere defined mapping of logical to int. Does the Windows compiler map logical differently?

  3. bnavigator commented on Apr 13, 2020

    @bnavigator
    Collaborator
  4. roryyorke commented on Apr 13, 2020

    @roryyorke
    CollaboratorAuthor

    If I comment out that assertion, the test passes.

    We could check in slycot.math.mc01td for out[1] being non-zero, and make the output 0 or 1 (though I don't know if .FALSE. always maps to 0). Or we could change the Fortran function to output an integer 0 or 1, instead of logical type.

    "armflang" has .TRUE. set to -1, according to docs from mid-2018 [1]. I couldn't find anything else about flang conventions, neither via Google, nor flang --help.

    Are we using flang in any of the Travis CI builds?

    [1] https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/Arm-Fortran-Compiler-Reference-guide/Arm_Fortran_Compiler_Reference_101380_1840_00_en.pdf

  5. bnavigator commented on Apr 13, 2020

    @bnavigator
    Collaborator

    I am already working on a PR. Stand by.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions