[Ipopt] compiling JIPOPT

Tony Kelman kelman at berkeley.edu
Sun Mar 31 12:21:32 EDT 2013

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 

A workaround should be to add another configure flag "ADD_CXXFLAGS=-fPIC"


-----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


you can try running configure with the option --with-pic.


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) ,
> 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/**
> 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

More information about the Ipopt mailing list