OpenChemistry / openchemistry

Supermodule containing submodules and external project to build all components
http://openchemistry.org/
BSD 3-Clause "New" or "Revised" License
80 stars 60 forks source link

build openchemistry error: relocation R_X86_64_PC32 against symbol `PPMD8_kExpEscape' recompile with -fPIC #84

Closed StefanGIT closed 1 year ago

StefanGIT commented 2 years ago

Hi, i tried to build the openchemistry, especially the avogadro2 executable. I followed the instruction on: https://wiki.openchemistry.org/Build I use cmake 3.16 and gcc-10 on ubuntu-20. However, after running:

cmake -DCXX g++-10 ../openchemistry -- The CXX compiler identification is GNU 10.3.0 -- Check for working CXX compiler: /usr/bin/g++-10 -- Check for working CXX compiler: /usr/bin/g++-10 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Setting build type to 'Debug' as none was specified. -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10") -- Configuring done -- Generating done -- Build files have been written to: /hits/fast/mcm/app/avogadro2/openchemistry-bin

then cmake --build . Scanning dependencies of target libarchive [ 1%] Creating directories for 'libarchive' [ 2%] Performing download step (download, verify and extract) for 'libarchive' -- Downloading... dst='/hits/fast/mcm/app/avogadro2/openchemistry-bin/Downloads/v3.5.2.tar.gz' timeout='none' -- Using src='https://github.com/libarchive/libarchive/archive/v3.5.2.tar.gz' .... [ 33%] Building C object libarchive/CMakeFiles/archive.dir/archive_write_set_format_warc.c.o [ 33%] Building C object libarchive/CMakeFiles/archive.dir/archive_write_set_format_xar.c.o [ 33%] Building C object libarchive/CMakeFiles/archive.dir/archive_write_set_format_zip.c.o [ 34%] Building C object libarchive/CMakeFiles/archive.dir/archive_write_set_options.c.o [ 34%] Building C object libarchive/CMakeFiles/archive.dir/archive_write_set_passphrase.c.o [ 35%] Building C object libarchive/CMakeFiles/archive.dir/filter_fork_posix.c.o [ 35%] Building C object libarchive/CMakeFiles/archive.dir/xxhash.c.o [ 35%] Building C object libarchive/CMakeFiles/archive.dir/archive_blake2sp_ref.c.o [ 35%] Building C object libarchive/CMakeFiles/archive.dir/archive_blake2s_ref.c.o [ 35%] Linking C shared library libarchive.so /usr/bin/ld: CMakeFiles/archive.dir/archive_ppmd8.c.o: relocation R_X86_64_PC32 against symbol `PPMD8_kExpEscape' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make[5]: [libarchive/CMakeFiles/archive.dir/build.make:1887: libarchive/libarchive.so.18] Error 1 make[4]: [CMakeFiles/Makefile2:1089: libarchive/CMakeFiles/archive.dir/all] Error 2 make[3]: [Makefile:141: all] Error 2 make[2]: [thirdparty/CMakeFiles/libarchive.dir/build.make:115: thirdparty/libarchive-prefix/src/libarchive-stamp/libarchive-build] Error 2 make[1]: [CMakeFiles/Makefile2:419: thirdparty/CMakeFiles/libarchive.dir/all] Error 2 make: [Makefile:84: all] Error 2

What could be the problem?

ghutchis commented 2 years ago

I don't know, as that's a libarchive issue - my suggestion would be to take a look at the DebiChem / Ubuntu packages to see if they patch libarchive. In the meantime, I've bumped the libarchive dependency, so you might try HEAD again?

ghutchis commented 1 year ago

I'm closing this. It's a libarchive issue and we have updated dependency versions.

ghutchis commented 1 year ago

If you run into it again, please reopen or create a new issue, thanks!