'ld' Error while compiling a module (Ubuntu 22.04) - c++

I am trying to compile a module https://github.com/In-line/grip
I have installed the below tools
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y build-essential
sudo apt-get install -y libc6-dev libc6-dev-i386
sudo apt-get install -y cmake
I am getting the below error
root#test:/home/ubuntu/grip# make
/usr/bin/cmake -S/home/ubuntu/grip -B/home/ubuntu/grip --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/ubuntu/grip/CMakeFiles /home/ubuntu/grip//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/ubuntu/grip'
make -f rust/CMakeFiles/grip-rust_target.dir/build.make rust/CMakeFiles/grip-rust_target.dir/depend
make[2]: Entering directory '/home/ubuntu/grip'
cd /home/ubuntu/grip && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/ubuntu/grip /home/ubuntu/grip/rust /home/ubuntu/grip /home/ubuntu/grip/rust /home/ubuntu/grip/rust/CMakeFiles/grip-rust_target.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/ubuntu/grip'
make -f rust/CMakeFiles/grip-rust_target.dir/build.make rust/CMakeFiles/grip-rust_target.dir/build
make[2]: Entering directory '/home/ubuntu/grip'
make[2]: Nothing to be done for 'rust/CMakeFiles/grip-rust_target.dir/build'.
make[2]: Leaving directory '/home/ubuntu/grip'
[ 25%] Built target grip-rust_target
make -f CMakeFiles/grip.dir/build.make CMakeFiles/grip.dir/depend
make[2]: Entering directory '/home/ubuntu/grip'
cd /home/ubuntu/grip && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip /home/ubuntu/grip/CMakeFiles/grip.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/ubuntu/grip'
make -f CMakeFiles/grip.dir/build.make CMakeFiles/grip.dir/build
make[2]: Entering directory '/home/ubuntu/grip'
[ 50%] Linking CXX shared library grip_amxx_i386.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/grip.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -Wall -Wextra -Wzero-as-null-pointer-constant -Wunknown-pragmas -m32 -O3 -mtune=generic -fvisibility=hidden -flto -fPIC -static-libgcc -static-libstdc++ -Wl,--gc-sections -Wl,--version-script=/home/ubuntu/grip/version_script.lds -fuse-ld=lld -shared -Wl,-soname,grip_amxx_i386.so -o grip_amxx_i386.so CMakeFiles/grip.dir/cpp/main.cpp.o CMakeFiles/grip.dir/third_party/amxmodx/public/sdk/amxxmodule.cpp.o rust/i686-unknown-linux-gnu/debug/libgrip_rust.a -lpthread
collect2: fatal error: cannot find ‘ld’
compilation terminated.
make[2]: *** [CMakeFiles/grip.dir/build.make:117: grip_amxx_i386.so] Error 1
make[2]: Leaving directory '/home/ubuntu/grip'
make[1]: *** [CMakeFiles/Makefile2:103: CMakeFiles/grip.dir/all] Error 2
make[1]: Leaving directory '/home/ubuntu/grip'
make: *** [Makefile:94: all] Error 2
root#test:/home/ubuntu/grip#
which ld output
root#test:/home/ubuntu/grip# which ld
/usr/bin/ld
echo $PATH output
/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
Can someone please help to solve this. I tried searching the web but couldn't get anything relevant.

One of my friend suggested to do
apt install lld
and the issue got resolved.

Related

How to link with binary using mingw32 in wine

I have made this minimal project to reproduce my link problem using mingw32 in wine32:
CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project("tst" VERSION 1.1.0)
add_executable("tst" "main.cpp")
add_library("resource" "text.o")
set_target_properties("resource" PROPERTIES LINKER_LANGUAGE CXX)
add_custom_command(OUTPUT "text.o"
MAIN_DEPENDENCY "text"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/text" "text"
COMMAND ${CMAKE_LINKER} -r -b binary "text" -o "text.o"
)
set_source_files_properties("text" PROPERTIES GENERATED true EXTERNAL_OBJECT true)
target_link_libraries("tst" "resource")
main.cpp
#include <iostream>
#include <string>
extern char _binary_text_start[];
extern char _binary_text_end[];
int main()
{
std::string text{ _binary_text_start, _binary_text_end };
std::cout << text << std::endl;
}
text
Hello, World!
This project builds and runs using mingw-w64 on Linux; however, when I try to build the project in wine32, I got this output:
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -SZ:\var\cache\deploy\cpp -BZ:\var\cache\deploy\cpp\build\windows --check-build-system CMakeFiles\Makefile.cmake 0
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E cmake_progress_start Z:\var\cache\deploy\cpp\build\windows\CMakeFiles Z:\var\cache\deploy\cpp\build\windows\\CMakeFiles\progress.marks
mingw32-make -f CMakeFiles\Makefile2 all
mingw32-make[1]: Entering directory `Z:/var/cache/deploy/cpp/build/windows'
mingw32-make -f CMakeFiles\resource.dir\build.make CMakeFiles/resource.dir/depend
mingw32-make[2]: Entering directory `Z:/var/cache/deploy/cpp/build/windows'
[ 25%] Generating text.o
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E copy Z:/var/cache/deploy/cpp/text text
Z:\mingw32\bin\ld.exe -r -b binary text -o text.o
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E cmake_depends "MinGW Makefiles" Z:\var\cache\deploy\cpp Z:\var\cache\deploy\cpp Z:\var\cache\deploy\cpp\build\windows Z:\var\cache\deploy\cpp\build\windows Z:\var\cache\deploy\cpp\build\windows\CMakeFiles\resource.dir\DependInfo.cmake --color=
mingw32-make[2]: Leaving directory `Z:/var/cache/deploy/cpp/build/windows'
mingw32-make -f CMakeFiles\resource.dir\build.make CMakeFiles/resource.dir/build
mingw32-make[2]: Entering directory `Z:/var/cache/deploy/cpp/build/windows'
[ 50%] Linking CXX static library libresource.a
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -P CMakeFiles\resource.dir\cmake_clean_target.cmake
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E cmake_link_script CMakeFiles\resource.dir\link.txt --verbose=1
Z:\mingw32\bin\ar.exe qc libresource.a text.o
Z:\mingw32\bin\ranlib.exe libresource.a
mingw32-make[2]: Leaving directory `Z:/var/cache/deploy/cpp/build/windows'
[ 50%] Built target resource
mingw32-make -f CMakeFiles\tst.dir\build.make CMakeFiles/tst.dir/depend
mingw32-make[2]: Entering directory `Z:/var/cache/deploy/cpp/build/windows'
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E cmake_depends "MinGW Makefiles" Z:\var\cache\deploy\cpp Z:\var\cache\deploy\cpp Z:\var\cache\deploy\cpp\build\windows Z:\var\cache\deploy\cpp\build\windows Z:\var\cache\deploy\cpp\build\windows\CMakeFiles\tst.dir\DependInfo.cmake --color=
mingw32-make[2]: Leaving directory `Z:/var/cache/deploy/cpp/build/windows'
mingw32-make -f CMakeFiles\tst.dir\build.make CMakeFiles/tst.dir/build
mingw32-make[2]: Entering directory `Z:/var/cache/deploy/cpp/build/windows'
[ 75%] Building CXX object CMakeFiles/tst.dir/main.cpp.obj
Z:\mingw32\bin\g++.exe -O3 -DNDEBUG -o CMakeFiles\tst.dir\main.cpp.obj -c Z:\var\cache\deploy\cpp\main.cpp
[100%] Linking CXX executable tst.exe
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E cmake_link_script CMakeFiles\tst.dir\link.txt --verbose=1
Z:\cmake-3.19.1-win32-x86\bin\cmake.exe -E rm -f CMakeFiles\tst.dir/objects.a
Z:\mingw32\bin\ar.exe cr CMakeFiles\tst.dir/objects.a #CMakeFiles\tst.dir\objects1.rsp
Z:\mingw32\bin\g++.exe -O3 -DNDEBUG -Wl,--whole-archive CMakeFiles\tst.dir/objects.a -Wl,--no-whole-archive -o tst.exe -Wl,--out-implib,libtst.dll.a -Wl,--major-image-version,0,--minor-image-version,0 #CMakeFiles\tst.dir\linklibs.rsp
z:/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\tst.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x43): undefined reference to `_binary_text_end'
z:/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\tst.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x48): undefined reference to `_binary_text_start'
z:/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\tst.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x68): undefined reference to `_binary_text_start'
z:/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\tst.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x16f): undefined reference to `_binary_text_start'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [tst.exe] Error 1
mingw32-make[2]: Leaving directory `Z:/var/cache/deploy/cpp/build/windows'
mingw32-make[1]: *** [CMakeFiles/tst.dir/all] Error 2
mingw32-make[1]: Leaving directory `Z:/var/cache/deploy/cpp/build/windows'
mingw32-make: *** [all] Error 2
nm libresource.a
text.o:
0000000d D _binary_text_end
0000000d A _binary_text_size
00000000 D _binary_text_start
objdump -f libresource.a
In archive libresource.a:
text.o: file format pe-i386
architecture: i386, flags 0x00000038:
HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x00000000
cmake: https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-win32-x86.zip
mingw: https://pilotfiber.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/ray_linn/GCC-10.x-with-ada/mingw32-10.2.0-crt-8.0.0-with-ada.7z
mingw-make: https://phoenixnap.dl.sourceforge.net/project/mingw/MinGW/Extension/make/mingw32-make-3.80-3/mingw32-make-3.80.0-3.tar.gz

How do I debug missing headers in CMake project?

What would be the general algorithm I should follow to debug issues such as this one?
23:28:12: Running steps for project jumper-qt...
23:28:12: Starting: "/usr/bin/cmake" --build . --target all
/usr/bin/cmake -S/home/skrat/Workspace/jumper-qt -B/home/skrat/Workspace/jumper-qt/build/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/skrat/Workspace/jumper-qt/build/Debug/CMakeFiles /home/skrat/Workspace/jumper-qt/build/Debug/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt_autogen.dir/build.make src/CMakeFiles/jumper-qt_autogen.dir/depend
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
cd /home/skrat/Workspace/jumper-qt/build/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/skrat/Workspace/jumper-qt /home/skrat/Workspace/jumper-qt/src /home/skrat/Workspace/jumper-qt/build/Debug /home/skrat/Workspace/jumper-qt/build/Debug/src /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt_autogen.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt_autogen.dir/build.make src/CMakeFiles/jumper-qt_autogen.dir/build
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 14%] Automatic MOC and UIC for target jumper-qt
cd /home/skrat/Workspace/jumper-qt/build/Debug/src && /usr/bin/cmake -E cmake_autogen /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt_autogen.dir/AutogenInfo.json Debug
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 14%] Built target jumper-qt_autogen
/usr/bin/make -f src/CMakeFiles/jumper-qt.dir/build.make src/CMakeFiles/jumper-qt.dir/depend
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
cd /home/skrat/Workspace/jumper-qt/build/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/skrat/Workspace/jumper-qt /home/skrat/Workspace/jumper-qt/src /home/skrat/Workspace/jumper-qt/build/Debug /home/skrat/Workspace/jumper-qt/build/Debug/src /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt.dir/build.make src/CMakeFiles/jumper-qt.dir/build
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 28%] Building CXX object src/CMakeFiles/jumper-qt.dir/magnum_item.cpp.o
cd /home/skrat/Workspace/jumper-qt/build/Debug/src && /usr/bin/g++ -DCORRADE_IS_DEBUG_BUILD -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QMLMODELS_LIB -DQT_QML_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -I/home/skrat/Workspace/jumper-qt/build/Debug/src -I/home/skrat/Workspace/jumper-qt/src -I/home/skrat/Workspace/jumper-qt/build/Debug/src/jumper-qt_autogen/include -isystem /usr/include/MagnumExternal/OpenGL -isystem /usr/include/qt -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtQmlModels -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtGui -DQT_QML_DEBUG -g -DQT_QML_DEBUG -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wzero-as-null-pointer-constant -Wdouble-promotion -fPIC -std=gnu++14 -o CMakeFiles/jumper-qt.dir/magnum_item.cpp.o -c /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp
In file included from /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp:4:
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static void Magnum::GL::Renderer::flush()’:
/usr/include/Magnum/GL/Renderer.h:1838:31: error: ‘glFlush’ was not declared in this scope; did you mean ‘flush’?
1838 | static void flush() { glFlush(); }
| ^~~~~~~
| flush
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static void Magnum::GL::Renderer::finish()’:
/usr/include/Magnum/GL/Renderer.h:1846:32: error: ‘glFinish’ was not declared in this scope; did you mean ‘finish’?
1846 | static void finish() { glFinish(); }
| ^~~~~~~~
| finish
In file included from /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp:4:
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static Magnum::GL::Renderer::Error Magnum::GL::Renderer::error()’:
/usr/include/Magnum/GL/Renderer.h:2053:58: error: ‘glGetError’ was not declared in this scope
2053 | static Error error() { return static_cast<Error>(glGetError()); }
| ^~~~~~~~~~
make[2]: *** [src/CMakeFiles/jumper-qt.dir/build.make:122: src/CMakeFiles/jumper-qt.dir/magnum_item.cpp.o] Error 1
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
make[1]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
make[1]: *** [CMakeFiles/Makefile2:118: src/CMakeFiles/jumper-qt.dir/all] Error 2
make: *** [Makefile:107: all] Error 2
23:28:15: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project jumper-qt (kit: Desktop)
When executing step "CMake Build"
23:28:15: Elapsed time: 00:04.
The example project use both Qt (Quick 2) and Magnum, both of these libraries make extensive use of OpenGL. When I start example projects for them separately, they both work well and build with no error. When I try to marry them, it falls a part.
So what would be a procedure to follow in this case? How do I find out out why these (glFlush) declarations are missing? I tried adding find_package(OpenGL.... to my project, with no success. I'm interested in the process of finding out what's the problem, not in a solution to this particular problem.
Thank you SO
UPDATE: CMake files here https://gist.github.com/skrat/c5b20d6753e6476a4a0d60227cb73cda
Before including Magnum, I had the same project, where I included find_package(OpenGL... and was able to use raw OpenGL calls successfully. In a separate Magnum only project, I don't have to find package OpenGL and all is fine, I assume Magnum's CMake files do the hard work.
Also this might be relevant https://github.com/mosra/magnum-bootstrap/blob/base-qt/modules/FindMagnum.cmake

nvcc compiled program seems to be confusing math.h and cmath.h namespaces

I'm compiling a CUDA program, which seems confused (Or, perhaps I'm confused) about the namespaces used by cmath and math. When I run make, I get the following output:
innovationcommons#IC-VR1:~/PackageDownloads/warp-ctc/build$ make VERBOSE=1
/usr/bin/cmake -H/home/innovationcommons/PackageDownloads/warp-ctc -B/home/innovationcommons/PackageDownloads/warp-ctc/build --check-build-system CMakeFiles/Makefile.cmake 0
Re-run cmake file: Makefile older than: CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend
-- cuda found TRUE
CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE):
By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Torch", but
CMake did not find one.
Could not find a package configuration file provided by "Torch" with any of
the following names:
TorchConfig.cmake
torch-config.cmake
Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
"Torch_DIR" to a directory containing one of the above files. If "Torch"
provides a separate development package or SDK, be sure it has been
installed.
-- Torch found Torch_DIR-NOTFOUND
-- Building shared library with GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/innovationcommons/PackageDownloads/warp-ctc/build
/usr/bin/cmake -E cmake_progress_start /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
make -f CMakeFiles/warpctc.dir/build.make CMakeFiles/warpctc.dir/depend
make[2]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
cd /home/innovationcommons/PackageDownloads/warp-ctc/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/innovationcommons/PackageDownloads/warp-ctc /home/innovationcommons/PackageDownloads/warp-ctc /home/innovationcommons/PackageDownloads/warp-ctc/build /home/innovationcommons/PackageDownloads/warp-ctc/build /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/warpctc.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
make -f CMakeFiles/warpctc.dir/build.make CMakeFiles/warpctc.dir/build
make[2]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
make[2]: Nothing to be done for 'CMakeFiles/warpctc.dir/build'.
make[2]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
[ 42%] Built target warpctc
make -f CMakeFiles/test_cpu.dir/build.make CMakeFiles/test_cpu.dir/depend
make[2]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
cd /home/innovationcommons/PackageDownloads/warp-ctc/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/innovationcommons/PackageDownloads/warp-ctc /home/innovationcommons/PackageDownloads/warp-ctc /home/innovationcommons/PackageDownloads/warp-ctc/build /home/innovationcommons/PackageDownloads/warp-ctc/build /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_cpu.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
make -f CMakeFiles/test_cpu.dir/build.make CMakeFiles/test_cpu.dir/build
make[2]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
make[2]: Nothing to be done for 'CMakeFiles/test_cpu.dir/build'.
make[2]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
[ 71%] Built target test_cpu
make -f CMakeFiles/test_gpu.dir/build.make CMakeFiles/test_gpu.dir/depend
make[2]: Entering directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
[ 85%] Building NVCC (Device) object CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o
cd /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests && /usr/bin/cmake -E make_directory /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/.
cd /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o -D generated_cubin_file:STRING=/home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o.cubin.txt -P /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.cmake
-- Removing /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
/usr/bin/cmake -E remove /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
-- Generating dependency file: /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.NVCC-depend
/usr/local/cuda-9.0/bin/nvcc -M -D__CUDACC__ /home/innovationcommons/PackageDownloads/warp-ctc/tests/test_gpu.cu -o /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -Xcompiler ,\"-fopenmp\",\"-O2\",\"-g\" -gencode arch=compute_30,code=sm_30 -O2 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 --std=c++11 -Xcompiler -fopenmp -DNVCC -I/usr/local/cuda-9.0/include -I/home/innovationcommons/PackageDownloads/warp-ctc/include
-- Generating temporary cmake readable file: /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.NVCC-depend -D output_file:FILEPATH=/home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp -D verbose=1 -P /usr/share/cmake-3.9/Modules/FindCUDA/make2cmake.cmake
-- Copy if different /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp to /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend
/usr/bin/cmake -E copy_if_different /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend
-- Removing /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp and /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.NVCC-depend
/usr/bin/cmake -E remove /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.depend.tmp /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o.NVCC-depend
-- Generating /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
/usr/local/cuda-9.0/bin/nvcc /home/innovationcommons/PackageDownloads/warp-ctc/tests/test_gpu.cu -c -o /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o -ccbin /usr/bin/cc -m64 -Xcompiler ,\"-fopenmp\",\"-O2\",\"-g\" -gencode arch=compute_30,code=sm_30 -O2 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 --std=c++11 -Xcompiler -fopenmp -DNVCC -I/usr/local/cuda-9.0/include -I/home/innovationcommons/PackageDownloads/warp-ctc/include
/home/innovationcommons/PackageDownloads/warp-ctc/tests/test_gpu.cu(301): error: namespace "std" has no member "isinf"
/home/innovationcommons/PackageDownloads/warp-ctc/tests/test_gpu.cu(311): error: namespace "std" has no member "isnan"
2 errors detected in the compilation of "/tmp/tmpxft_00000be9_00000000-12_test_gpu.compute_62.cpp1.ii".
-- Removing /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
/usr/bin/cmake -E remove /home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
CMake Error at test_gpu_generated_test_gpu.cu.o.cmake:282 (message):
Error generating file
/home/innovationcommons/PackageDownloads/warp-ctc/build/CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
CMakeFiles/test_gpu.dir/build.make:438: recipe for target 'CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o' failed
make[2]: *** [CMakeFiles/test_gpu.dir/tests/test_gpu_generated_test_gpu.cu.o] Error 1
make[2]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/test_gpu.dir/all' failed
make[1]: *** [CMakeFiles/test_gpu.dir/all] Error 2
make[1]: Leaving directory '/home/innovationcommons/PackageDownloads/warp-ctc/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The errors I get are that isinf and isnan don't belong to the std namespace. My understanding is that this is true if math.h is being imported, but not if cmath.h is being imported. However, I can see in the last compile line that std=c++11, and when I check test_gpu.cu, I see that cmath is being imported:
#include <cmath>
#include <random>
#include <tuple>
#include <vector>
#include <iostream>
At this point, I don't really know how to proceed. Any thoughts or suggestions would really help....
ADDENDUM: For what it's worth, here is my compiler information:
innovationcommons#IC-VR1:~/PackageDownloads/warp-ctc/build$ gcc --version
gcc (Ubuntu 4.8.5-4ubuntu6) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
innovationcommons#IC-VR1:~/PackageDownloads/warp-ctc/build$ g++ --version
g++ (Ubuntu 4.8.5-4ubuntu6) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ADDENDUM 2: More information about my setup and what I'm trying to install:
Ubuntu 17.10
gcc: 4.8.5
g++: 4.8.5
CUDA Version: 9.0
nvcc version: 9.0.176
glibc version: 2.26
I am attempting to install warp-ctc from https://github.com/baidu-research/warp-ctc

Cannot compile apache parquet from the source code

This is the exact problem (source code from: https://github.com/apache/parquet-cpp).
I'm using cmake:
parquet-cpp/test-build$ cmake ..
It says:
-- Found the Snappy library: /home/adam/workspace/parquet-cpp/thirdparty/installed/lib/libsnappy.so
-- Found the ZLIB library: /home/adam/workspace/parquet-cpp/thirdparty/installed/lib/libz.so
-- Found the GTest library: /home/adam/workspace/parquet-cpp/thirdparty/googletest-release-1.7.0/libgtest.a
and then make VERBOSE=1: (it adds -ldl ../../../thirdparty/googletest-release-1.7.0/libgtest.a to the c++)
adam#gaia:~/workspace/parquet-cpp/test-build$ make VERBOSE=1
/usr/bin/cmake -H/home/adam/workspace/parquet-cpp -B/home/adam/workspace/parquet-cpp/test-build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/adam/workspace/parquet-cpp/test-build/CMakeFiles /home/adam/workspace/parquet-cpp/test-build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make -f src/parquet/thrift/CMakeFiles/parquet_thrift.dir/build.make src/parquet/thrift/CMakeFiles/parquet_thrift.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/src/parquet/thrift /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/src/parquet/thrift /home/adam/workspace/parquet-cpp/test-build/src/parquet/thrift/CMakeFiles/parquet_thrift.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f src/parquet/thrift/CMakeFiles/parquet_thrift.dir/build.make src/parquet/thrift/CMakeFiles/parquet_thrift.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make[2]: Nothing to be done for `src/parquet/thrift/CMakeFiles/parquet_thrift.dir/build'.
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
/usr/bin/cmake -E cmake_progress_report /home/adam/workspace/parquet-cpp/test-build/CMakeFiles 40 41 42
[ 5%] Built target parquet_thrift
make -f CMakeFiles/parquet_objlib.dir/build.make CMakeFiles/parquet_objlib.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/CMakeFiles/parquet_objlib.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f CMakeFiles/parquet_objlib.dir/build.make CMakeFiles/parquet_objlib.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make[2]: Nothing to be done for `CMakeFiles/parquet_objlib.dir/build'.
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
/usr/bin/cmake -E cmake_progress_report /home/adam/workspace/parquet-cpp/test-build/CMakeFiles 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
[ 50%] Built target parquet_objlib
make -f CMakeFiles/parquet_shared.dir/build.make CMakeFiles/parquet_shared.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/CMakeFiles/parquet_shared.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f CMakeFiles/parquet_shared.dir/build.make CMakeFiles/parquet_shared.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make[2]: Nothing to be done for `CMakeFiles/parquet_shared.dir/build'.
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
/usr/bin/cmake -E cmake_progress_report /home/adam/workspace/parquet-cpp/test-build/CMakeFiles
[ 50%] Built target parquet_shared
make -f CMakeFiles/parquet_static.dir/build.make CMakeFiles/parquet_static.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/CMakeFiles/parquet_static.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f CMakeFiles/parquet_static.dir/build.make CMakeFiles/parquet_static.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make[2]: Nothing to be done for `CMakeFiles/parquet_static.dir/build'.
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
/usr/bin/cmake -E cmake_progress_report /home/adam/workspace/parquet-cpp/test-build/CMakeFiles
[ 50%] Built target parquet_static
make -f src/parquet/util/CMakeFiles/parquet_test_main.dir/build.make src/parquet/util/CMakeFiles/parquet_test_main.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/src/parquet/util /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/src/parquet/util /home/adam/workspace/parquet-cpp/test-build/src/parquet/util/CMakeFiles/parquet_test_main.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f src/parquet/util/CMakeFiles/parquet_test_main.dir/build.make src/parquet/util/CMakeFiles/parquet_test_main.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
make[2]: Nothing to be done for `src/parquet/util/CMakeFiles/parquet_test_main.dir/build'.
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
/usr/bin/cmake -E cmake_progress_report /home/adam/workspace/parquet-cpp/test-build/CMakeFiles 39
[ 51%] Built target parquet_test_main
make -f src/parquet/CMakeFiles/public-api-test.dir/build.make src/parquet/CMakeFiles/public-api-test.dir/depend
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
cd /home/adam/workspace/parquet-cpp/test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/adam/workspace/parquet-cpp /home/adam/workspace/parquet-cpp/src/parquet /home/adam/workspace/parquet-cpp/test-build /home/adam/workspace/parquet-cpp/test-build/src/parquet /home/adam/workspace/parquet-cpp/test-build/src/parquet/CMakeFiles/public-api-test.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make -f src/parquet/CMakeFiles/public-api-test.dir/build.make src/parquet/CMakeFiles/public-api-test.dir/build
make[2]: Entering directory `/home/adam/workspace/parquet-cpp/test-build'
Linking CXX executable ../../debug/public-api-test
cd /home/adam/workspace/parquet-cpp/test-build/src/parquet && /usr/bin/cmake -E cmake_link_script CMakeFiles/public-api-test.dir/link.txt --verbose=1
/usr/bin/c++ -ggdb -O0 -std=c++11 -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -g CMakeFiles/public-api-test.dir/public-api-test.cc.o -o ../../debug/public-api-test -rdynamic ../../debug/libparquet_test_main.a ../../debug/libparquet.so -ldl ../../../thirdparty/googletest-release-1.7.0/libgtest.a -lpthread -Wl,-rpath,/home/adam/workspace/parquet-cpp/test-build/debug
CMakeFiles/public-api-test.dir/public-api-test.cc.o: In function `__static_initialization_and_destruction_0':
/home/adam/workspace/parquet-cpp/src/parquet/public-api-test.cc:25: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/home/adam/workspace/parquet-cpp/src/parquet/public-api-test.cc:31: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/home/adam/workspace/parquet-cpp/src/parquet/public-api-test.cc:41: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
collect2: error: ld returned 1 exit status
make[2]: *** [debug/public-api-test] Error 1
make[2]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make[1]: *** [src/parquet/CMakeFiles/public-api-test.dir/all] Error 2
make[1]: Leaving directory `/home/adam/workspace/parquet-cpp/test-build'
make: *** [all] Error 2

Unable to load shared object: undefined symbol

I'm trying to create simple lib for the R with statically linked boost.
CMakeLists.txt
cmake_minimum_required(VERSION 3.3)
project(TheRPath)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.50.0 REQUIRED COMPONENTS filesystem)
include_directories(${Boost_INCLUDE_DIRS})
include_directories("/usr/share/R/include")
set(SOURCE_FILES Path.cpp Path.h)
add_library(therpath SHARED ${SOURCE_FILES})
target_link_libraries(therpath ${Boost_LIBRARIES})
Interpreter gives me an error when I'm trying to load shared object.
> dyn.load("libtherpath.so")
Error in dyn.load("libtherpath.so") :
unable to load shared object 'libtherpath.so':
libtherpath.so: undefined symbol: _ZN5boost6system15system_categoryEv
I have the following code:
Path.h
#ifndef PATH_H
#define PATH_H
#include <Rinternals.h>
extern "C" SEXP foo(SEXP snapshotPath);
#endif // PATH_H
Path.cpp
#include <string>
#include <boost/filesystem.hpp>
#include "Path.h"
extern "C" SEXP foo(SEXP snapshotPath) {
std::string path(R_CHAR(STRING_ELT(snapshotPath, 0)));
std::cerr << path << boost::filesystem::path::preferred_separator << "file.txt" << std::endl;
return R_NilValue;
}
Could you tell me what I'm doing wrong?
UPD 1
Output of make VERBOSE=1:
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -H/home/user/Workspace/TheRPath -B/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_progress_start /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make -f CMakeFiles/therpath.dir/build.make CMakeFiles/therpath.dir/depend
make[2]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
cd /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug && /home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/Workspace/TheRPath /home/user/Workspace/TheRPath /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles/therpath.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make -f CMakeFiles/therpath.dir/build.make CMakeFiles/therpath.dir/build
make[2]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
[ 50%] Building CXX object CMakeFiles/therpath.dir/Path.cpp.o
/usr/bin/c++ -Dtherpath_EXPORTS -std=c++11 -Wall -Werror -g -fPIC -I/usr/share/R/include -o CMakeFiles/therpath.dir/Path.cpp.o -c /home/user/Workspace/TheRPath/Path.cpp
[100%] Linking CXX shared library libtherpath.so
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_link_script CMakeFiles/therpath.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -std=c++11 -Wall -Werror -g -shared -Wl,-soname,libtherpath.so -o libtherpath.so CMakeFiles/therpath.dir/Path.cpp.o /usr/lib/x86_64-linux-gnu/libboost_filesystem.a
make[2]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
[100%] Built target therpath
make[1]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_progress_start /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles 0
UPD 2
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -H/home/user/Workspace/TheRPath -B/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_progress_start /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make -f CMakeFiles/therpath.dir/build.make CMakeFiles/therpath.dir/depend
make[2]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
cd /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug && /home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/Workspace/TheRPath /home/user/Workspace/TheRPath /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug /home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug/CMakeFiles/therpath.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make -f CMakeFiles/therpath.dir/build.make CMakeFiles/therpath.dir/build
make[2]: Entering directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
[ 50%] Building CXX object CMakeFiles/therpath.dir/Path.cpp.o
/usr/bin/c++ -Dtherpath_EXPORTS -std=c++11 -Wall -Werror -g -fPIC -I/usr/share/R/include -o CMakeFiles/therpath.dir/Path.cpp.o -c /home/user/Workspace/TheRPath/Path.cpp
[100%] Linking CXX shared library libtherpath.so
/home/user/Soft/clion-latest/bin/cmake/bin/cmake -E cmake_link_script CMakeFiles/therpath.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -std=c++11 -Wall -Werror -g -shared -Wl,-soname,libtherpath.so -o libtherpath.so CMakeFiles/therpath.dir/Path.cpp.o /usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.a
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libboost_system.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libtherpath.so] Error 1
make[2]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make[1]: *** [CMakeFiles/therpath.dir/all] Error 2
make[1]: Leaving directory `/home/user/.CLion12/system/cmake/generated/a69e8583/a69e8583/Debug'
make: *** [all] Error 2
libboost_filesystem depends on libboost_system. You need to add it to your CMakeLists.txt:
find_package(Boost REQUIRED COMPONENTS filesystem system)
Note I omitted the optional Boost version number, because you probably don't really need or want to specify it. But you can if you feel compelled.