Skip to content

Build error on Ubuntu 20.04.3: requires -fPIC #22

Description

@BasantaChaulagain

Hello,

I am trying to install OpenSSE on Ubuntu 20.04.3. I have installed all the dependencies needed, I am able to execute 'cmake', but I get the following error while trying to 'make' it.

..
[ 52%] Building CXX object lib/CMakeFiles/schemes.dir/tethys/tethys_allocator.cpp.o
[ 53%] Building CXX object lib/CMakeFiles/schemes.dir/pluto/rocksdb_store.cpp.o
[ 54%] Linking CXX shared library libschemes.so
/usr/bin/ld: /usr/local/lib/librocksdb.a(concurrent_arena.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb15ConcurrentArena9tls_cpuidE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(iostats_context.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb15iostats_contextE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(perf_context.o): relocation R_X86_64_TPOFF32 against `__tls_guard' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(perf_level.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb10perf_levelE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(thread_status_updater.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb19ThreadStatusUpdater19thread_status_data_E' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(thread_status_util.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb16ThreadStatusUtil27thread_updater_initialized_E' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(random.o): relocation R_X86_64_TPOFF32 against `_ZZN7rocksdb6Random14GetTLSInstanceEvE12tls_instance' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(thread_local.o): relocation R_X86_64_TPOFF32 against symbol `_ZN7rocksdb14ThreadLocalPtr10StaticMeta4tls_E' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librocksdb.a(db_impl_open.o): relocation R_X86_64_PC32 against symbol `_ZN7rocksdb32kPersistentStatsColumnFamilyNameB5cxx11E' 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[2]: *** [lib/CMakeFiles/schemes.dir/build.make:334: lib/libschemes.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:429: lib/CMakeFiles/schemes.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

I tried editing the CMakeLists.txt by adding the missing flag when compiling, but I still get the same error.

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) 
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )

Please let me know if any other information is required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions