Using AMPL Extended Functions with Global Optimization Solvers

Hello,

I am trying to use the AMPL extended functions in my model. My code has the lines:

load amplgsl.dll;
function gsl_cdf_beta_P;

Since my problem is nonlinear, I need to use a global optimizer such as BARON, LINDO Global, LGO, or Couenne. But none of these solvers seems to work when I try to include the gsl_cdf_beta_P function in the formulation. I tried implementing the steps from the previous discussions:

That is, I tried downloading an older version of the amplgsl.dll and setting the system environment variable ampl_funclibs to the location of amplgsl.dll, but none worked. When I try to run my code, I get the following error messages for the aforementioned solvers, respectively:

BARON does not support operation function call
BARON 25.8.5 (2025.08.05): operation not supported by BARON

BARON 25.8.5 (2025.08.05): maxtime=3600
barstats

function gsl_cdf_beta_P not available
exit value 4

=======

Reading C:\\Users\\pelin\\AppData\\Local\\Temp\\at18472.nl in NL format

Bad  NL  format
Errorcode=2029:  Specified feature is not yet supported or not compatible with the model type.
exit value 1

=======

LGO: timelim=3600

function gsl_cdf_beta_P not available
exit value 4

=======

Couenne 0.5.8 – an Open-Source solver for Mixed Integer Nonlinear Optimization
couenne: max_cpu_time=3600

exit value 18446744072635810825

I would really appreciate any help on how to proceed.

Thank you!

Pelin

Global nonlinear solvers like BARON, LINDO Global, or Couenne only work for certain kinds of expressions that they are designed to handle. Basically, those are expressions that can be built out of simple arithmetic operators and elementary functions like log and cos. (The exact list depends on the solver.) Imported GSL functions like gsl_cdf_beta_P are not recognized, resulting in the various error messages that you see.

LGO uses a different algorithmic approach that allows it to accept just about any continuous function in the objective and constraint expressions. However, LGO is not currently working with GSL functions; this issue has been reported, and we’ll let you know of any progress in resolving it.

Local nonlinear solvers (Knitro, Ipopt, CONOPT, MINOS, SNOPT, . . . ) can work with any smooth function, which includes most GSL functions. But of course, they are not guaranteed to find the global optimum, except in special convex cases. (Knitro does have a feature that tries to improve the solution by repeating the optimization from different starting points.)

1 Like