Hi Noel,

I know, my train of thought was a bit scattered as it turned out that all
of my earlier issues had nothing to do with OB.  :)  (I know I am very,
very, close to getting OB 2.4.1 working without errors)  I'll file a bug so
that you guys can see what I'm seeing.  I pushed out my failed tests in
hopes that someone had seen some of those failures before, but hadn't
reported it.  (As I didn't see any help from Google or DuckDuckGo queries)
I figure I am missing a flag, or I have another underlying package that
needs to be replaced.  Anyway, I'll file a bug.  :)

For others who have the linker error after compilation:

That Zlib bug, which manifested as a "recompile with -fPIC" was really
weird (it'll have a linker error mentioning libz.a).  I kept adding -fPIC
to the C and CXX flags, and the linker error just kept reappearing.
Rebuilding ZLIB statically completely solved the linker problem, and
allowed me to use some of the bindings.   You will still need to add the
-fPIC flag to the C and CXX flags in cmake or ccmake, but doing so with
your own compiled zlib will link without errors. Why CentOS repos have this
goofy version of zlib in the package manager is completely beyond me.

Thanks Noel!
Matt


On Mon, Jul 2, 2018 at 6:25 AM, Noel O'Boyle <baoille...@gmail.com> wrote:

> Hi Matt,
>
> Sorry to hear you're having trouble. I find it difficult to follow your
> emails though as you have sent a few but with several different subject
> lines. If you could just file a bug, then we will be able to progress this
> step-by-step and keep the discussion in one place.
>
> Regards,
> - Noel
>
> On 1 July 2018 at 17:35, Matthew Lardy <mla...@gmail.com> wrote:
>
>> Hi all,
>>
>> I'm still trying to build the Java bindings with OB 2.4.1.  I've tried
>> everything at this point.  Building OB static does not build with the
>> bindings.  Here are some of the things I've tried on 3 CentOS-7 boxes and 1
>> Ubuntu (v14) box.
>>
>> Swig:
>> 2.0.10
>> 2.8.2
>> 3.0.9
>> 3.0.11
>>
>> JAVA:
>> OpenJDK 1.8
>> OpenJDK 1.7
>> Jave (Oracle) 1.8
>>
>> Cmake:
>> 2.8
>> 3.0
>>
>> Does someone have a recipe?  I can't stand to see this error anymore:
>>
>> /usr/bin/ld: 
>> /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libz.a(inffast.o):
>> relocation R_X86_64_32S against `.rodata.str1.1' can not be used when
>> making a shared object; recompile with -fPIC
>> /usr/bin/ld: final link failed: Nonrepresentable section on output
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [lib/libopenbabel_java.so] Error 1
>> make[1]: *** [scripts/CMakeFiles/bindings_java.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> Here is the cmake line I am using:
>> cmake3 -DBUILD_SHARED=OFF -DJAVA_AWT_LIBRARY=$JAVA_HOME/lib/amd64/libjawt.so
>> -DJAVA_JVM_LIBRARY=$JAVA_HOME/jre/lib/amd64/server/libjvm.so
>> -DCMAKE_C_FLAGS="-fPIC -Wall -O3 -std=c++11" -DCMAKE_CXX_FLAGS="-fPIC -Wall
>> -O3 -std=c++11" -DPYTHON_BINDINGS=ON -DJAVA_BINDINGS=ON -DRUN_SWIG=ON ..
>>
>> It doesn't appear that compiling OB automatically hardens on the
>> compile.  fPIC isn't in the default compilation instructions, but as you
>> can see I've added it.  I also had to add the c++11, I don't know why but
>> without it OB will not build.
>>
>> Also, the dynamic build works but the resulting jar file is broken.
>>
>> Thanks in advance!
>> Matt
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to