Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dd90059
working on getting 'C' version for td04ad checked
repagh Jun 4, 2018
72a9875
test adding
repagh Jun 6, 2018
46171e5
work in progress
repagh Jun 14, 2018
f897e75
- corrected TD04AD.f to handle the case of 'C' and static gain tf
repagh Jun 15, 2018
3c6f49f
another fix
repagh Jun 15, 2018
253ed42
working TD04AD.f, does not crash any more on edge cases (N=0, NR=0),
repagh Jun 20, 2018
54f0510
fix conda recipe, anaconda 5
repagh Jun 22, 2018
a2298fd
delete separate build.sh/bld.bat
repagh Jun 23, 2018
6d30bd0
further testing
repagh Jun 26, 2018
f01ba18
- re-worked windows build to use Flang fortran and vc14 linkage
repagh Jun 26, 2018
a47bf6f
Merge remote-tracking branch 'python-control/master'
repagh Jul 1, 2018
b7d4048
Merge remote-tracking branch 'python-control/master'
repagh Jul 11, 2018
2ee5339
Conversion to building with scikit-build. Uses cmake for better
repagh Jul 11, 2018
be8cdfa
Add a comment on the many manual selections needed for Windows build.
repagh Jul 11, 2018
078b928
- install cmake and scikit-build with .travis.yml
repagh Jul 26, 2018
dc746ec
pip scikit-build to right location!
repagh Jul 26, 2018
0875919
hack a pip install for scikit-build
repagh Aug 14, 2018
01d85d3
- corrected link libraries for Linux in CMakeLists.txt
repagh Aug 15, 2018
84b4d4a
work in progress status
repagh Aug 15, 2018
0af0b31
- a working version? at least conda build succeeded once
repagh Aug 15, 2018
0b513ad
windows version seems to work now
repagh Aug 16, 2018
5738b11
environment variable use removed again
repagh Aug 16, 2018
04889ce
need fortran compiler env var
repagh Aug 16, 2018
790cc9e
Further tweaks, not works on OSX
repagh Aug 17, 2018
a237ce6
to be sure, also remove dependencies of scikit-build on windows
repagh Aug 17, 2018
d4df101
convert the build system to use scikit-build
repagh Aug 17, 2018
eae3c4b
Merge branch 'build-with-scikit-build' of https://github.com/repagh/S…
repagh Aug 17, 2018
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ before_install:
- if [[ $TEST_CONDA == 0 ]]; then
sudo apt-get install liblapack-dev libblas-dev;
sudo apt-get install gfortran;
sudo apt-get install cmake;
fi

install:
Expand Down Expand Up @@ -46,6 +47,9 @@ install:
# Make sure that fortran compiler can find conda libraries
#
- export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib";

# pip install scikit-build, one in conda repos is currently too old
- pip install https://github.com/scikit-build/scikit-build/archive/0.7.1.zip
#
# Install the slycot package (two ways, to improve robustness). For the
# conda version, need to install lapack from conda-forge (no way to specify
Expand All @@ -58,6 +62,7 @@ install:
conda config --append channels conda-forge;
conda build --python "$TRAVIS_PYTHON_VERSION" conda-recipe;
conda install -c conda-forge lapack;
conda install -c conda-forge cmake;
conda install --override-channels -c local slycot;
else
LAPACKLIBS=lapack:blas python setup.py install;
Expand Down
50 changes: 50 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CMake file for use in conjunction with scikit-build

cmake_minimum_required(VERSION 3.4.0)

if (CMAKE_VERSION VERSION_GREATER "3.11.0")
cmake_policy(SET CMP0074 NEW)
endif()

project(slycot VERSION ${SLYCOT_VERSION})

# Fortran detection fails on windows, use the CMAKE_C_SIMULATE flag to
# force success
if(WIN32)
set(CMAKE_Fortran_SIMULATE_VERSION 19.0)
# set(CMAKE_Fortran_COMPILER_FORCED TRUE)
# set(CMAKE_C_COMPILER_VERSION 19.0)
endif()

enable_language(C)
enable_language(Fortran)

find_package(PythonLibs REQUIRED)
find_package(NumPy REQUIRED)
#set(BLA_VENDOR "OpenBLAS")
find_package(LAPACK REQUIRED)
message(STATUS "LAPACK: ${LAPACK_LIBRARIES}")
message(STATUS "Slycot version: ${SLYCOT_VERSION}")

# find python, standard packages, F2PY find flaky on Windows
if (NOT WIN32)
find_package(F2PY REQUIRED)
endif()

# pic option for flang not correct, remove for Windows
if (WIN32)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "")
endif()

# base site dir, use python installation for location specific includes
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from distutils.sysconfig import get_python_lib as pl; print(pl())"
OUTPUT_VARIABLE PYTHON_SITE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE ${PYTHON_SITE})
endif()

add_subdirectory(slycot)

81 changes: 77 additions & 4 deletions conda-recipe-openblas/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,89 @@
cd %RECIPE_DIR%
cd ..

set F77=%BUILD_PREFIX%\Library\bin\flang.exe
set F90=%BUILD_PREFIX%\Library\bin\flang.exe
:: until scikit-build on conda-forge is updated to 0.6.1 or higher ...
"%PYTHON%" -m pip install "https://github.com/scikit-build/scikit-build/archive/0.7.1.zip"

:: indicating fortran compiler is essential
set FC=%BUILD_PREFIX%\Library\bin\flang.exe

:: The batch file created by conda-build sets a load of environment variables
:: Building worked fine without conda; apparently one or more of these
:: variables produce test & link failures. Resetting most of these here
set ARCH=
set BUILD=
set BUILD_PREFIX=
set CMAKE_GENERATOR=
set CommandPromptType=
set CPU_COUNT=
set DISTUTILS_USE_SDK=
set folder=
set cpu_optimization_target=
set fortran_compiler=
set Framework40Version=
set FrameworkDir=
set FrameworkDIR64=
set FrameworkVersion=
set FrameworkVersion64=
set ignore_build_only_deps=
set CFLAGS=
set CXXFLAGS=
set cxx_compiler=
set c_compiler=
set INCLUDE=
set LDFLAGS_SHARED=
set LIBPATH=
set LIB=;%LIB%
set MSSdk=
set MSYS2_ARG_CONV_EXCL=
set MSYS2_ENV_CONV_EXCL=
set NETFSXDIR=
set PIP_IGNORE_INSTALLED=
set platform=
set WindowsLibPath=
set WindowsSdkDir=
set CYGWIN_PREFIX=
set SRC_DIR=
set STDLIB_DIR=
set SUBDIR=
set SYS_PREFIX=
set target_platform=
set UCRTVersion=
set UniversalCRTSdkDir=
set VCINSTALLDIR=
set vc=
set win=
set VisualStudioVersion=
set VSINSTALLDIR=
set VSREGKEY=
set VS_MAJOR=
set VS_VERSION=
set VS_YEAR=
set WindowsSDKLibVersion=
set WindowsSDKVersion=
set WindowsSDKExecutablePath_x64=
set WindowsSDKExecutablePath_x86=

:: information on remaining variables
set

set BLAS_ROOT=%CONDA_PREFIX%
set LAPACK_ROOT=%CONDA_PREFIX%

"%PYTHON%" setup.py build
"%PYTHON%" setup.py install

:: remove scikit-build again, don't want to include that
"%PYTHON%" -m pip uninstall --yes scikit-build
"%PYTHON%" -m pip uninstall --yes packaging
"%PYTHON%" -m pip uninstall --yes pyparsing
"%PYTHON%" -m pip uninstall --yes setuptools
"%PYTHON%" -m pip uninstall --yes six
"%PYTHON%" -m pip uninstall --yes wheel

if errorlevel 1 exit 1

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

:: See
:: http://docs.continuum.io/conda/build.html
:: http://docs.continlsuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.
20 changes: 20 additions & 0 deletions conda-recipe-openblas/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@

cd $RECIPE_DIR/..
# HACK, until scikit-build is updated to 0.7.1 or higher ...
$PYTHON -m pip install \
https://github.com/scikit-build/scikit-build/archive/0.7.1.zip

env

# specify where CMAKE will search for lapack and blas
# needs recent cmake (conda's 3.12) and policy CMP0074 NEW
export BLAS_ROOT=${CONDA_PREFIX}
export LAPACK_ROOT=${CONDA_PREFIX}

$PYTHON setup.py install

# same HACK, remove again
$PYTHON -m pip uninstall --yes scikit-build
$PYTHON -m pip uninstall --yes packaging
$PYTHON -m pip uninstall --yes pyparsing
$PYTHON -m pip uninstall --yes setuptools
$PYTHON -m pip uninstall --yes six
$PYTHON -m pip uninstall --yes wheel
29 changes: 20 additions & 9 deletions conda-recipe-openblas/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
package:
name: slycot
version: "0.3.3"
version: "0.3.4"

build:
number: 0

requirements:
host:
- numpy
- openblas >=0.3.0
- python {{PY_VER}}
- cmake
- pip
- flang # [win]
- {{ compiler('c') }} # [win]
- {{ compiler('fortran') }} # [not win]
- libflang # [win]
- libgfortran # [not win]
- python

- numpy
build:
- {{ compiler('fortran') }} # [not win]
- {{ compiler('c') }} # [win]
- flang # [win]
- numpy
- pyparsing
- setuptools
- wheel
- six
- packaging
- libgfortran # [not win]
- openblas >=0.3.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
Expand All @@ -28,7 +35,11 @@ requirements:

test:
requires:
- numpy
- openblas
- python {{PY_VER}}
- libgfortran # [not win]
- libflang # [win]
imports:
- slycot

Expand Down
7 changes: 7 additions & 0 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
cd %RECIPE_DIR%
cd ..

:: until scikit-build is updated to 0.7.1 or higher ...
"%PYTHON%" -m pip install "https://github.com/scikit-build/scikit-build/archive/0.7.1.zip"

set F77=%BUILD_PREFIX%\Library\bin\flang.exe
set F90=%BUILD_PREFIX%\Library\bin\flang.exe
set LAPACKLIBS=lapack:blas

"%PYTHON%" setup.py build
"%PYTHON%" setup.py install

:: remove scikit-build again, don't want to include that
"%PYTHON%" -m pip uninstall --yes scikit-build

if errorlevel 1 exit 1

:: Add more build steps here, if they are necessary.
Expand Down
6 changes: 5 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
cd $RECIPE_DIR/..
export LAPACKLIBS=lapack:blas
# HACK, until scikit-build is updated to 0.7.1 or higher ...
$PYTHON -m pip install \
https://github.com/scikit-build/scikit-build/archive/0.7.1.zip
$PYTHON setup.py install
# same HACK
$PYTHON -m pip uninstall --yes scikit-build
7 changes: 6 additions & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ requirements:
- libflang # [win]
- libgfortran # [not win]
- python {{PY_VER}}
- pip
- cmake

build:
- {{ compiler('fortran') }} # [not win]
Expand All @@ -20,7 +22,6 @@ requirements:
# 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

run:
- numpy
- lapack
Expand All @@ -29,7 +30,11 @@ requirements:

test:
requires:
- numpy
- lapack
- python {{PY_VER}}
- libgfortran # [not win]
- libflang # [win]
imports:
- slycot

Expand Down
Loading