Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ install:
conda install conda-forge::openblas>=0.3.0;
conda install local::slycot;
else
CMAKE_GENERATOR="Unix Makefiles" python setup.py install;
CMAKE_GENERATOR="Unix Makefiles" BLA_VENDOR="OpenBLAS" python setup.py install;
fi
#
# coveralls not in conda repos :-(
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enable_language(Fortran)

find_package(PythonLibs REQUIRED)
find_package(NumPy REQUIRED)
#set(BLA_VENDOR "OpenBLAS")
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
message(STATUS "LAPACK: ${LAPACK_LIBRARIES}")
message(STATUS "Slycot version: ${SLYCOT_VERSION}")
Expand Down
8 changes: 2 additions & 6 deletions conda-recipe-openblas/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

cd $RECIPE_DIR/..

# specify where CMAKE will search for lapack and blas
# needs recent cmake (conda's 3.12) and policy CMP0074 NEW
# the ${PREFIX} points to conda-build's host environment
export BLAS_ROOT=${PREFIX}
export LAPACK_ROOT=${PREFIX}
# specify blas vendor should be OpenBLAS
export BLA_VENDOR=OpenBLAS

# ensure we are not building with old cmake files
rm -rf _skbuild
Expand Down
47 changes: 15 additions & 32 deletions conda-recipe-openblas/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,31 @@ build:
string: py{{ environ.get('PY_VER').replace('.', '') }}{{ environ.get('GIT_DESCRIBE_HASH', '') }}_obl_{{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}

requirements:
# TODO: pip possibly required in only *one* of build and host, but which?
build:
- python {{ PY_VER }}
- numpy
- openblas >=0.3.0
- {{ compiler('c') }} # [not osx]
- gcc # [osx]
- {{ compiler('fortran') }} # [linux]
- scikit-build >=0.8.0
- {{ compiler('c') }}
- {{ compiler('fortran') }} # [unix]
- flang # [win]

host:
- python {{ PY_VER }}
- pip
- flang # [win]
- numpy
- openblas >=0.3.0
- libgfortran-ng # [not-win]
- libgcc-ng # [linux]
- scikit-build >=0.8.0
# on Windows, this relies on having visual studio CE 2015
# this link needed quite some searching, please do not delete!
# https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409

- libopenblas
- python
- scikit-build
- pip

run:
- python {{ PY_VER }}
- {{ pin_compatible('numpy') }}
- openblas >=0.3.0
- libgfortran-ng # [not win]
- libgcc-ng # [linux]
- libflang # [win]
- libopenblas

test:
requires:
- python {{PY_VER}}
imports:
- slycot

about:
home: https://github.com/python-control/slycot
license: GPLv2
summary: 'A wrapper for the SLICOT control and systems library'

# on OSX, the SDK for 10.9 is currently needed
# download the 10.9 sdk from https://github.com/phracker/MacOSX-SDKs/releases
# unpack and set environment variable CONDA_BUILD_SYSROOT to that location
home: https://github.com/python-control/Slycot
dev_url: https://github.com/python-control/Slycot
license: GPL-2.0
license_family: GPL
license_file: COPYING
summary: 'Slycot: A wrapper for the SLICOT control and systems library'
13 changes: 3 additions & 10 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
cd %RECIPE_DIR%
cd ..

:: clean old build attempts
:: Clean old build attempts
RD /S /Q _skbuild

set BLAS_ROOT=%PREFIX%
set LAPACK_ROOT=%PREFIX%
set NUMPY_INCLUDE=%PREFIX%\Include
set FC=%BUILD_PREFIX%\Library\bin\flang.exe
set BLA_VENDOR=Intel10_64lp
:: 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
Expand All @@ -19,9 +18,3 @@ if EXIST "%PREFIX%\Scripts\f2py.exe" (
"%PYTHON%" -m pip install . --no-deps --ignore-installed -vv

if errorlevel 1 exit 1

:: Add more build steps here, if they are necessary.

:: See
:: http://docs.continuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.
9 changes: 2 additions & 7 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
cd $RECIPE_DIR/..

# specify where CMAKE will search for lapack and blas
# needs recent cmake (conda's 3.12) and policy CMP0074 NEW
# the ${PREFIX} points to conda-build's host environment
export BLAS_ROOT=${PREFIX}
export LAPACK_ROOT=${PREFIX}
# specify blas vendor should be MKL
export DBLA_VENDOR=Intel10_64lp

# ensure we are not building with old cmake files
rm -rf _skbuild

env

# do the build
$PYTHON -m pip install . --no-deps --ignore-installed -vv
45 changes: 14 additions & 31 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,31 @@ build:
string: py{{ environ.get('PY_VER').replace('.', '') }}{{ environ.get('GIT_DESCRIBE_HASH', '') }}_mkl_{{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}

requirements:
# note: the osx build is with gcc for now, due to problems with the
# conda-supplied clang and library linking see e.g.
# https://github.com/conda-forge/mpi-feedstock issue #4
# conda-forge might have the configuration in place for clang build and link?
# TODO: pip possibly required in only *one* of build and host, but which?
build:
- python {{PY_VER}}
- numpy
- {{ compiler('c') }} # [not osx]
- gcc # [osx]
- {{ compiler('fortran') }} # [linux]
- scikit-build >=0.8.0
- {{ compiler('c') }}
- {{ compiler('fortran') }} # [unix]
- flang # [win]

host:
- python {{ PY_VER }}
- pip
- flang # [win]
- numpy
- mkl
- libgfortran-ng # [not win]
- libgcc-ng # [linux]
- libflang # [win]
- scikit-build >=0.8.0
# on Windows, this relies on having visual studio CE 2015
# this link needed quite some searching, please do not delete!
# https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409
- python
- scikit-build
- pip

run:
- python {{ PY_VER }}
- python
- {{ pin_compatible('numpy') }}
- mkl
- libgfortran-ng # [not win]
- libgcc-ng # [linux]
- libflang # [win]


test:
requires:
- python {{PY_VER}}
imports:
- slycot

about:
home: https://github.com/python-control/slycot
license: GPLv2
summary: 'A wrapper for the SLICOT control and systems library'
home: https://github.com/python-control/Slycot
dev_url: https://github.com/python-control/Slycot
license: GPL-2.0
license_family: GPL
license_file: COPYING
summary: 'Slycot: A wrapper for the SLICOT control and systems library'
24 changes: 6 additions & 18 deletions slycot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ set(PYSOURCE
transform.py ${CMAKE_CURRENT_BINARY_DIR}/version.py)

set(SLYCOT_MODULE "_wrapper")
find_package(PythonExtensions REQUIRED)

set(GENERATED_MODULE
${CMAKE_CURRENT_BINARY_DIR}/${SLYCOT_MODULE}${PYTHON_EXTENSION_MODULE_SUFFIX})

Expand All @@ -130,33 +132,18 @@ add_custom_command(
)

add_library(
${SLYCOT_MODULE} SHARED
${SLYCOT_MODULE} MODULE
SLYCOTmodule.c _wrappermodule.c _wrapper-f2pywrappers.f
"${PYTHON_SITE}/numpy/f2py/src/fortranobject.c"
${FSOURCES})

set(CMAKE_SHARED_LIBRARY_PREFIX "")
if (WIN32)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".pyd")
endif()
set_target_properties(${SLYCOT_MODULE} PROPERTIES
OUTPUT_NAME "_wrapper")
if (WIN32)
target_link_libraries(${SLYCOT_MODULE} PUBLIC
${PYTHON_LIBRARIES} ${LAPACK_LIBRARIES})
endif()
target_link_libraries(${SLYCOT_MODULE}
${LAPACK_LIBRARIES})

if (UNIX)
target_link_libraries(${SLYCOT_MODULE} PUBLIC
${LAPACK_LIBRARIES})

if (APPLE)
set_target_properties(${SLYCOT_MODULE} PROPERTIES
LINK_FLAGS '-Wl,-dylib,-undefined,dynamic_lookup')
string(REGEX REPLACE "^([0-9]+)\.([0-9]+)\.[0-9]+$" "\\1\\2"
PYMAJORMINOR ${PYTHON_VERSION_STRING})
set(CMAKE_SHARED_LIBRARY_SUFFIX ".cpython-${PYMAJORMINOR}m-darwin.so")
message(STATUS "binary module suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set_target_properties(${SLYCOT_MODULE} PROPERTIES
LINK_FLAGS '-Wl,--allow-shlib-undefined')
Expand All @@ -170,6 +157,7 @@ target_include_directories(
${PYTHON_INCLUDE_DIRS}
)

python_extension_module(${SLYCOT_MODULE})
install(TARGETS ${SLYCOT_MODULE} DESTINATION slycot)
install(FILES ${PYSOURCE} DESTINATION slycot)

Expand Down