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

Windows support via msys2 #18

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
92c891b
WIP: Windows support via binary download.
richardotis Sep 18, 2017
aea3b32
WIP: recipe: Try to fix lint
richardotis Sep 18, 2017
f175c5f
MNT: Re-rendered with conda-smithy 2.2.1
richardotis Sep 18, 2017
120e6e8
MNT: Re-rendered with conda-smithy 2.4.0
richardotis Sep 18, 2017
579a963
MNT: Fix recipe selector lint
richardotis Sep 18, 2017
6ad1532
WIP: Fix sha256 of win32 build and copy LICENSE and README into worki…
richardotis Sep 20, 2017
457925e
Merge branch 'master' of https://github.com/richardotis/ipopt-feedstock
richardotis Sep 20, 2017
6f60045
WIP: Add Windows compile and link test
richardotis Sep 20, 2017
d878f8a
WIP: Try moving the compile test into the build phase to work around …
richardotis Sep 20, 2017
0066642
WIP: Revert compile test attempt
richardotis Sep 20, 2017
ce12268
WIP: Windows source build support
richardotis Nov 21, 2017
ab28343
WIP: Path fixes
richardotis Nov 23, 2017
4b24bb3
Merge remote-tracking branch 'upstream/master' into windows_support
richardotis Mar 22, 2018
dc1b3cd
STY: Fix selector lint
richardotis Mar 22, 2018
a3d4330
MNT: Re-rendered with conda-smithy 2.4.5
conda-forge-admin Mar 23, 2018
26187e3
MNT: Re-rendered with conda-smithy 3.1.5 and pinning 2018.05.22
conda-forge-admin Jun 3, 2018
430d481
Move location of test files to avoid conflict with conda build
richardotis Jun 3, 2018
422c20b
Remove cd to removed test directory
richardotis Jun 3, 2018
5ad6403
Merge branch 'master' into windows_support
richardotis Jun 4, 2018
a43b03b
Merge branch 'master' into windows_support
richardotis Jul 12, 2018
23f20da
MNT: Re-rendered with conda-smithy 3.1.6 and pinning 2018.07.01
conda-forge-admin Jul 12, 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
56 changes: 56 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This file was automatically generated by conda-smithy. To update a component of this
# file, make changes to conda-forge.yml and/or recipe/meta.yaml, and run
# "conda smithy rerender".

environment:

BINSTAR_TOKEN:
# The BINSTAR_TOKEN secure variable. This is defined canonically in conda-forge.yml.
secure: ipv/06DzgA7pzz2CIAtbPxZSsphDtF+JFyoWRnXkn3O8j7oRe3rzqj3LOoq2DZp4

matrix:
- CONFIG: win_c_compilervs2008cxx_compilervs2008
CONDA_INSTALL_LOCN: C:\Miniconda36-x64

- CONFIG: win_c_compilervs2015cxx_compilervs2015
CONDA_INSTALL_LOCN: C:\Miniconda36-x64


# We always use a 64-bit machine, but can build x86 distributions
# with the TARGET_ARCH variable.
platform:
- x64

install:
# If there is a newer build queued for the same PR, cancel this one.
- cmd: |
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/master/recipe/ff_ci_pr_build.py', 'ff_ci_pr_build.py')"
ff_ci_pr_build -v --ci "appveyor" "%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%" "%APPVEYOR_BUILD_NUMBER%" "%APPVEYOR_PULL_REQUEST_NUMBER%"
del ff_ci_pr_build.py

# Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.)
- cmd: rmdir C:\cygwin /s /q

# Add path, activate `conda` and update conda.
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda.exe update --yes --quiet conda

- cmd: set PYTHONUNBUFFERED=1

# Add our channels.
- cmd: conda.exe config --set show_channel_urls true
- cmd: conda.exe config --remove channels defaults
- cmd: conda.exe config --add channels defaults
- cmd: conda.exe config --add channels conda-forge

# Configure the VM.
- cmd: conda.exe install -n root --quiet --yes conda-forge-ci-setup=1
- cmd: run_conda_forge_build_setup

# Skip .NET project specific build phase.
build: off

test_script:
- conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet
deploy_script:
- cmd: upload_or_check_non_existence .\recipe conda-forge --channel=main -m .ci_support\%CONFIG%.yaml
9 changes: 0 additions & 9 deletions .ci_support/linux_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,3 @@ cxx_compiler:
- toolchain_cxx
fortran_compiler:
- toolchain_fort
metis:
- '5.1'
openblas:
- 0.2.20
pin_run_as_build:
metis:
max_pin: x.x
openblas:
max_pin: x.x.x
9 changes: 0 additions & 9 deletions .ci_support/osx_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,3 @@ macos_machine:
- x86_64-apple-darwin13.4.0
macos_min_version:
- '10.9'
metis:
- '5.1'
openblas:
- 0.2.20
pin_run_as_build:
metis:
max_pin: x.x
openblas:
max_pin: x.x.x
9 changes: 9 additions & 0 deletions .ci_support/win_c_compilervs2008cxx_compilervs2008.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
c_compiler:
- vs2008
cxx_compiler:
- vs2008
fortran_compiler:
- flang
zip_keys:
- - c_compiler
- cxx_compiler
9 changes: 9 additions & 0 deletions .ci_support/win_c_compilervs2015cxx_compilervs2015.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
c_compiler:
- vs2015
cxx_compiler:
- vs2015
fortran_compiler:
- flang
zip_keys:
- - c_compiler
- cxx_compiler
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Current build status

[![Linux](https://img.shields.io/circleci/project/github/conda-forge/ipopt-feedstock/master.svg?label=Linux)](https://circleci.com/gh/conda-forge/ipopt-feedstock)
[![OSX](https://img.shields.io/travis/conda-forge/ipopt-feedstock/master.svg?label=macOS)](https://travis-ci.org/conda-forge/ipopt-feedstock)
![Windows disabled](https://img.shields.io/badge/Windows-disabled-lightgrey.svg)
[![Windows](https://img.shields.io/appveyor/ci/conda-forge/ipopt-feedstock/master.svg?label=Windows)](https://ci.appveyor.com/project/conda-forge/ipopt-feedstock/branch/master)

Current release info
====================
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
mkdir build
cd build

rem rm /mingw-w64/bin/make.exe
bash -c "CXXDEFS=-DCOIN_USE_MUMPS_MPI_H ADD_CXXFLAGS='-I/mingw-w64/include -L/mingw-w64/lib -L/mingw-w64/bin' ../configure --build=x86_64-w64-mingw32 --disable-linear-solver-loader --with-blas-lib='-lopenblas' --with-mumps-lib='-ldmumps -lmumps_common -lpord -lgfortran' --enable-dependency-linking --prefix=/mingw-w64"
Copy link
Member

Choose a reason for hiding this comment

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

disabling the linear solver loader is a bad idea - that's important functionality if you care at all about performance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take another look. I was getting unrelenting segmentation faults trying to get the linear solver loader to work, but I'm fully willing to admit the possibility of user error.

Copy link
Member

Choose a reason for hiding this comment

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

It can be picky about finding the runtime libraries IIRC, and how the solver you're trying to load was built. I've forgotten what the status is of HSL providing Windows binaries to academic users. Dynamically loading the MKL version of Pardiso may also be flaky

rem cp /mingw-w64/bin/mingw32-make.exe /mingw-w64/bin/make.exe
make clean
make test
cd src\Interfaces
make libipopt.dll
cd ..\..
rem rm /mingw-w64/bin/make.exe

make install
bash -c "/usr/bin/install -m 644 src/Interfaces/libipopt.dll /mingw-w64/bin"


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.
File renamed without changes.
15 changes: 15 additions & 0 deletions recipe/dll_makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/Interfaces/Makefile.in b/src/Interfaces/Makefile.in
index 1c6d8a0..b79f8d0 100644
--- a/src/Interfaces/Makefile.in
+++ b/src/Interfaces/Makefile.in
@@ -479,6 +479,10 @@ clean-libLTLIBRARIES:
libipopt.la: $(libipopt_la_OBJECTS) $(libipopt_la_DEPENDENCIES)
$(CXXLINK) -rpath $(libdir) $(libipopt_la_LDFLAGS) $(libipopt_la_OBJECTS) $(libipopt_la_LIBADD) $(LIBS)

+libipopt.dll: $(libipopt_la_OBJECTS) $(libipopt_la_DEPENDENCIES)
+ $(CXXLINK) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -static-libgcc -static-libstdc++ -shared -o $@ \
+-Wl,-rpath,$(libdir) $(libipopt_la_LDFLAGS) $(libipopt_la_OBJECTS) -static -lipopt -ldmumps -lmumps_common -lopenblas -lgfortran
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)

47 changes: 27 additions & 20 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,56 @@
package:
name: {{ name|lower }}
version: {{ version }}

source:
fn: {{ name }}-{{ version }}.tar.gz
url: http://www.coin-or.org/download/pkgsource/{{ name }}/{{ name }}-{{ version }}.tgz
sha256: {{ sha256 }}
patches:
- ipopt.patch

- ipopt.patch # [not win]
- dll_makefile.patch # [win]
Copy link
Member

Choose a reason for hiding this comment

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

configure with --enable-shared, shouldn't need to manually patch makefiles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that I have a Windows-compatible configure script from upstream to do this the right way.

Copy link
Member

Choose a reason for hiding this comment

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

You do. I wrote the patches upstream that enabled it, 5ish years ago.

build:
number: 0
skip: True # [win]
number: 0
number: 2
features:
- blas_{{ variant }}
- blas_{{ variant }} # [not win]

requirements:
build:
- {{ compiler('fortran') }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- ampl-mp
- ampl-mp # [not win]
- mumps
- metis
- scotch
- blas 1.1 {{ variant }}
- openblas
- metis 5.1.* # [not win]
- scotch # [not win]
Copy link
Member

Choose a reason for hiding this comment

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

there's no direct dependency on scotch on unix either

- gcc # [osx]
- blas 1.1 {{ variant }} # [not win]
- openblas 0.2.20|0.2.20.* # [not win]
- m2w64-openblas # [win]
- posix # [win]
- patch # [win]

run:
- ampl-mp
- ampl-mp # [not win]
- mumps
- metis
- scotch
- blas 1.1 {{ variant }}
- openblas
- metis 5.1.* # [not win]
- scotch # [not win]
- libgfortran # [not win]
- blas 1.1 {{ variant }} # [not win]
- openblas 0.2.20|0.2.20.* # [not win]
- m2w64-openblas # [win]

test:
files:
- test
- cpp_example.cpp
- cpp_example.hpp
- MyNLP.cpp
- MyNLP.hpp
- mytoy.nl

requires:
- toolchain
- toolchain # [not win]
- m2w64-toolchain # [win]
- posix # [win]

about:
home: https://projects.coin-or.org/Ipopt/
Expand Down
5 changes: 5 additions & 0 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
g++ -I%LIBRARY_PREFIX%/mingw-w64/include/coin -c -o cpp_example.o cpp_example.cpp
g++ -I%LIBRARY_PREFIX%/mingw-w64/include/coin -c -o MyNLP.o MyNLP.cpp
g++ -L%LIBRARY_PREFIX%/mingw-w64/bin -L%LIBRARY_PREFIX%/mingw-w64/lib -lipopt -lstdc++ -I%LIBRARY_PREFIX%/mingw-w64/include/coin -o cpp_example.exe cpp_example.o MyNLP.o

cpp_example.exe | grep -q "Optimal Solution"
1 change: 0 additions & 1 deletion recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
ipopt mytoy.nl | grep -q "Optimal Solution"

# Test linking against the ipopt library
cd test

${CXX} -I$PREFIX/include/coin -c -o cpp_example.o cpp_example.cpp
${CXX} -I$PREFIX/include/coin -c -o MyNLP.o MyNLP.cpp
Expand Down