[Ipopt] compiling JIPOPT
Joris Kinable
deus87 at gmail.com
Mon Apr 1 04:17:02 EDT 2013
Dear Tony,
Thanks, that resolved the problem! My Ipopt works great via the Java
interface under Kubuntu 11.10 (64 bit).
So in summary, if you get the following error:
========================
/opt/ipopt/build/Ipopt/contrib/JavaInterface$ make
g++ `echo -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type
-Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion
-Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD | sed -e
s'|-pedantic-errors||'` -Wl,--rpath -Wl,/opt/ipopt/build/lib -shared -o
lib/libjipopt.so jipopt.o
`PKG_CONFIG_PATH=/opt/ipopt/build/lib64/pkgconfig:/opt/ipopt/build/lib/pkgconfig:/opt/ipopt/build/share/pkgconfig:
/usr/bin/pkg-config --libs ipopt`
/usr/bin/ld: jipopt.o: relocation R_X86_64_32S against `vtable for Jipopt'
can not be used when making a shared object; recompile with -fPIC
jipopt.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [lib/libjipopt.so] Error 1
=========================
You have to recompile Ipopt. Instead of running the default "../configure",
use this command:
../configure ADD_CXXFLAGS="-fPIC"
Next, continue by running make, make test, and finally make install as is
elaborated in the installation manual.
Thanks again,
Joris
Btw, is this mailing list being indexed by Google? I.e, if others have a
similar problem, will they find this e-mail conversation?
On Sun, Mar 31, 2013 at 6:21 PM, Tony Kelman <kelman at berkeley.edu> wrote:
> For --with-pic to work properly, Jipopt would need to be be calling the
> C++ compiler through libtool (--tag=CXX --mode=compile) when it builds
> jipopt.o. It doesn't look like that's the case in
> Ipopt/contrib/JavaInterface/**Makefile.in.
>
> A workaround should be to add another configure flag "ADD_CXXFLAGS=-fPIC"
>
> -Tony
>
> -----Original Message----- From: Stefan Vigerske <stefan at math.hu-berlin.de
> >
> Date: Sun, 31 Mar 2013 14:19:48 +0200
> To: Joris Kinable <deus87 at gmail.com>
> Cc: "ipopt at list.coin-or.org" <ipopt at list.coin-or.org>
> Subject: Re: [Ipopt] compiling JIPOPT
>
>
> Hi,
>
> you can try running configure with the option --with-pic.
>
> Stefan
>
> On 03/31/2013 12:29 PM, Joris Kinable wrote:
>
>> Dear,
>>
>> I'm trying to obtain a shared object for JIPOPT under linux (as is
>> explained here: https://projects.coin-or.org/**Ipopt/wiki/JavaInterface<https://projects.coin-or.org/Ipopt/wiki/JavaInterface>)
>> ,
>> but I get the following error:
>>
>> ========================
>> /opt/ipopt/build/Ipopt/**contrib/JavaInterface$ make
>> g++ `echo -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type
>> -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion
>> -Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD | sed -e
>> s'|-pedantic-errors||'` -Wl,--rpath -Wl,/opt/ipopt/build/lib -shared -o
>> lib/libjipopt.so jipopt.o
>> `PKG_CONFIG_PATH=/opt/ipopt/**build/lib64/pkgconfig:/opt/**
>> ipopt/build/lib/pkgconfig:/**opt/ipopt/build/share/**pkgconfig:
>> /usr/bin/pkg-config --libs ipopt`
>> /usr/bin/ld: jipopt.o: relocation R_X86_64_32S against `vtable for Jipopt'
>> can not be used when making a shared object; recompile with -fPIC
>> jipopt.o: could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> make: *** [lib/libjipopt.so] Error 1
>> =========================
>>
>> This is what I've done:
>>
>> 1. set my JAVA_HOME variable
>> 2. Downloaded the latest Ipopt from: https://projects.coin-or.org/****<https://projects.coin-or.org/**>
>> svn/Ipopt/trunk <https://projects.coin-or.org/**svn/Ipopt/trunk<https://projects.coin-or.org/svn/Ipopt/trunk>
>> >
>> 3. Downloaded the necessary third party packages, including HSL for Ipopt.
>> 4. created a build directory inside the ipopt dir, and consecutively ran:
>> ../configure, make, make test, make install. Both ../configure and make
>> test returned that they were successful.
>> 5. Next I went inside the folder
>> /opt/ipopt/build/Ipopt/**contrib/JavaInterface where I ran make. The
>> latter
>> results in the above error.
>>
>> Any suggestions on how to resolve this error?
>>
>> br,
>>
>> Joris
>>
>>
>>
>> First I've
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20130401/1008a290/attachment.html>
More information about the Ipopt
mailing list