[Ipopt] Help with IPOPT linking problems on Windows MSVC/Intel C++
Jesse Perla
jesseperla at gmail.com
Fri Aug 22 11:39:53 EDT 2008
I have everything compiling and running now with a release build!
In case anyone wants to replicate my steps in the future, :
* I changed the target to "Release". Still doing with the Intel C++
compiler.
* In the project properties, set project C/C++/Code Generation/Runtime
Library to Multi-threaded (/MT) where the default was Multi-threaded DLL
(/MD) for a release build.
* I just needed to link in libipopt.lib
* The cpp_example worked.
As for binaries:
* I look forward to the formal distribution of binaries in the future. When
they are ready, I can help out with testing. Is this test version
significantly out of date?
* Sounds like I need to build my own debug libraries for now. Guess I will
have to walk through the build process.
* I am not sure how /MT vs. /MD makes a difference and can mix libraries
with them.
* I don't know much about this stuff, but there may be a way to get a binary
that can link to debug as well as release builds. When I link to the intel
MKL and intel MPI I am pretty sure I am linking to the same libs for debug
as well as release builds. I haven't run into the this problem patching
together any other libraries. Mabe this has something to do with /MT vs.
/MD. I don't need debugging info about the ipopt library.
* Yeah, distribution of the Intel Fortran libs may not be possible, but I
think it is reasonable to ask people to have a license for this installed
separately. Especially since it is free for non-commercial on linux.
Thanks for everyone's help on what I now realize is a 101 problem. (And
don't worry, the irony of whining about cygwin/linux dev environments and
then running into these problems is not lost on me).
On Thu, Aug 21, 2008 at 5:49 PM, Stefan Vigerske <stefan at vigerske.de> wrote:
> Hi,
>
> sorry, you seem to get from one pitfall into the next one.
>
> I am trying to get the IPOPT samples running in MSVC or Intel C++ and am
>> running into linking errors. Here are my steps:
>>
>> 1. Downloading the binaries available on:
>> http://www.coin-or.org/download/binary/OS/ Note that the only binaries
>> in:
>> http://www.coin-or.org/download/binary/Ipopt/ are for linux64.
>>
>
> Yes, the distribution of binaries has not officially started yet, so there
> are just some test binaries so far.
>
> a. (BTW, as a general consideration I would say that people may be
>> overestimating the applicability of cygwin vs. the native Intel or
>> microsoft
>> compilers when on windows. Getting a development environment working with
>> an optimizing compiler on cygwin is very difficult).
>> 2. The sample program I am getting is from the source in Ipopt-3.4.2. I
>> am
>> trying out the cpp_example.cpp mentioned in:
>> http://www.coin-or.org/Ipopt/documentation/node32.html
>> 3. Since the makefile for this is for cygwin, I need to create my own. .
>> a. I first added the 3 source files into a new project
>> b. I ensured that the include path to the headers in the binary
>> distribution and the libraries directory were set properly.
>> c. I added libipopt.lib to the linker inputs.
>> 4. I hit compile. All of the source compiled fine, but when linking, it
>> stated that a whole bunch of functions were already defined in core
>> libraries such as: MSVCRTD.lib. See notes below for some examples of
>> these.
>> 5. To see if it would help, I added the names of the libraries to the
>> "ignore specific library" list in the linker input options. No luck.
>> 6. I tried with Intel C++ vs. MSVC. No difference.
>> 7. I tried the "no default libs" selection in the project. A million
>> unresolved errors
>>
>
> From the output below I would say that you try to link debugging code with
> nondebugging code. While this is no problem for every normal operation
> system, for Windows this is not a good idea.
> There is a crucial compiler flag that determines whether you link with
> multithreaded or singlethreaded and optimized ( or debug LIBC libraries.
> The default flag in the COIN-OR build system (the one you use in cygwin) is
> -MT (multithreaded/optimized). The multithreaded/debug flag would be -MTD.
> Mixing these twos gets you these "...already defined..." linker errors.
> Note, that the 'D' in MSVCRTD.LIB probably stands for debug-version, while
> LIBCMT.lib is the optimized/multithread (=MT) version of the libc.lib. Thus,
> linking these together makes trouble.
>
> Therefore, please make sure that all code and libraries are compiled with
> the -MT flag.
>
> 8. I tried opening the example that came in the binary distribution:
>> called
>> osTestCode.
>> a. Had a different link error for a library that wasn't in the binary
>> libs
>> directory: 1>LINK : fatal error LNK1181: cannot open input file
>> 'libifcorert.lib'
>> b. That probably is an unrelated error, but why isn't this in the
>> distribution, and does it have anything to do with the empty IFORT
>> directory
>> in the libs?
>>
>
> This is because the MUMPS library that comes with the OS binary
> distribution is compiled with the Intel Fortran compiler and now depends on
> Intel Fortran libraries.
> You can get these libraries at
> http://www.gams.com/~svigerske/intel/win32/10.0/<http://www.gams.com/%7Esvigerske/intel/win32/10.0/>
> Sorry, this is not documented yet and I forgot to mention it before.
> There has not been a conclusion yet whether these libraries can be included
> in the CoinBinary repository.
>
> Good luck,
> Stefan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/ipopt/attachments/20080822/d610ede1/attachment.html
More information about the Ipopt
mailing list