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:
https://github.com/coin-or/Couenne

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: Open Source Solvers - AMPLAMPL 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:

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 Introduction · JuMP very well.

For a video intro: JuMP-dev 2019 | Juan Pablo Vielma | Introductory Tutorial on Julia and JuMP - YouTube
(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: GitHub - julia-vscode/julia-vscode: Julia extension for Visual Studio Code

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).

https://docs.oracle.com/en/database/oracle/r-enterprise/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html#GUID-DD6F9982-60D5-48F6-8270-A27EC53807D0
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”