Skip to content

can't conda build with Python 3.5 on MS Windows #55

Closed

Description

@roryyorke

See https://ci.appveyor.com/project/roryyorke/slycot/build/job/yx6j8yqj0exw1fb2 ; I can reproduce this on my Windows 10 machine.

It looks like numpy>=1.16 and Python=3.5 can't be satisfied from conda-forge.

I tried changing the numpy>=1.16 in conda-recipe-openblas/meta.yaml to >=1.15, 1.14, and 1.13, but got a build error at a later stage; cmake config seems to succeed, but the during build f2py can't be found.

Am I missing something, or is the combination of MS Windows + Python 3.5 not supported, at least with conda-build? It's probably fine if that is the case, but it might be worth adding this info to the 0.3.4 release notes.

On Linux we can build with python 2.7 and 3.5-3.7; see https://travis-ci.org/python-control/Slycot/builds/521333279

Activity

  1. repagh commented on Apr 18, 2019

    @repagh
    Member

    What does a direct build do?
    I found that at some point, f2py changed from being F2PY.BAT to F2PY.EXE, you might need to

    set F2PY=\path\to\f2py.[exe|bat]

    It seems like Conda cannot resolve a set of valid packages in your example. Conda's dependency resolution is still somewhat of a mystery to me.

  2. moorepants commented on Apr 18, 2019

    @moorepants
    Contributor

    Conda forge dropped support for python 3.5, so they may only have numpy packaged for 3.6+ for newer numpy versions.

  3. moorepants commented on Apr 18, 2019

    @moorepants
    Contributor

    numpy>=1.16 needs to be relaxed if possible.

  4. roryyorke commented on Apr 19, 2019

    @roryyorke
    CollaboratorAuthor

    The diff below works on my Windows 10 machine, am testing on Appveyor now.

    IMO this should rather go into CMakeLists.txt (or a custom cmake module), but this is probably enough for 0.3.4.

    I tried using the env. var "NPY_VER" for the if condition, but it was set to 1.11 regardless of numpy version.

    @moorepants, do you know if there's a recommendation for the lower bound on numpy version? Should we just remove the bound? I've entirely arbitrarily chosen 1.13.

    diff --git a/conda-recipe-openblas/bld.bat b/conda-recipe-openblas/bld.bat
    index f5218f4..dfccb15 100644
    --- a/conda-recipe-openblas/bld.bat
    +++ b/conda-recipe-openblas/bld.bat
    @@ -8,7 +8,13 @@ RD /S /Q _skbuild
     set BLAS_ROOT=%PREFIX%
     set LAPACK_ROOT=%PREFIX%
     set NUMPY_INCLUDE=%PREFIX%\Include
    -set F2PY=%PREFIX%\Scripts\f2py.exe
    +:: Prefer f2py.exe, if it exists; this is provided by numpy 1.16 (and, we assume, later)
    +if EXIST "%PREFIX%\Scripts\f2py.exe" (
    +  set F2PY=%PREFIX%\Scripts\f2py.exe
    +) ELSE (
    +:: Otherwise use f2py.bat, which is provided by numpy 1.15 and earlier
    +  set F2PY=%PREFIX%\Scripts\f2py.bat
    +)
     
     "%PYTHON%" setup.py install
     
    diff --git a/conda-recipe-openblas/meta.yaml b/conda-recipe-openblas/meta.yaml
    index cd90047..0b47144 100644
    --- a/conda-recipe-openblas/meta.yaml
    +++ b/conda-recipe-openblas/meta.yaml
    @@ -12,7 +12,7 @@ build:
     requirements:
       build:
         - python {{ PY_VER }}
    -    - numpy >=1.16
    +    - numpy >=1.13
         - openblas >=0.3.0
         - {{ compiler('c') }}       # [not osx]
         - gcc                       # [osx]
    @@ -22,7 +22,7 @@ requirements:
       host:
         - python {{ PY_VER }}
         - flang                     # [win]
    -    - numpy >=1.16
    +    - numpy >=1.13
         - openblas >=0.3.0
         - libgfortran-ng # [not-win]
         - libgcc-ng      # [linux]
    @@ -33,7 +33,7 @@ requirements:
        
       run:
         - python {{ PY_VER }}
    -    - numpy >=1.16
    +    - numpy >=1.13     
         - openblas >=0.3.0
         - libgfortran-ng # [not win]
         - libgcc-ng      # [linux]
    diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat
    index 01aab36..23e8a33 100644
    --- a/conda-recipe/bld.bat
    +++ b/conda-recipe/bld.bat
    @@ -8,7 +8,13 @@ RD /S /Q _skbuild
     set BLAS_ROOT=%PREFIX%
     set LAPACK_ROOT=%PREFIX%
     set NUMPY_INCLUDE=%PREFIX%\Include
    -set F2PY=%PREFIX%\Scripts\f2py.exe
    +:: Prefer f2py.exe, if it exists; this is provided by numpy 1.16 (and, we assume, later)
    +if EXIST "%PREFIX%\Scripts\f2py.exe" (
    +  set F2PY=%PREFIX%\Scripts\f2py.exe
    +) ELSE (
    +:: Otherwise use f2py.bat, which is provided by numpy 1.15 and earlier
    +  set F2PY=%PREFIX%\Scripts\f2py.bat
    +)
     
     "%PYTHON%" setup.py install
     
    diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml
    index 6f62c3c..767fc2e 100644
    --- a/conda-recipe/meta.yaml
    +++ b/conda-recipe/meta.yaml
    @@ -16,7 +16,7 @@ requirements:
       # conda-forge might have the configuration in place for clang build and link?
       build:
         - python {{PY_VER}}
    -    - numpy >=1.16
    +    - numpy >=1.13
         - {{ compiler('c') }}       # [not osx]
         - gcc                       # [osx]
         - {{ compiler('fortran') }} # [linux]
    @@ -25,7 +25,7 @@ requirements:
       host:
         - python {{ PY_VER }}
         - flang                     # [win]
    -    - numpy >=1.16
    +    - numpy >=1.13
         - mkl
         - libgfortran-ng # [not win]
         - libgcc-ng      # [linux]
    @@ -37,7 +37,7 @@ requirements:
     
       run:
         - python {{ PY_VER }}
    -    - numpy >=1.16
    +    - numpy >=1.13
         - mkl
         - libgfortran-ng # [not win]
         - libgcc-ng      # [linux]
  5. moorepants commented on Apr 19, 2019

    @moorepants
    Contributor

    Yes there are minimum numpy versions that should be supported. It is handled by the pin_compatible variable.

    https://conda-forge.org/docs/maintainer/knowledge_base.html#building-against-numpy

  6. moorepants commented on Apr 19, 2019

    @moorepants
    Contributor

    I think it is Numpy 1.9 for linux and osx and numpy 1.11 for windows as the oldest that can be built against and provide forward compatibility.

  7. roryyorke commented on Apr 19, 2019

    @roryyorke
    CollaboratorAuthor

    OK, I've followed the recommendations from that conda-forge page. It seems to work on Linux and Windows. All of this is on #56, which I'll merge tomorrow unless someone objects. I think that's all for 0.3.4.

  8. roryyorke commented on Apr 23, 2019

    @roryyorke
    CollaboratorAuthor

    Fixed by #56

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