[Coin-ipopt] Compiling an AMPL executable using Cygwin

Andreas Waechter andreasw at watson.ibm.com
Mon Sep 16 14:16:38 EDT 2002


Dear Arvind,

Many thanks for your message and for telling me about the compilation
problems.

>   I had some trouble figuring out the compilation of the AMPL executable
> for windows using Cygwin. I had no trouble in compiling the Fortran
> executable. The compilation of the AMPL solver library was the bottleneck
> in producing the executable. The file fpinit.c produced some errors when
> compiled as such. I figured it was due to some system definitions that
> were done at the beginning of the file. I got around this by adding the
> following line,
>
> #undef MSpc
>
> after the following line in the code,
>
> #endif /*MSpc*/
>
> This seemed to do the trick. The executable runs fine. I am not sure if
> this is benign. Do you have any ideas? I used the latest version of the
> solvers.tar from the netlib AMPL repository.

You are correct, the Ampl Solver Library does not have instructions for
compiling it under CygWin, but I wrote the Makefile in
COIN/Ipopt/OBJECTS/OTHERS/ASL so that modifications of the regular ASL
makefile are automatically performed and allow the compilation.  However,
as you discovered, I forgot to include a definition in the
COIN/Ipopt/SOURCES/Makefiles/Makedefs.CYGWIN file (sorry) to take care of
the problem regarding fpinit.c (in effect this does exactly what you
suggest above).  That file is now updated in the CVS respository, and the
change will reflect in tomorrow's tarball.  With this, no modification of
the ASL source code should be necessary.  Please let me know if it still
doesn't work for you.

>   Just as an aside I had to add the following null definitions
> LIBOBJS =
> LIB =
> in the Makefile under the following directories,
> OBJECTS/IPOPT/Fortran_example/
> OBJECTS/IPOPT/AMPL_interface/
> OBJECTS/OTHERS/ASL/
>
> Without these I had errors originiating from Makefile.trgs present in
> OBJECTS/
> Might be a good idea to incorporate this in future releases.

I'm not quite sure if I understand what you mean.  I have never observed
any compilation problems with undefined Makefile variables, and I just
tried to compile the executable corresponding to the directories on Cygwin
that you mention above; without problems.

GNU make does not require you to add null definitions; it simply
substitutes the value of an undefined variable with an empty string.  Are
you using GNU make?  Which version?  One source of confusion could be that
the IPOPT makefiles by default assume that the GNU make executable is
called 'gmake'.  You can either change this in your Makefile.defs, or you
can add a link such as (for Cygwin)

cd /usr/local/bin
ln -s /usr/bin/make.exe gmake.exe

Please let me know if you still observe the compilation problems with the
makefiles as they are provided in the IPOPT package.  If so, it would be
good if you could tell me exactly what you did, and how I can reproduce
this problem.

Many thanks again for your message!

Andreas




More information about the Coin-ipopt mailing list