Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an appveyor Windows CI build. #50

Merged
merged 20 commits into from
Dec 14, 2019
Merged
Show file tree
Hide file tree
Changes from 8 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
68 changes: 68 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
environment:

global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
IPOPTDIR: "Ipopt-3.11.0-Win32-Win64-dll"

matrix:
- PYTHON: "C:\\Miniconda-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
CONDA_PY: "27"

- PYTHON: "C:\\Miniconda35-x64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
CONDA_PY: "35"

- PYTHON: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
CONDA_PY: "36"

- PYTHON: "C:\\Miniconda37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
CONDA_PY: "37"

install:
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""

- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""

# This upates conda and installs the necessary packages.
- "%PYTHON%\\Scripts\\conda.exe update --yes conda"
moorepants marked this conversation as resolved.
Show resolved Hide resolved
- "%PYTHON%\\Scripts\\conda.exe config --prepend channels conda-forge"
- '%PYTHON%\\Scripts\\conda.exe install --yes numpy cython future six setuptools sphinx numpydoc mkl'
- "%PYTHON%\\Scripts\\conda.exe update -y --all"
- "%PYTHON%\\Scripts\\conda.exe info"
- "%PYTHON%\\Scripts\\conda.exe list"

# This downloads and extracts a precomplied IPOPT for Windows.
- ps: Start-FileDownload 'https://www.coin-or.org/download/binary/Ipopt/Ipopt-3.11.0-Win32-Win64-dll.7z'
- 7z x Ipopt-3.11.0-Win32-Win64-dll.7z
moorepants marked this conversation as resolved.
Show resolved Hide resolved

# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart the
# parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
moorepants marked this conversation as resolved.
Show resolved Hide resolved

# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

build: false

test_script:
- "%CMD_IN_ENV% python setup.py install"
- '%CMD_IN_ENV% python -c "import ipopt"'
- "%CMD_IN_ENV% python test/examplehs071.py"
- "%CMD_IN_ENV% python test/exception_handling.py"
- "%CMD_IN_ENV% python test/lasso.py"
- "conda.exe install --yes scipy"
- "%CMD_IN_ENV% python test/rosen.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed to work better without the %CMD_IN_ENV% from looking at the AppVeyor builds

13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ def pkgconfig(*packages, **kw):

if sys.platform == 'win32':

IPOPT_INCLUDE_DIRS = ['include/coin', np.get_include()]
if "IPOPTDIR" in os.environ:
ipoptdir = os.environ["IPOPTDIR"]
else:
ipoptdir = ''

IPOPT_INCLUDE_DIRS = [os.path.join(ipoptdir, 'include', 'coin'),
np.get_include()]
IPOPT_LIBS = ['Ipopt-vc8', 'IpOptFSS', 'IpOpt-vc10']
IPOPT_LIB_DIRS = ['lib/x64/ReleaseMKL']
IPOPT_DLL = ['IpOptFSS.dll', 'Ipopt-vc8.dll', 'IpOpt-vc10.dll', 'libiomp5md.dll', 'msvcp100.dll', 'msvcr100.dll']
IPOPT_LIB_DIRS = [os.path.join(ipoptdir, 'lib', 'x64', 'ReleaseMKL')]
IPOPT_DLL = ['IpOptFSS.dll', 'Ipopt-vc8.dll', 'IpOpt-vc10.dll',
'libiomp5md.dll', 'msvcp100.dll', 'msvcr100.dll']
moorepants marked this conversation as resolved.
Show resolved Hide resolved

EXT_MODULES = [
Extension(
Expand Down