ROCm / rocprofiler

ROC profiler library. Profiling with perf-counters and derived metrics.
https://rocm.docs.amd.com/projects/rocprofiler/en/latest/
Other
115 stars 43 forks source link

[Issue]: Unable to compile, receive error: ld.lld: error: relocation R_X86_64_32 #139

Closed RandUser123sa closed 2 months ago

RandUser123sa commented 2 months ago

Problem Description

Hi ppl,

I trying to compile rocprofile version 6.1.0 and receive the error:

ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC

defined in CMakeFiles/multithreaded_testapp.dir/__/utils/test_utils.cpp.o referenced by test_utils.cpp CMakeFiles/multithreaded_testapp.dir/__/utils/test_utils.cpp.o:(.eh_frame+0x19E9)

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors) clang: error: linker command failed with exit code 1 (use -v to see invocation) gmake[2]: [tests-v2/featuretests/profiler/CMakeFiles/multithreaded_testapp.dir/build.make:109: tests-v2/featuretests/profiler/apps/multithreaded_testapp] Error 1 gmake[1]: [CMakeFiles/Makefile2:2255: tests-v2/featuretests/profiler/CMakeFiles/multithreaded_testapp.dir/all] Error 2 gmake: *** [Makefile:166: all] Error 2

my build parameters are:

HIP_CLANG_PATH=/opt/rocm/llvm/bin \ cmake \ -Wno-dev \ -D CMAKE_BUILD_TYPE=Release \ -D CMAKE_INSTALL_PREFIX=/opt/rocm \ -D ROCPROFILER_BUILD_TESTS=OFF \ -D PROF_API_HEADER_PATH=../../roctracer-rocm-6.1.0/inc/ext \ ..

any help pls ?

Operating System

Slackware 15.0

CPU

AMD Ryzen 7 3800X 8-Core Processor

GPU

AMD Radeon RX 7900 XTX

ROCm Version

ROCm 6.1.0

ROCm Component

rocprofiler

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

RandUser123sa commented 2 months ago

-D CMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC" solve the problem.

Thanks in advance.