<div dir="ltr">Dear Tony,<div><br></div><div>Thanks, that resolved the problem! My Ipopt works great via the Java interface under <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Kubuntu 11.10 (64 bit).</span></div>
<div><br></div><div style>So in summary, if you get the following error:</div><div style><br></div><div style><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">========================</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<div>/opt/ipopt/build/Ipopt/contrib/JavaInterface$ make</div><div>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`</div>
<div>/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</div><div>jipopt.o: could not read symbols: Bad value</div><div>collect2: ld returned 1 exit status</div>
<div>make: *** [lib/libjipopt.so] Error 1</div><div>=========================</div><div><br></div><div style>You have to recompile Ipopt. Instead of running the default "../configure", use this command: </div><div style>
<span style="font-size:small;font-family:arial">../configure </span>ADD_CXXFLAGS="-fPIC"</div></div></div><div style><br></div><div style>Next, continue by running make, make test, and finally make install as is elaborated in the installation manual.</div>
<div><br></div>
<div style>Thanks again,<br></div><div><br></div><div>Joris</div><div><br></div><div>Btw, is this mailing list being indexed by Google? I.e, if others have a similar problem, will they find this e-mail conversation?<br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 31, 2013 at 6:21 PM, Tony Kelman <span dir="ltr"><<a href="mailto:kelman@berkeley.edu" target="_blank">kelman@berkeley.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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/<u></u>Makefile.in.<br>
<br>
A workaround should be to add another configure flag "ADD_CXXFLAGS=-fPIC"<br>
<br>
-Tony<br>
<br>
-----Original Message----- From: Stefan Vigerske <<a href="mailto:stefan@math.hu-berlin.de" target="_blank">stefan@math.hu-berlin.de</a>><br>
Date: Sun, 31 Mar 2013 14:19:48 +0200<br>
To: Joris Kinable <<a href="mailto:deus87@gmail.com" target="_blank">deus87@gmail.com</a>><br>
Cc: "<a href="mailto:ipopt@list.coin-or.org" target="_blank">ipopt@list.coin-or.org</a>" <<a href="mailto:ipopt@list.coin-or.org" target="_blank">ipopt@list.coin-or.org</a>><br>
Subject: Re: [Ipopt] compiling JIPOPT<div class="HOEnZb"><div class="h5"><br>
<br>
Hi,<br>
<br>
you can try running configure with the option --with-pic.<br>
<br>
Stefan<br>
<br>
On 03/31/2013 12:29 PM, Joris Kinable wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear,<br>
<br>
I'm trying to obtain a shared object for JIPOPT under linux (as is<br>
explained here: <a href="https://projects.coin-or.org/Ipopt/wiki/JavaInterface" target="_blank">https://projects.coin-or.org/<u></u>Ipopt/wiki/JavaInterface</a>) ,<br>
but I get the following error:<br>
<br>
========================<br>
/opt/ipopt/build/Ipopt/<u></u>contrib/JavaInterface$ make<br>
g++ `echo -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type<br>
-Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion<br>
-Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD | sed -e<br>
s'|-pedantic-errors||'` -Wl,--rpath -Wl,/opt/ipopt/build/lib -shared -o<br>
lib/libjipopt.so jipopt.o<br>
`PKG_CONFIG_PATH=/opt/ipopt/<u></u>build/lib64/pkgconfig:/opt/<u></u>ipopt/build/lib/pkgconfig:/<u></u>opt/ipopt/build/share/<u></u>pkgconfig:<br>
/usr/bin/pkg-config --libs ipopt`<br>
/usr/bin/ld: jipopt.o: relocation R_X86_64_32S against `vtable for Jipopt'<br>
can not be used when making a shared object; recompile with -fPIC<br>
jipopt.o: could not read symbols: Bad value<br>
collect2: ld returned 1 exit status<br>
make: *** [lib/libjipopt.so] Error 1<br>
=========================<br>
<br>
This is what I've done:<br>
<br>
1. set my JAVA_HOME variable<br>
2. Downloaded the latest Ipopt from: <a href="https://projects.coin-or.org/**" target="_blank">https://projects.coin-or.org/*<u></u>*</a><br>
svn/Ipopt/trunk <<a href="https://projects.coin-or.org/svn/Ipopt/trunk" target="_blank">https://projects.coin-or.org/<u></u>svn/Ipopt/trunk</a>><br>
3. Downloaded the necessary third party packages, including HSL for Ipopt.<br>
4. created a build directory inside the ipopt dir, and consecutively ran:<br>
../configure, make, make test, make install. Both ../configure and make<br>
test returned that they were successful.<br>
5. Next I went inside the folder<br>
/opt/ipopt/build/Ipopt/<u></u>contrib/JavaInterface where I ran make. The latter<br>
results in the above error.<br>
<br>
Any suggestions on how to resolve this error?<br>
<br>
br,<br>
<br>
Joris<br>
<br>
<br>
<br>
First I've<br>
<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>