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

Conversation

moorepants
Copy link
Collaborator

@moorepants moorepants commented Dec 9, 2019

Fixes #30

@moorepants moorepants closed this Dec 9, 2019
@moorepants moorepants reopened this Dec 9, 2019
@moorepants moorepants closed this Dec 9, 2019
@moorepants moorepants reopened this Dec 9, 2019
@moorepants
Copy link
Collaborator Author

I have this: https://ci.appveyor.com/project/moorepants/cyipopt but I can't seem to get the build to trigger from this PR. Not sure why.

@moorepants
Copy link
Collaborator Author

@matthias-k I think this webhook https://ci.appveyor.com/api/github/webhook?id=hgg9s1eq0t051n75 needs to be added to the github webhook settings for pulls for this repo. I don't have access to the setttings for this repo.

@apommel
Copy link
Contributor

apommel commented Dec 9, 2019

The source link for Ipopt should rather be https://www.coin-or.org/download/binary/Ipopt/Ipopt-3.11.0-Win32-Win64-dll.7z as the one you included is not the one with DLL. There might be a way to make this one work though, but not with the current setup.

appveyor.yml Outdated Show resolved Hide resolved
appveyor.yml Outdated Show resolved Hide resolved
appveyor.yml Outdated Show resolved Hide resolved
@matthias-k
Copy link
Collaborator

@matthias-k I think this webhook https://ci.appveyor.com/api/github/webhook?id=hgg9s1eq0t051n75 needs to be added to the github webhook settings for pulls for this repo. I don't have access to the setttings for this repo.

@moorepants I added the github webhook for PRs, however I'm not sure about the other settings:

  • should the webhook be form-encoded or JSON-encoded?
  • does it need a secret?

@moorepants moorepants closed this Dec 9, 2019
@moorepants moorepants reopened this Dec 9, 2019
@moorepants
Copy link
Collaborator Author

@matthias-k It works, that is all that is needed. Thanks!

@moorepants

This comment has been minimized.

@moorepants
Copy link
Collaborator Author

@apommel Can you help me debug this failed import? I'm not super familiar with Windows.

appveyor.yml Show resolved Hide resolved
appveyor.yml Outdated Show resolved Hide resolved
appveyor.yml Outdated Show resolved Hide resolved
appveyor.yml Outdated
Comment on lines 62 to 68
- "%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

moorepants and others added 2 commits December 10, 2019 22:36
Co-Authored-By: Aurélien Pommel <46231231+apommel@users.noreply.github.com>
Co-Authored-By: Aurélien Pommel <46231231+apommel@users.noreply.github.com>
appveyor.yml Outdated Show resolved Hide resolved
@moorepants
Copy link
Collaborator Author

Error from the Py36 build:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IIpopt-3.11.0-Win32-Win64-dll\include\coin -IC:\Miniconda36-x64\lib\site-packages\numpy\core\include -IC:\Miniconda36-x64\include -IC:\Miniconda36-x64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" /Tcsrc\cyipopt.c /Fobuild\temp.win-amd64-3.6\Release\src\cyipopt.obj
cyipopt.c
c:\miniconda36-x64\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
src\cyipopt.c(600): fatal error C1083: Cannot open include file: 'IpStdCInterface.h': No such file or directory
C:\Miniconda36-x64\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\projects\cyipopt\src\cyipopt.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
Command exited with code 1

@moorepants
Copy link
Collaborator Author

Error in the Py27 build:

python -c "import ipopt"
C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.py:3: UserWarning: Module cyipopt was already imported from C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.pyc, but c:\projects\cyipopt is being added to sys.path
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "ipopt\__init__.py", line 43, in <module>
    from cyipopt import *
  File "build\bdist.win-amd64\egg\cyipopt.py", line 7, in <module>
  File "build\bdist.win-amd64\egg\cyipopt.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
Command exited with code 1

Co-Authored-By: Aurélien Pommel <46231231+apommel@users.noreply.github.com>
@moorepants
Copy link
Collaborator Author

Here is a full build from PY27 and the attempted import that fails:

python setup.py install
running install
running bdist_egg
running egg_info
creating ipopt.egg-info
writing requirements to ipopt.egg-info\requires.txt
writing ipopt.egg-info\PKG-INFO
writing top-level names to ipopt.egg-info\top_level.txt
writing dependency_links to ipopt.egg-info\dependency_links.txt
writing manifest file 'ipopt.egg-info\SOURCES.txt'
reading manifest file 'ipopt.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c' under directory 'src'
no previously-included directories found matching 'include*'
no previously-included directories found matching 'lib*'
writing manifest file 'ipopt.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\ipopt
copying ipopt\ipopt_wrapper.py -> build\lib.win-amd64-2.7\ipopt
copying ipopt\version.py -> build\lib.win-amd64-2.7\ipopt
copying ipopt\__init__.py -> build\lib.win-amd64-2.7\ipopt
running build_ext
cythoning src/cyipopt.pyx to src\cyipopt.c
building 'cyipopt' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\src
C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\projects\cyipopt\include\coin -IC:\Miniconda-x64\lib\site-packages\numpy\core\include -IC:\Miniconda-x64\include -IC:\Miniconda-x64\PC /Tcsrc\cyipopt.c /Fobuild\temp.win-amd64-2.7\Release\src\cyipopt.obj
cyipopt.c
c:\miniconda-x64\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
src\cyipopt.c(3887) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'Index', possible loss of data
src\cyipopt.c(3945) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'Index', possible loss of data
C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\projects\cyipopt\lib\x64\ReleaseMKL /LIBPATH:C:\Miniconda-x64\libs /LIBPATH:C:\Miniconda-x64\PCbuild\amd64 /LIBPATH:C:\Miniconda-x64\PC\VS9.0\amd64 Ipopt-vc8.lib IpOptFSS.lib IpOpt-vc10.lib /EXPORT:initcyipopt build\temp.win-amd64-2.7\Release\src\cyipopt.obj /OUT:build\lib.win-amd64-2.7\cyipopt.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\src\cyipopt.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\src\cyipopt.pyd.manifest
cyipopt.obj : warning LNK4197: export 'initcyipopt' specified multiple times; using first specification
   Creating library build\temp.win-amd64-2.7\Release\src\cyipopt.lib and object build\temp.win-amd64-2.7\Release\src\cyipopt.exp
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
copying build\lib.win-amd64-2.7\cyipopt.pyd -> build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\ipopt
copying build\lib.win-amd64-2.7\ipopt\ipopt_wrapper.py -> build\bdist.win-amd64\egg\ipopt
copying build\lib.win-amd64-2.7\ipopt\version.py -> build\bdist.win-amd64\egg\ipopt
copying build\lib.win-amd64-2.7\ipopt\__init__.py -> build\bdist.win-amd64\egg\ipopt
byte-compiling build\bdist.win-amd64\egg\ipopt\ipopt_wrapper.py to ipopt_wrapper.pyc
byte-compiling build\bdist.win-amd64\egg\ipopt\version.py to version.pyc
byte-compiling build\bdist.win-amd64\egg\ipopt\__init__.py to __init__.pyc
creating stub loader for cyipopt.pyd
byte-compiling build\bdist.win-amd64\egg\cyipopt.py to cyipopt.pyc
installing package data to build\bdist.win-amd64\egg
running install_data
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\IpOptFSS.dll -> build\bdist.win-amd64\egg\
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\Ipopt-vc8.dll -> build\bdist.win-amd64\egg\
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\IpOpt-vc10.dll -> build\bdist.win-amd64\egg\
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\libiomp5md.dll -> build\bdist.win-amd64\egg\
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\msvcp100.dll -> build\bdist.win-amd64\egg\
copying C:\projects\cyipopt\lib\x64\ReleaseMKL\msvcr100.dll -> build\bdist.win-amd64\egg\
creating build\bdist.win-amd64\egg\EGG-INFO
copying ipopt.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying ipopt.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ipopt.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ipopt.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying ipopt.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
C:\Miniconda-x64\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\projects\cyipopt\src\cyipopt.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\ipopt-0.2.0.dev0-py2.7-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing ipopt-0.2.0.dev0-py2.7-win-amd64.egg
Copying ipopt-0.2.0.dev0-py2.7-win-amd64.egg to c:\miniconda-x64\lib\site-packages
Adding ipopt 0.2.0.dev0 to easy-install.pth file
Installed c:\miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg
Processing dependencies for ipopt==0.2.0.dev0
Searching for setuptools==42.0.2.post20191201
Best match: setuptools 42.0.2.post20191201
Adding setuptools 42.0.2.post20191201 to easy-install.pth file
Installing easy_install-script.py script to C:\Miniconda-x64\Scripts
Installing easy_install.exe script to C:\Miniconda-x64\Scripts
Using c:\miniconda-x64\lib\site-packages
Searching for future==0.18.2
Best match: future 0.18.2
Adding future 0.18.2 to easy-install.pth file
Installing pasteurize-script.py script to C:\Miniconda-x64\Scripts
Installing pasteurize.exe script to C:\Miniconda-x64\Scripts
Installing futurize-script.py script to C:\Miniconda-x64\Scripts
Installing futurize.exe script to C:\Miniconda-x64\Scripts
Using c:\miniconda-x64\lib\site-packages
Searching for six==1.13.0
Best match: six 1.13.0
Adding six 1.13.0 to easy-install.pth file
Using c:\miniconda-x64\lib\site-packages
Searching for Cython==0.29.14
Best match: Cython 0.29.14
Adding Cython 0.29.14 to easy-install.pth file
Installing cython-script.py script to C:\Miniconda-x64\Scripts
Installing cython.exe script to C:\Miniconda-x64\Scripts
Installing cygdb-script.py script to C:\Miniconda-x64\Scripts
Installing cygdb.exe script to C:\Miniconda-x64\Scripts
Installing cythonize-script.py script to C:\Miniconda-x64\Scripts
Installing cythonize.exe script to C:\Miniconda-x64\Scripts
Using c:\miniconda-x64\lib\site-packages
Searching for numpy==1.15.4
Best match: numpy 1.15.4
Adding numpy 1.15.4 to easy-install.pth file
Using c:\miniconda-x64\lib\site-packages
Finished processing dependencies for ipopt==0.2.0.dev0
python -c "import ipopt"
C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.py:3: UserWarning: Module cyipopt was already imported from C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.pyc, but c:\projects\cyipopt is being added to sys.path
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "ipopt\__init__.py", line 43, in <module>
    from cyipopt import *
  File "build\bdist.win-amd64\egg\cyipopt.py", line 7, in <module>
  File "build\bdist.win-amd64\egg\cyipopt.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
Command exited with code 1

@moorepants
Copy link
Collaborator Author

For the MKL error in the PY36 build this may be helpful: https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#numpy-mkl-library-load-failed

@apommel
Copy link
Contributor

apommel commented Dec 11, 2019

python -c "import ipopt"
C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.py:3: UserWarning: Module cyipopt was already imported from C:\Miniconda-x64\lib\site-packages\ipopt-0.2.0.dev0-py2.7-win-amd64.egg\cyipopt.pyc, but c:\projects\cyipopt is being added to sys.path
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "ipopt\__init__.py", line 43, in <module>
    from cyipopt import *
  File "build\bdist.win-amd64\egg\cyipopt.py", line 7, in <module>
  File "build\bdist.win-amd64\egg\cyipopt.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
Command exited with code 1

Actually, I also get an error on my current working cyipopt installation (with Python 3.7). The message is different though:

INTEL MKL ERROR: The operating system cannot run %1. mkl_intel_thread.dll.
Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.

I remember that on the previous PR, this line was at some point also failing on Travis even though the import was when working correctly within the test files (see job 64). I wonder why this behaves differently here.
Could you try omitting this line just to see if it does the same thing on the test scripts?

@moorepants
Copy link
Collaborator Author

That same error is present on the py36 and py37 builds I believe.

@moorepants
Copy link
Collaborator Author

py36 and py37 passed when the import test was skipped. That's positive.

@apommel
Copy link
Contributor

apommel commented Dec 11, 2019

I thought the issue had to do with activating the environment, but even after dealing with that the issue is still there on my side concerning the import from the command line. It seems to be a weird bug from windows as it can import from files.

Concerning Python 2.7, it seems like the DLL are not loaded for some reason. I will try to test it myself tomorrow to see if it's a Python 2.7 problem or if it comes from AppVeyor. As for 3.5, well I don't know, this part seems to work without issues on the other versions.

@apommel
Copy link
Contributor

apommel commented Dec 11, 2019

On Python 2.7, the setup seems to only produce an egg file ipopt-0.2.0.dev0-py2.7-win-amd64.egg. The DLL are packaged inside, but I guess that's what must cause problems in some way.

setup.py Outdated Show resolved Hide resolved
@apommel

This comment has been minimized.

@apommel
Copy link
Contributor

apommel commented Dec 12, 2019

Even better solution: adding the flag zip_safe=False in setup in setup.py. This way, the module is still properly packaged without being zipped, so the DLL are working properly on Python 2.7. The installation can be done with python setup.py install.

Co-Authored-By: Aurélien Pommel <46231231+apommel@users.noreply.github.com>
appveyor.yml Outdated Show resolved Hide resolved
appveyor.yml Show resolved Hide resolved
moorepants and others added 2 commits December 13, 2019 20:13
Co-Authored-By: Aurélien Pommel <46231231+apommel@users.noreply.github.com>
@moorepants
Copy link
Collaborator Author

All green! Thanks @apommel for the help!

@moorepants moorepants merged commit 8065634 into mechmotum:master Dec 14, 2019
@moorepants moorepants deleted the appveyor branch December 14, 2019 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup CI on Appveyor to test the Windows installation
3 participants