CIL: ctests fail on Windows due to module problem

I’m building CIL on Windows (!) with the SIRF-SuperBuild and conda according to https://github.com/SyneRBI/SIRF/wiki/Building-SIRF-and-CIL-with-conda.

After https://github.com/SyneRBI/SIRF-SuperBuild/pull/950 , it succesfully builds and installs, and imports (yay!). However, ctest fails for all tests with always the same error:

======================================================================
ERROR: test_TranslateFunction (unittest.loader._FailedTest.test_TranslateFunction)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_TranslateFunction
Traceback (most recent call last):
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\unittest\loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\unittest\loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "C:\Users\krisf\Documents\devel\buildConda2\sources\CIL\Wrappers\Python\test\test_TranslateFunction.py", line 20, in <module>
    from utils import initialise_tests
  File "C:\Users\krisf\Documents\devel\buildConda2\sources\CIL\Wrappers\Python\test\utils.py", line 95, in <module>
    from cil.framework import cilacc
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\site-packages\cil\framework\__init__.py", line 19, in <module>
    from .cilacc import cilacc
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\site-packages\cil\framework\cilacc.py", line 33, in <module>
    cilacc = ctypes.cdll.LoadLibrary(dll)
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\ctypes\__init__.py", line 471, in LoadLibrary
    return self._dlltype(name)
           ~~~~~~~~~~~~~^^^^^^
  File "C:\Users\krisf\miniconda3\envs\cilsirfbuild\Lib\ctypes\__init__.py", line 380, in __init__
    if '/' in name or '\\' in name:
       ^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

We’re currently using 4f6e3cfb0648d08071974eba35c1369a892d4924 by default, but the same problem occurs with master.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 21 (21 by maintainers)

Most upvoted comments

You can actually help get it merged by confirming the tests work for you!

it didn’t work… I’ll put this in #2145 as it no longer seems appropriate here.

However, I’m hoping that you guys can test this further as I’ve run out of time really. (It’s just a miniconda install on Windows 11…)

@KrisThielemans can you try the pip install again? I just updated the RUNTIME path.

That worked. The DLL is now in $Env:CONDA_PREFIX\Lib\site-packages\cil\lib, and there’s no .lib anymore.

I mean import cil.framework worked. I have no idea how to run tests in the pip installed version.

@KrisThielemans the wiki suggests to pass -DCMAKE_INSTALL_PREFIX:PATH="$CONDA_PREFIX".

But you seem to have passed -DCMAKE_INSTALL_PREFIX:PATH=$Env:CONDA_PREFIX/Library which may be the origin of the repeated Library?