<div dir="ltr"><div><div>Hello, trying to compile ipopt 3.11.6 in Ubuntu 13.10 x64 I got the following error:<br>g++ -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD -o .libs/ipopt ampl_ipopt.o ./.libs/libipoptamplinterface.so ../../Interfaces/.libs/libipopt.so /home/lobianco/programs/linux/src/ipopt/ThirdParty/ASL/.libs/libcoinasl.so /home/lobianco/programs/linux/src/ipopt/ThirdParty/Mumps/.libs/libcoinmumps.so /home/lobianco/programs/linux/src/ipopt/ThirdParty/Metis/.libs/libcoinmetis.so -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lpthread -lgfortran -lquadmath -llapack -lblas -lm -ldl<br>
../../Interfaces/.libs/libipopt.so: undefined reference to `dlopen'<br>../../Interfaces/.libs/libipopt.so: undefined reference to `dlclose'<br>../../Interfaces/.libs/libipopt.so: undefined reference to `dlerror'<br>
../../Interfaces/.libs/libipopt.so: undefined reference to `dlsym'<br>collect2: error: ld returned 1 exit status<br>make[3]: *** [ipopt] Error 1<br><br></div>I coudn't find anything specific to ipopt, and I see that the linker flag -ldl, that is often "accused" to be the reason behind this error is instead already there.. any clue??<br>
<br></div>/Antonello<br><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 28 April 2013 03:36, Tae-Hyuk Ahn <span dir="ltr"><<a href="mailto:ahn.no1@gmail.com" target="_blank">ahn.no1@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Thanks! After I used the addlibs, I also got error.<br>
<br>
[thm@viper:gereme_cpp_ipopt_static_test]$ make<br>
<div class="im">g++ -fopenmp -static utils.o parse_config.o gereme_config.o<br>
gereme_core.o gereme_ipopt_main.o gereme_ipopt_nlp.o<br>
</div>-L/home/thm/Software/CoinIpopt/build/lib<br>
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2<br>
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64<br>
-L/lib/../lib64 -L/usr/lib/../lib64 -lipopt -ldl -lcoinmumps -lpthread<br>
-lcoinlapack -lcoinmetis -lcoinblas -lgfortranbegin -lgfortran -lm<br>
-lgcc_s -o gereme-solve-model<br>
/home/thm/Software/CoinIpopt/build/lib/libipopt.a(LibraryHandler.o):<br>
In function `LSL_loadLib':<br>
LibraryHandler.c:(.text+0x1f3): warning: Using 'dlopen' in statically<br>
linked applications requires at runtime the shared libraries from the<br>
glibc version used for linking<br>
/usr/bin/ld: cannot find -lgcc_s<br>
<div class="im">collect2: ld returned 1 exit status<br>
</div>make: *** [gereme-solve-model] Error 1<br>
<br>
So, I deleted -lgcc_s, then generate static binary only with warning<br>
<br>
/home/thm/Software/CoinIpopt/build/lib/libipopt.a(LibraryHandler.o):<br>
In function `LSL_loadLib':<br>
LibraryHandler.c:(.text+0x1f3): warning: Using 'dlopen' in statically<br>
linked applications requires at runtime the shared libraries from the<br>
glibc version used for linking<br>
<br>
What is -lgcc_s ? Can I skip this?<br>
<br>
Thanks!<br>
<br>
Ted<br>
<br>
On Sat, Apr 27, 2013 at 11:28 AM, Stefan Vigerske<br>
<div class=""><div class="h5"><<a href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>> wrote:<br>
> Hi,<br>
><br>
> that's what Ipopt has the addlibs for:<br>
> <a href="http://www.coin-or.org/Ipopt/documentation/node22.html" target="_blank">http://www.coin-or.org/Ipopt/documentation/node22.html</a><br>
><br>
> share/coin/doc/Ipopt/ipopt_addlibs_cpp.txt tells you which linker flags are<br>
> required to link against the Ipopt library, and in which order.<br>
><br>
> The ipopt.pc file in lib/pkgconfig has the same purpose.<br>
><br>
> Stefan<br>
><br>
><br>
> On 04/27/2013 05:03 PM, Tae-Hyuk Ahn wrote:<br>
>><br>
>> Hi Stefan,<br>
>><br>
>> Yep, I forgot to reorder the linker flags before. After I reorder, I<br>
>> am still getting errors.<br>
>><br>
>> g++ -fopenmp -static utils.o parse_config.o gereme_config.o<br>
>> gereme_core.o gereme_ipopt_main.o gereme_ipopt_nlp.o libipopt.a<br>
>> libipoptamplinterface.a libcoinasl.a libcoinblas.a libcoinlapack.a<br>
>> libcoinmetis.a libcoinmumps.a libipopt.a libipoptamplinterface.a -o<br>
>> gereme-solve-model<br>
>><br>
>> The order of static archives is also make error? The errors look like<br>
>> this:<br>
>><br>
>> libipopt.a(LibraryHandler.o): In function `LSL_loadSym':<br>
>> LibraryHandler.c:(.text+0x4e): undefined reference to `dlsym'<br>
>> LibraryHandler.c:(.text+0x56): undefined reference to `dlerror'<br>
>> libipopt.a(LibraryHandler.o): In function `LSL_loadLib':<br>
>> LibraryHandler.c:(.text+0x1f3): undefined reference to `dlopen'<br>
>> LibraryHandler.c:(.text+0x231): undefined reference to `dlerror'<br>
>> libipopt.a(LibraryHandler.o): In function `LSL_unloadLib':<br>
>> LibraryHandler.c:(.text+0x1c1): undefined reference to `dlclose'<br>
>> libcoinblas.a(xerbla.o): In function `xerbla_':<br>
>> xerbla.f:(.text+0x59): undefined reference to `_gfortran_st_write'<br>
>> xerbla.f:(.text+0x64): undefined reference to `_gfortran_string_len_trim'<br>
>> xerbla.f:(.text+0x76): undefined reference to<br>
>> `_gfortran_transfer_character'<br>
>> xerbla.f:(.text+0x86): undefined reference to `_gfortran_transfer_integer'<br>
>> xerbla.f:(.text+0x8e): undefined reference to `_gfortran_st_write_done'<br>
>> xerbla.f:(.text+0x98): undefined reference to `_gfortran_stop_numeric'<br>
>> libcoinlapack.a(dsytrd.o): In function `dsytrd_':<br>
>> dsytrd.f:(.text+0x29d): undefined reference to `dsyr2k_'<br>
>> dsytrd.f:(.text+0x5ff): undefined reference to `dsyr2k_'<br>
>> libcoinlapack.a(ilaenv.o): In function `ilaenv_':<br>
>> ilaenv.f:(.text+0xb8): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0xe9): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x108): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x127): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x142): undefined reference to `_gfortran_compare_string'<br>
>> libcoinlapack.a(ilaenv.o):ilaenv.f:(.text+0x15d): more undefined<br>
>> references to `_gfortran_compare_string' follow<br>
>> libcoinlapack.a(ilaenv.o): In function `ilaenv_':<br>
>> ilaenv.f:(.text+0x273): undefined reference to `_gfortran_copy_string'<br>
>> ilaenv.f:(.text+0x33c): undefined reference to `_gfortran_copy_string'<br>
>> ilaenv.f:(.text+0x357): undefined reference to `_gfortran_copy_string'<br>
>> ilaenv.f:(.text+0x36d): undefined reference to `_gfortran_copy_string'<br>
>> ilaenv.f:(.text+0x398): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x3b7): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x3d6): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x3f5): undefined reference to `_gfortran_compare_string'<br>
>> ilaenv.f:(.text+0x410): undefined reference to `_gfortran_compare_string'<br>
>> libcoinlapack.a(ilaenv.o):ilaenv.f:(.text+0x42b): more undefined<br>
>> references to `_gfortran_compare_string' follow<br>
>> libcoinlapack.a(dgetf2.o): In function `dgetf2_':<br>
>> dgetf2.f:(.text+0x1d5): undefined reference to `dswap_'<br>
>> dgetf2.f:(.text+0x305): undefined reference to `dger_'<br>
>> libcoinlapack.a(dlamch.o): In function `dlamch_':<br>
>> dlamch.f:(.text+0xad): undefined reference to `_gfortran_pow_r8_i4'<br>
>> dlamch.f:(.text+0xfc): undefined reference to `_gfortran_pow_r8_i4'<br>
>> libcoinlapack.a(dlamch.o): In function `dlamc2_':<br>
>><br>
>> On Sat, Apr 27, 2013 at 10:46 AM, Stefan Vigerske<br>
>> <<a href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> you could try reordering the linker flags so that the ipopt libs comes<br>
>>> after<br>
>>> your gereme_ipopt_main.o.<br>
>>> In static builds with g++, the order of the linker flags matters.<br>
>>><br>
>>> Stefan<br>
>>><br>
>>><br>
>>> On 04/26/2013 07:10 PM, Ahn, Tae-Hyuk wrote:<br>
>>>><br>
>>>><br>
>>>> Hello Stefan,<br>
>>>><br>
>>>> First I really appreciate for all your previous and future help for<br>
>>>> IPOPT.<br>
>>>><br>
>>>> I have one question about the IPOPT library. I will run IPOPT program in<br>
>>>> supercomputer,<br>
>>>> so IPOPT static libraries are required. The process of building<br>
>>>> libraries<br>
>>>> was done<br>
>>>> without error. But I've got error when II built my IPOPT program. Below<br>
>>>> was what I did:<br>
>>>><br>
>>>> $ ../configure --enable-static --disable-shared<br>
>>>> $ make<br>
>>>> $ make test<br>
>>>> $ make install<br>
>>>> I succeeded to build the IPOPT static libraries. But when I link<br>
>>>> them<br>
>>>> to my<br>
>>>> main program, I've got the error message:<br>
>>>> $ make (my IPOPT problem)<br>
>>>> ....<br>
>>>> g++ -fopenmp -static -L./ipopt/lib -lipopt -lipoptamplinterface<br>
>>>> -lcoinblas -lcoinlapack -lcoinasl -lcoinmumps -lcoinmetis -lpthread -lm<br>
>>>> -ldl<br>
>>>> utils.o parse_config.o gereme_config.o gereme_core.o gereme_ipopt_main.o<br>
>>>> gereme_ipopt_nlp.o -o gereme-solve-model<br>
>>>> gereme_ipopt_main.o: In function `main':<br>
>>>> gereme_ipopt_main.cpp:(.text+0x1202): undefined reference to<br>
>>>> `Ipopt::IpoptApplication::IpoptApplication(bool, bool)'<br>
>>>> gereme_ipopt_main.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for<br>
>>>> Ipopt::Vector]+0xc8): undefined reference to<br>
>>>> `Ipopt::Vector::AddTwoVectorsImpl(double, Ipopt::Vector const&, double,<br>
>>>> Ipopt::Vector const&, double)'<br>
>>>> gereme_ipopt_main.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for<br>
>>>> Ipopt::Vector]+0xd0): undefined reference to<br>
>>>> `Ipopt::Vector::FracToBoundImpl(Ipopt::Vector const&, double) const'<br>
>>>> gereme_ipopt_main.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for<br>
>>>> Ipopt::Vector]+0xd8): undefined reference to<br>
>>>> `Ipopt::Vector::AddVectorQuotientImpl(double, Ipopt::Vector const&,<br>
>>>> Ipopt::Vector const&, double)'<br>
>>>> gereme_ipopt_main.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for<br>
>>>> Ipopt::Vector]+0xe0): undefined reference to<br>
>>>> `Ipopt::Vector::HasValidNumbersImpl() const'<br>
>>>> /usr/bin/ld: link errors found, deleting executable<br>
>>>> `gereme-solve-model'<br>
>>>> collect2: ld returned 1 exit status<br>
>>>><br>
>>>> Do you have any idea for this.<br>
>>>><br>
>>>> Thank you very much.<br>
>>>><br>
>>>> Sincerely,<br>
>>>><br>
>>>> Ted<br>
>>>><br>
>>><br>
>><br>
><br>
_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Antonello Lobianco<br>AgroParisTech, Laboratoire d'Economie Forestière<br>14 Rue Girardet - 54000 Nancy, France<br>Tel: +33.383396865<br>Email: <a href="mailto:antonello.lobianco@nancy.inra.fr" target="_blank">antonello.lobianco@nancy.inra.fr</a><br>
<a href="http://antonello.lobianco.org/" target="_blank">http://antonello.lobianco.org</a></div>
</div></div></div></div></div>