Hello,
I've compiled a function into a .DLL file, but none of the methods for loading libraries into AMPL seems to be working. I'm using version 20051214 (x86_win32) (as distributed by ILOG with CPLEX). When I start ampl, it automatically loads the ampltabl.dll that is located on its run dir. I've tried to load my library (aparam.dll) following these methods:
1) Through the -i switch when starting ampl, but it doesn't seem to have an '-i' option:
C:\AMPL100>ampl -i C:\AMPL100\aparam.dll
AMPL Version 20051214 (x86_win32)
invalid option -i
Usage: ampl [options] [file [file...]]
..
('ampl -i?' returns the same error).
2) Through the 'load' command:
ampl: load C:\AMPL100\aparam.dll;
Error executing "load" command:
Cannot load library C:\AMPL100\aparam.dll
or C:\AMPL100\aparam.dll/amplfunc.dll
or any other library.
and this happens even when I try to load ampltabl.dll (unload; load C:\AMPL100\ampltabl.dll;) which runs just fine when it is loaded by default on startup.
3) Naming my aparam.dll as amplfunc.dll so that it is loaded by default doesn't work either.
The only solution that has worked is renaming aparam.dll as ampltabl.dll, and then it is loaded by default when I start ampl and I'm able to use my functions. (but now I've lost the ones in the original ampltabl.dll which I need to r/w to database). So apparently my ampl is hard coded to load ampltabl.dll on startup. Does anyone know if there is some setup file or env option to specify other libraries to load on startup?
Thanks in advance,
Rodolfo
ps. I have ilog maintenance support but they haven't been able to help me
The user-defined function feature isn't useful for CPLEX, and so ILOG disabled this feature in the version of AMPL that they sold. (Apparently they did not want to support a feature that could only be used with other companies' solvers.)
It is normally possible to switch from ILOG's version of AMPL to a version that does support user-defined functions. Details are available by contacting in...@ampl.com.
Bob Fourer