To load an external program and call it from AMPL statements, you need to wrap it in a C function following the instructions for "User-defined functions" in Section 4 of Hooking Your Solver to AMPL. This facility allows for passing arguments to the external program and getting return values.
You can also invoke an external binary by using AMPL's shell command, described in Section A.21 of the AMPL book. The external program is then spawned as a separate process, however, and communication must be by files.
Bob Fourer
am...@googlegroups.com