<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:14pt"><div>Hi Stefan:<br>I did the upgrades, and everything now works like a charm. Thanks for all the help - it has been very generous of you to guide me on problems with compilers, third party source code etc.<br>Krish<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Stefan Vigerske <stefan@math.hu-berlin.de><br><b><span style="font-weight: bold;">To:</span></b> Krish Krishnan <rkrishnan8216@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> ipopt mailing list <ipopt@list.coin-or.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, August 3,
2009 6:04:36 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Ipopt] Problems in compiling for Windows<br></font><br>
Hi,<br><br>thanks, now things are much clearer.<br>The drand48 symbols is used in metis, not in ipopt.<br>There also has been a fix to the metis build system that works exactly<br>on your issue.<br>Can you update to Ipopt 3.7.0, or use at least release 1.0.2 of<br>ThirdParty/Metis?<br>Or you just run configure again with the option ADD_CFLAGS="-D__VC__".<br>That should do the same.<br><br>The config_ipopt.h file is written by configure.<br><br>Stefan<br><br>Krish Krishnan wrote:<br>> Hi Stefan:<br>> <br>> Here is the output when I try to make the test examples:<br>> <br>> <br>> test; make test<br>> make[2]: Entering directory <br>> <br>> `/cygdrive/d/Ipopt-3.6.1_MUMPS/Ipopt-3.6.1/Ipopt/test'<br>> /bin/sh ../../libtool --tag=CXX <br>> <br>> --mode=link cl -MT -O2 -nologo -EHsc -GR -wd4996 -D_CRT_SECURE_NO_DEPRECATE -DNDEBUG <br>> <br>> -o hs071_cpp.exe hs071_main.obj hs071_nlp.obj
../src/Interfaces/libipopt.la -link <br>> <br>> /NODEFAULTLIB:libc.lib <br>> cl -MT -O2 -nologo -EHsc -GR -wd4996 -D_CRT_SECURE_NO_DEPRECATE <br>> <br>> -DNDEBUG -o hs071_cpp.exe hs071_main.obj hs071_nlp.obj <br>> <br>> d:/Ipopt-3.6.1_MUMPS/Ipopt-3.6.1/Ipopt/src/Interfaces/.libs/libipopt.lib -link <br>> <br>> /NODEFAULTLIB:libc.lib<br>> cl : Command line warning D9035 : option 'o' has been deprecated and <br>> <br>> will be removed in a future release<br>> libipopt.lib(initpart.obj) : error LNK2019: unresolved external symbol _drand48 referenced <br>> <br>> in function ___GrowBisection<br>> libipopt.lib(graph.obj) : error LNK2001: unresolved external symbol _drand48<br>> libipopt.lib(minitpart.obj) : error LNK2001: unresolved external symbol _drand48<br>> libipopt.lib(minitpart2.obj) : error LNK2001: unresolved external symbol _drand48<br>> libipopt.lib(util.obj) : error LNK2019:
unresolved external symbol _srand48 referenced in <br>> <br>> function ___InitRandom<br>> hs071_cpp.exe : fatal error LNK1120: 2 unresolved externals<br>> make[2]: *** [hs071_cpp.exe] Error 2<br>> make[2]: Leaving directory <br>> <br>> `/cygdrive/d/Ipopt-3.6.1_MUMPS/Ipopt-3.6.1/Ipopt/test'<br>> make[1]: *** [unitTest] Error 2<br>> make[1]: Leaving directory `/cygdrive/d/Ipopt-3.6.1_MUMPS/Ipopt-3.6.1/Ipopt'<br>> make: *** <br>> <br>> [tests] Error 2<br>> <br>> <br>> <br>> Also here are the relevant parts of config_ipopt.h<br>> <br>> <br>> /* Define to 1 if function drand48 is available */<br>> /* #undef HAVE_DRAND48 */<br>> <br>> DRAND48 is not to be found anywhere else in this file.<br>> Is this file rewritten with every configure command or with every make command?<br>> <br>> Thanks <br>> Krish<br>> <br>> <br>> <br>> <br>>
________________________________<br>> From: Stefan Vigerske <<a ymailto="mailto:stefan@math.hu-berlin.de" href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>><br>> To: Krish Krishnan <<a ymailto="mailto:rkrishnan8216@yahoo.com" href="mailto:rkrishnan8216@yahoo.com">rkrishnan8216@yahoo.com</a>><br>> Cc: ipopt mailing list <<a ymailto="mailto:ipopt@list.coin-or.org" href="mailto:ipopt@list.coin-or.org">ipopt@list.coin-or.org</a>><br>> Sent: Monday, August 3, 2009 2:10:45 PM<br>> Subject: Re: [Ipopt] Problems in compiling for Windows<br>> <br>> Hi,<br>> <br>>> I finally was able to compile Ipopt with the Intel Fortran Compiler (version 11). I then went to config_ipopt.h looking for #define HAVE_DRAND48, but this is not present in the file. I anyway uncommented #undef HAVE_DRAND48 and tried a make tests. But this failed because of unresolved externals drand48 and
srand48. I next tried #defien HAVE_DRAND48 0, but this too was of no use. This was not a problem when I first compiled Ipopt with Intel version 10 and MSVC 2005. So I wonder what else I can do to compile the examples and link them with libIpopt.lib. Thanks.<br>> <br>> Can you say where the unresolved externals appear, i.e., which file or<br>> function wants to use it?<br>> If there is no #define HAVE_DRAND48 in config_ipopt.h, then Ipopt should<br>> not use it. See Ipopt/src/Common/IpUtils.cpp, from line 140 on.<br>> <br>> Stefan<br>> <br>>> Krish<br>>><br>>><br>>><br>>><br>>> ________________________________<br>>> From: Stefan Vigerske <<a ymailto="mailto:stefan@math.hu-berlin.de" href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>><br>>> To: Krish Krishnan <<a ymailto="mailto:rkrishnan8216@yahoo.com"
href="mailto:rkrishnan8216@yahoo.com">rkrishnan8216@yahoo.com</a>><br>>> Cc: ipopt mailing list <<a ymailto="mailto:ipopt@list.coin-or.org" href="mailto:ipopt@list.coin-or.org">ipopt@list.coin-or.org</a>><br>>> Sent: Thursday, July 30, 2009 6:19:10 PM<br>>> Subject: Re: [Ipopt] Problems in compileing for Windows<br>>><br>>> Hi,<br>>><br>>>> Thanks. I moved the code to another machine that had the Intel Fortran Compiler without MKL. This time around, the BLAS and LAPACK code was compiled and I had no problem creating libipopt.lib. So the issue definitely has something to do with the MKL part of the fortran compiler. <br>>> If you do not want Ipopt to use MKL, but build your own blas and lapack,<br>>> try configuring with the options --with-blas=BUILD and --with-lapack=BUILD.<br>>><br>>>> When I try to link to the newly created library, however, I get the
linker error unresolved external symbol _drand48 and _srand48. Do you have any idea if there are any other libraries I should pull in. (Perhaps these are not part of the Microsoft Visual C++ setup)<br>>> Now it depends on which compiler you used on which machine.<br>>> drand48 and srand48 are for random number generation and configure<br>>> checks which one are available and then uses them.<br>>> So probably you did not use the same C++ compiler on your two machines?<br>>> You can play around with the #ifdef's in Ipopt/inc/config_ipopt.h to<br>>> have Ipopt use a different random number generator function. That is, on<br>>> your 2nd machine, you comment out the line #define HAVE_DRAND48, rebuild<br>>> and hope that it will work with one of the other two routines.<br>>> These are enabled by #define HAVE_STD__RAND and #define HAVE_RAND. Maybe<br>>> they are available in the MS VC++ on
the first machine.<br>>><br>>> Stefan<br>>><br>>>> Thanks<br>>>> Krish<br>>>><br>>>><br>>>><br>>>><br>>>> ________________________________<br>>>> From: Stefan Vigerske <<a ymailto="mailto:stefan@math.hu-berlin.de" href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>><br>>>> To: Krish Krishnan <<a ymailto="mailto:rkrishnan8216@yahoo.com" href="mailto:rkrishnan8216@yahoo.com">rkrishnan8216@yahoo.com</a>><br>>>> Cc: ipopt mailing list <<a ymailto="mailto:ipopt@list.coin-or.org" href="mailto:ipopt@list.coin-or.org">ipopt@list.coin-or.org</a>><br>>>> Sent: Wednesday, July 29, 2009 4:00:39 PM<br>>>> Subject: Re: [Ipopt] Problems in compileing for Windows<br>>>><br>>>> Hi,<br>>>><br>>>>> I am trying to upgrade my version of IpOpt to the current level. I have
the Intel Fortran compiler (Version 11) and the Microsoft Visual Studio (2005). My environment is Cygwin, and I configure with --enable-doscompile=msvc. I have used the get statements in the respective ThirdParty directories to get Lapack, Blas, Metis and I also have the latest version of Mumps.<br>>>>> 1. When I run configure, I get a warning that the FFLAGS="" does not work, and that it will compile with an empty FFLAGS.<br>>>> I cannot see this in your configure output. I see a<br>>>> configure: Fortran compiler options are: -MT -O3 -fpp -nologo<br>>>> which looks good to me.<br>>>><br>>>>> 2. The configure command detects Blas and Lapack in the MKL, and so will not build these libraries. I guess it will use the default version of these that come with MKL. Is this the correct approach, or is there some way I can force it to build the Blas and Lapack
libraries?<br>>>> I think so. Your configure output shows<br>>>> checking for BLAS in MKL... yes<br>>>> checking whether LAPACK is already available with BLAS library... yes<br>>>><br>>>>> 3. When I try to compile by running make, I get a warning that I am trying to link with static library archive mkl_core.lib and that I should maybe use the shared version. What should I do at this stage?<br>>>>> 4. When at the final stage it tries to build the library, the process seems to pull in a huge number of .obj files (much more than I remember from the previous build). It hangs at this point and I cannot proceed further and have to kill the process.<br>>>> Looks like it is extracting the MKL library, which is then resulting in<br>>>> these many object files.<br>>>> And the MKL lib is extracted because it has been added to libcoinmumps -<br>>>> at
the point where you report this warning in step 3:<br>>>><br>>>> /bin/sh ./../../libtool --tag=F77 --mode=link ifort -MT -O3 -fpp<br>>>> -nologo -Dmetis -o <a target="_blank" href="http://libcoinmumps.la">libcoinmumps.la</a> dmumps_comm_buffer.lo<br>>>> dmumps_struc_def.lo mumps_ooc_common.lo mumps_static_mapping.lo<br>>>> dmumps_ooc_buffer.lo dmumps_load.lo dmumps_ooc.lo dmumps_part1.lo<br>>>> dmumps_part2.lo dmumps_part3.lo dmumps_part4.lo dmumps_part5.lo<br>>>> dmumps_part6.lo dmumps_part7.lo dmumps_part8.lo mumps_part9.lo<br>>>> mumps_c.lo mumps_common.lo mumps_orderings.lo mumps_io.lo<br>>>> mumps_io_basic.lo mumps_io_thread.lo mumps_io_err.lo mpi.lo mpic.lo<br>>>> elapse.lo mkl_intel_c.lib mkl_sequential.lib mkl_core.lib<br>>>><br>>>> *** Warning: Trying to link with static lib archive
mkl_intel_c.lib.<br>>>> *** I have the capability to make that library automatically link in when<br>>>> *** you link to this library. But I can only do this if you have a<br>>>><br>>>><br>>>> I am not so sure how to proceed, since I never tried linking to MKL before.<br>>>> Maybe you can go into IpOpt_3.6.1_MUMPS/ThirdParty/Mumps and edit the<br>>>> Makefile there, trying to prevent adding the files mkl_intel_c.lib<br>>>> mkl_sequential.lib mkl_core.lib to the linkline.<br>>>><br>>>> In my linux version of the Makefile, there are the two lines<br>>>> libcoinmumps.la: $(libcoinmumps_la_OBJECTS) $(libcoinmumps_la_DEPENDENCIES)<br>>>> $(F77LINK) $(am_libcoinmumps_la_rpath)<br>>>> $(libcoinmumps_la_LDFLAGS) $(libcoinmumps_la_OBJECTS)<br>>>> $(libcoinmumps_la_LIBADD)
$(LIBS)<br>>>><br>>>> Maybe removing $(LIBS) or/and $(libcoinmumps_la_LIBADD) will help?<br>>>><br>>>> Stefan<br>>>><br>>>><br>>>><br>>>> ------------------------------------------------------------------------<br>>>><br>>>> _______________________________________________<br>>>> Ipopt mailing list<br>>>> <a ymailto="mailto:Ipopt@list.coin-or.org" href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br><span>>>> <a target="_blank" href="http://list.coin-or.org/mailman/listinfo/ipopt">http://list.coin-or.org/mailman/listinfo/ipopt</a></span><br>>><br>> <br>> <br><br><br>-- <br>Stefan Vigerske<br>Humboldt University Berlin, Numerical Mathematics<br><span><a target="_blank" href="http://www.math.hu-berlin.de/%7Estefan">http://www.math.hu-berlin.de/~stefan</a></span><br></div></div></div><br>
</body></html>