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

Executable for Windows #800

Closed
petrasvestartas opened this issue Oct 30, 2024 · 12 comments
Closed

Executable for Windows #800

petrasvestartas opened this issue Oct 30, 2024 · 12 comments

Comments

@petrasvestartas
Copy link

petrasvestartas commented Oct 30, 2024

We have been using lpopt for compas_cra package:
conda create -n cra python=3.10 pyomo=6.4.2 ipopt=3.14.9 compas

This works for mac and linux, but not for windows, so we also need to install very first version ipopt=3.11.1
It was working for multiple years for research, but now completely broke.

Is there any way that you could provide executable for 3.14.9 version too?

@svigerske
Copy link
Member

There are windows binaries available at https://github.com/coin-or/Ipopt/releases/tag/releases%2F3.14.9.
But I don't know the situation for conda packages.

@petrasvestartas
Copy link
Author

@svigerske Is there anyone could take a look at the compas_cra package in more detail?
We are bit confused by lpop on windows...

@svigerske
Copy link
Member

Maybe check with someone from https://compas.dev/#/association ? I don't know anything about this.

@petrasvestartas
Copy link
Author

petrasvestartas commented Oct 30, 2024

We are from compas, we have no clue...
Pyomo just do not work as before with Ipopt.

@svigerske
Copy link
Member

So what does "do not work" mean in detail? What is going wrong where?

@petrasvestartas
Copy link
Author

I get this error, first I though that it was executable not found, but now I have a doubt about it, since conda installed it:

(cra) C:\brg\2_code\compas_cra>C:/Users/petras/anaconda3/envs/cra/python.exe c:/brg/2_code/compas_cra/tests/test_cra_penalty.py
Aeq: (6, 12)
Aeq: (6, 16)
Afr: (32, 16)
1
1
finished setup... now trying to solve it...
ERROR: Solver (ipopt) returned non-zero return code (3221225501)
ERROR: Solver log: Ipopt 3.11.1: tol=1e-08 constr_viol_tol=1e-07
acceptable_tol=1e-06 acceptable_constr_viol_tol=1e-05

**************************************************************************
**** This program contains Ipopt, a library for large-scale nonlinear
optimization.
 Ipopt is released as open source code under the Eclipse Public License
 (EPL).
         For more information visit http://projects.coin-or.org/Ipopt
**************************************************************************
****

NOTE: You are using Ipopt by default with the MUMPS linear solver.
      Other linear solvers might be more efficient (see Ipopt
      documentation).


This is Ipopt version 3.11.1, running with linear solver mumps.

Number of nonzeros in equality constraint Jacobian...:      112 Number of
nonzeros in inequality constraint Jacobian.:      128 Number of nonzeros
in Lagrangian Hessian.............:       54

Total number of variables............................:       26
                     variables with only lower bounds:       12
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:       26 Total
number of inequality constraints...............:       48
        inequality constraints with only lower bounds:        4
   inequality constraints with lower and upper bounds:       12
        inequality constraints with only upper bounds:       32

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du
alpha_pr  ls
   0 4.0000000e+002 1.00e+000 2.00e+004  -1.0 0.00e+000    -  0.00e+000
   0.00e+000   0

@svigerske
Copy link
Member

Looks like Ipopt just crashed. Can you just try with a current Ipopt version?

@petrasvestartas
Copy link
Author

By replacing them it also crashes without any message:


(cra) C:\brg\2_code\compas_cra>C:/Users/petras/anaconda3/envs/cra/python.exe c:/brg/2_code/compas_cra/tests/test_cra_penalty.py
Aeq:  (6, 12)
Aeq:  (6, 16)
Afr:  (32, 16)
1
1
finished setup... now trying to solve it...
ERROR: Solver (ipopt) returned non-zero return code (3221225781)
Traceback (most recent call last):
  File "c:\brg\2_code\compas_cra\tests\test_cra_penalty.py", line 36, in <module>
    test_cra_penalty()
  File "c:\brg\2_code\compas_cra\tests\test_cra_penalty.py", line 21, in test_cra_penalty
    cra_penalty_solve(assembly, density=1)
  File "C:\Users\petras\anaconda3\envs\cra\lib\site-packages\compas_cra\equilibrium\cra_penalty_pyomo.py", line 146, in cra_penalty_solve
    result = solver.solve(model, tee=verbose)
  File "C:\Users\petras\anaconda3\envs\cra\lib\site-packages\pyomo\opt\base\solvers.py", line 596, in solve
    raise ApplicationError(
pyomo.common.errors.ApplicationError: Solver (ipopt) did not exit normally

@svigerske
Copy link
Member

Maybe you can retrieve the .nl file that Pyomo generates and passes on to Ipopt and see whether Ipopt also crashes when run on the .nl file independently of cra and pyomo.

If not (or anyway), check the Windows event log whether it gives some details.

@petrasvestartas
Copy link
Author

I think I might have a solution based on your initial .exe release version. I will triple check and let you know. You might actually have helped to solve this issue... phew...

@traversaro
Copy link
Contributor

For reference, we have an issue in conda-forge/ipopt-feedstock#55 for tracking the packaging of the ipopt executable on Windows in conda-forge.

@petrasvestartas
Copy link
Author

petrasvestartas commented Oct 30, 2024

@traversaro @svigerske

I did the following:

conda create -n cra python=3.10 pyomo=6.4.2 ipopt=3.14.9 compas
conda activate cra
pip install compas_assembly compas_cra

The above works on mac but not on windows, because conda is not shipping the executables. Then I did the following.
I unzipped the compiled executable from the first link of: https://github.com/coin-or/Ipopt/releases/tag/releases%2F3.14.9.
and placed bin folder contents to:
C:\Users\petras\anaconda3\envs\cra_dev\Library\bin

All my code works!
This is issue is solved. Thank you @svigerske !

We will ship these executables separately from pyomo conda distributables, sadly it is not the default behavior. But this workaround works.

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

No branches or pull requests

3 participants