COUENNE with Julia

hello there,

I am trying to install and use Couenne on Windows 10 so I can use it in my Julia program, Does anyone has experience with installing solvers. It is my first time to do something like that. What I understand is that I have to go through the steps on Git Hub and that this solver is not found under any name in julia library, is that correct?
GitHub Link:

I have no experience with Couenne but I think https://github.com/rdeits/CouenneNL.jl is what you’re looking for.

1 Like

This is what I was looking for
Thank you

Alternatively, download Couenne from here: https://ampl.com/products/solvers/open-source/ and use it with https://github.com/jump-dev/AmplNLWriter.jl.

1 Like

Thank you @odow

general question pls …with JuMP
I need to define a NL expression that included the real part of an imaginary expression, but I get this message " Unrecognized function “real” used in nonlinear expression."
This means that real can not be used with JuMP ?! right and what can I do instead ?

You cannot use complex numbers with JuMP. You need to use the rectangular or polar form.

2 Likes

Aha…I see
Thanks

I downloaded the 64bit windows binaries from ampl.com , yet I got this error msg when I tried running the .exe runtime

m = JuMP.Model(() -> AmplNLWriter.Optimizer(“C:/Users/mayar.madboly/Downloads/couenne-win64”))

I have put my path to couenne but I get a strange error msg saying that .Optimizer is not defined !!

m = JuMP.Model(JuMP.with_optimizer(“C:/Users/mayar.madboly/Downloads/couenne-win64.exe”, print_level =0))

Optimizer constructor is invalid…error msg

What is the output of ] add AmplNLWriter@0.6.0?

The full syntax should be

model = Model(
    () -> AmplNLWriter.Optimizer(
        "C:/Users/mayar.madboly/Downloads/couenne-win64/couenne.exe"
    )
)

assuming you extracted the couenne-win64.zip so the path matches.

I had the same problem on windows.
Its a C++ redistributable issue, related to couenne compilation on windows.

If you look online for VCRUNTIME140_1.dll error there is a bunch of forum entries.

I solved my issue downloading: Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019.
from here:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

One of these:

might be enough.

2 Likes

I have seen on AMPL WEBSITE a vide explaining how to use the AMPL ide with the ampl language…
Have you considered this as an option to use the couenne solver or even other solvers?
I am new to julia and I want to decide either to continue on julia or switch to another language
What do you think?
@odow
@joaquimg

Note that AMPL is a commercial product. Your university may have licenses though.

I’m somewhat biased with my preference for JuMP over AMPL…

2 Likes

About usage explanations,

You can check: https://github.com/jump-dev/JuMPTutorials.jl for many tutorial, they complement the docs https://jump.dev/JuMP.jl/v0.21.1/index.html very well.

For a video intro: https://www.youtube.com/watch?v=RJsZDk-27mk&list=PLP8iPy9hna6QkxelZiDOc5HnVGvQmEsLX&index=20&t=0s
(might be slightly out of date, you can double check in the manual if something does not go smoothly)

About suggestions same here… I would alway go for JuMP, but just like @odow, I am biased…

1 Like

About the IDE, I like VSCode with the julia extension: https://github.com/julia-vscode/julia-vscode

1 Like

@odow @joaquimg
I am stuck here: What does that mean…I tried typing export in my cmd but it didnot work
Add the BARON_EXEC environment variable pointing to the BARON executable (full path, including file name as it differs across platforms).


I have windows OS
Is that what I have to do ?
@odow @joaquimg

decided to start with BARON and move to COUENNE
This is what I made to add the variable
I still get error when trying to build BARON

“Error building BARON:
│ ERROR: LoadError: Unable to locate BARON executable. Make sure the solver has been separately downloaded, and that you properly set the BARON_EXEC environment variabl”