Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Target "xmr-stak-amd-c" requests linking to directory "/opt/rocm/opencl/lib/x86_64". Targets may link only to libraries. CMake is dropping the item. #228

Open
minzak opened this issue Mar 25, 2019 · 1 comment

Comments

@minzak
Copy link

minzak commented Mar 25, 2019

Debian 9, kernel 4.19.x, AMD -ROCm 2.0.1
System is worked:
clinfo.txt
rocm_smi.txt
rocminfo.txt

root@z820:/usr/src/xmr-stak-amd/build#
./do.sh
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/local/bin/gcc-8
-- Check for working C compiler: /usr/local/bin/gcc-8 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/g++-8
-- Check for working CXX compiler: /usr/local/bin/g++-8 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - not found
-- Looking for CL_VERSION_2_1
-- Looking for CL_VERSION_2_1 - not found
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - found
-- Found OpenCL: /opt/rocm/opencl/lib/x86_64 (found version "2.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0j")
-- Configuring done
WARNING: Target "xmr-stak-amd-c" requests linking to directory "/opt/rocm/opencl/lib/x86_64".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "xmr-stak-amd" requests linking to directory "/opt/rocm/opencl/lib/x86_64".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "xmr-stak-amd" requests linking to directory "/opt/rocm/opencl/lib/x86_64".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /usr/src/xmr-stak-amd/build

root@z820:/usr/src/xmr-stak-amd/build# make -j32
Scanning dependencies of target xmr-stak-amd-c
[ 10%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/c_blake256.c.o
[ 26%] Building C object CMakeFiles/xmr-stak-amd-c.dir/amd_gpu/gpu.c.o
[ 26%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/c_groestl.c.o
[ 10%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/c_jh.c.o
[ 26%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/c_keccak.c.o
[ 31%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/c_skein.c.o
[ 36%] Building C object CMakeFiles/xmr-stak-amd-c.dir/crypto/soft_aes.c.o
[ 42%] Linking C static library libxmr-stak-amd-c.a
[ 42%] Built target xmr-stak-amd-c
Scanning dependencies of target xmr-stak-amd
[ 57%] Building CXX object CMakeFiles/xmr-stak-amd.dir/crypto/cryptonight_common.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-amd.dir/httpd.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-amd.dir/console.cpp.o
[ 63%] Building CXX object CMakeFiles/xmr-stak-amd.dir/jconf.cpp.o
[ 68%] Building CXX object CMakeFiles/xmr-stak-amd.dir/executor.cpp.o
[ 73%] Building CXX object CMakeFiles/xmr-stak-amd.dir/webdesign.cpp.o
[ 84%] Building CXX object CMakeFiles/xmr-stak-amd.dir/minethd.cpp.o
[ 84%] Building CXX object CMakeFiles/xmr-stak-amd.dir/jpsock.cpp.o
[ 89%] Building CXX object CMakeFiles/xmr-stak-amd.dir/cli-miner.cpp.o
[ 94%] Building CXX object CMakeFiles/xmr-stak-amd.dir/socket.cpp.o
[100%] Linking CXX executable bin/xmr-stak-amd
libxmr-stak-amd-c.a(gpu.c.o): In function `InitOpenCLGpu':
gpu.c:(.text+0x10d): undefined reference to `clGetDeviceInfo'
gpu.c:(.text+0x159): undefined reference to `clCreateCommandQueueWithProperties'
gpu.c:(.text+0x182): undefined reference to `clCreateBuffer'
gpu.c:(.text+0x1b1): undefined reference to `clCreateBuffer'
gpu.c:(.text+0x1e1): undefined reference to `clCreateBuffer'
gpu.c:(.text+0x210): undefined reference to `clCreateBuffer'
gpu.c:(.text+0x237): undefined reference to `clCreateBuffer'
libxmr-stak-amd-c.a(gpu.c.o):gpu.c:(.text+0x25e): more undefined references to `clCreateBuffer' follow
libxmr-stak-amd-c.a(gpu.c.o): In function `InitOpenCLGpu':
gpu.c:(.text+0x2d7): undefined reference to `clCreateProgramWithSource'
gpu.c:(.text+0x31e): undefined reference to `clBuildProgram'
gpu.c:(.text+0x360): undefined reference to `clGetProgramBuildInfo'
gpu.c:(.text+0x60a): undefined reference to `clGetProgramBuildInfo'
gpu.c:(.text+0x6b2): undefined reference to `clCreateKernel'
gpu.c:(.text+0x70f): undefined reference to `clGetProgramBuildInfo'
libxmr-stak-amd-c.a(gpu.c.o): In function `InitOpenCL':
gpu.c:(.text+0x7c3): undefined reference to `clGetPlatformIDs'
gpu.c:(.text+0x7fd): undefined reference to `clGetPlatformIDs'
gpu.c:(.text+0x821): undefined reference to `clGetDeviceIDs'
gpu.c:(.text+0x8a5): undefined reference to `clGetDeviceIDs'
gpu.c:(.text+0x909): undefined reference to `clCreateContext'
gpu.c:(.text+0xaeb): undefined reference to `clGetDeviceIDs'
libxmr-stak-amd-c.a(gpu.c.o): In function `XMRSetJob':
gpu.c:(.text+0xbd8): undefined reference to `clEnqueueWriteBuffer'
gpu.c:(.text+0xbf8): undefined reference to `clSetKernelArg'
gpu.c:(.text+0xc1a): undefined reference to `clSetKernelArg'
gpu.c:(.text+0xc3c): undefined reference to `clSetKernelArg'
gpu.c:(.text+0xc57): undefined reference to `clSetKernelArg'
gpu.c:(.text+0xc75): undefined reference to `clSetKernelArg'
libxmr-stak-amd-c.a(gpu.c.o):gpu.c:(.text+0xc93): more undefined references to `clSetKernelArg' follow
libxmr-stak-amd-c.a(gpu.c.o): In function `XMRRunJob':
gpu.c:(.text+0x1182): undefined reference to `clEnqueueWriteBuffer'
gpu.c:(.text+0x11cd): undefined reference to `clEnqueueWriteBuffer'
gpu.c:(.text+0x11e2): undefined reference to `clFinish'
gpu.c:(.text+0x1248): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x1284): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x12be): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x12fb): undefined reference to `clEnqueueReadBuffer'
gpu.c:(.text+0x1338): undefined reference to `clEnqueueReadBuffer'
gpu.c:(.text+0x1378): undefined reference to `clEnqueueReadBuffer'
gpu.c:(.text+0x13b8): undefined reference to `clEnqueueReadBuffer'
gpu.c:(.text+0x13cd): undefined reference to `clFinish'
gpu.c:(.text+0x1424): undefined reference to `clEnqueueReadBuffer'
gpu.c:(.text+0x1435): undefined reference to `clFinish'
gpu.c:(.text+0x1582): undefined reference to `clSetKernelArg'
gpu.c:(.text+0x1655): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x16ac): undefined reference to `clSetKernelArg'
gpu.c:(.text+0x1782): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x17b7): undefined reference to `clSetKernelArg'
gpu.c:(.text+0x188a): undefined reference to `clEnqueueNDRangeKernel'
gpu.c:(.text+0x18bf): undefined reference to `clSetKernelArg'
gpu.c:(.text+0x199a): undefined reference to `clEnqueueNDRangeKernel'
collect2: error: ld returned 1 exit status
CMakeFiles/xmr-stak-amd.dir/build.make:222: recipe for target 'bin/xmr-stak-amd' failed
make[2]: *** [bin/xmr-stak-amd] Error 1
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/xmr-stak-amd.dir/all' failed
make[1]: *** [CMakeFiles/xmr-stak-amd.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
root@z820:/usr/src/xmr-stak-amd/build#

I can use gcc 6.3 and gcc 8.3 (it is not matter)

cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-8 -DCMAKE_LINK_STATIC=OFF -DCMAKE_BUILD_TYPE=Release -DMICROHTTPD_ENABLE=ON -DOpenSSL_ENABLE=ON \
-DOpenCL_INCLUDE_DIR=/opt/rocm/opencl/include -DOpenCL_LIBRARY=/opt/rocm/opencl/lib/x86_64 ..

Also this full tree of ROCm:

root@z820:/opt/rocm# tree
.
├── atmi
│   ├── include
│   │   ├── atmi.h
│   │   └── atmi_runtime.h
│   └── lib
│       └── libatmi_runtime.so
├── bin
│   ├── clang-ocl
│   ├── rocm_agent_enumerator
│   ├── rocminfo
│   ├── rocm-smi -> rocm_smi.py
│   └── rocm_smi.py
├── hsa
│   ├── include
│   │   └── hsa
│   │       ├── amd_hsa_common.h
│   │       ├── amd_hsa_elf.h
│   │       ├── amd_hsa_kernel_code.h
│   │       ├── amd_hsa_queue.h
│   │       ├── amd_hsa_signal.h
│   │       ├── amd_hsa_tools_interfaces.h
│   │       ├── Brig.h
│   │       ├── hsa_api_trace.h
│   │       ├── hsa_ext_amd.h
│   │       ├── hsa_ext_debugger.h
│   │       ├── hsa_ext_finalize.h
│   │       ├── hsa_ext_image.h
│   │       ├── hsa_ext_profiler.h
│   │       ├── hsa.h
│   │       ├── hsa_ven_amd_aqlprofile.h
│   │       └── hsa_ven_amd_loader.h
│   ├── lib
│   │   ├── libhsa-ext-image64.so.1 -> libhsa-ext-image64.so.1.1.9
│   │   ├── libhsa-ext-image64.so.1.1.9
│   │   ├── libhsa-runtime64.so.1 -> libhsa-runtime64.so.1.1.9
│   │   ├── libhsa-runtime64.so.1.1.9
│   │   ├── libhsa-runtime-tools64.so.1 -> libhsa-runtime-tools64.so.1.1.9
│   │   └── libhsa-runtime-tools64.so.1.1.9
│   ├── LICENSE.txt
│   └── README.md
├── include
│   ├── amd_comgr.h
│   ├── amd_hsa_common.h
│   ├── amd_hsa_elf.h
│   ├── amd_hsa_kernel_code.h
│   ├── amd_hsa_queue.h
│   ├── amd_hsa_signal.h
│   ├── as.h
│   ├── device_amd_hsa.h
│   ├── hsa -> ../hsa/include/hsa
│   ├── hsa.h
│   ├── hsakmt.h
│   ├── hsakmttypes.h
│   ├── linux
│   │   └── kfd_ioctl.h
│   ├── ockl.h
│   ├── ockl_hsa.h
│   ├── ocml.h
│   ├── opencl1.2-c.pch
│   └── opencl2.0-c.pch
├── lib
│   ├── cmake
│   │   ├── amd_comgr
│   │   │   ├── amd_comgr-config.cmake
│   │   │   ├── amd_comgr-targets.cmake
│   │   │   └── amd_comgr-targets-release.cmake
│   │   └── AMDDeviceLibs
│   │       └── AMDDeviceLibsConfig.cmake
│   ├── hc.amdgcn.bc
│   ├── hip.amdgcn.bc
│   ├── libamd_comgr.so
│   ├── libhsakmt.so -> libhsakmt.so.1
│   ├── libhsakmt.so.1 -> libhsakmt.so.1.0.9
│   ├── libhsakmt.so.1.0.9
│   ├── libhsa-runtime64.so -> ../hsa/lib/libhsa-runtime64.so.1
│   ├── ockl.amdgcn.bc
│   ├── oclc_correctly_rounded_sqrt_off.amdgcn.bc
│   ├── oclc_correctly_rounded_sqrt_on.amdgcn.bc
│   ├── oclc_daz_opt_off.amdgcn.bc
│   ├── oclc_daz_opt_on.amdgcn.bc
│   ├── oclc_finite_only_off.amdgcn.bc
│   ├── oclc_finite_only_on.amdgcn.bc
│   ├── oclc_isa_version_700.amdgcn.bc
│   ├── oclc_isa_version_701.amdgcn.bc
│   ├── oclc_isa_version_702.amdgcn.bc
│   ├── oclc_isa_version_801.amdgcn.bc
│   ├── oclc_isa_version_802.amdgcn.bc
│   ├── oclc_isa_version_803.amdgcn.bc
│   ├── oclc_isa_version_810.amdgcn.bc
│   ├── oclc_isa_version_900.amdgcn.bc
│   ├── oclc_isa_version_902.amdgcn.bc
│   ├── oclc_isa_version_904.amdgcn.bc
│   ├── oclc_isa_version_906.amdgcn.bc
│   ├── oclc_unsafe_math_off.amdgcn.bc
│   ├── oclc_unsafe_math_on.amdgcn.bc
│   ├── ocml.amdgcn.bc
│   └── opencl.amdgcn.bc
├── libhsakmt
│   ├── libhsakmt.pc
│   └── LICENSE.md
├── opencl
│   ├── bin
│   │   └── x86_64
│   │       ├── clang
│   │       ├── clinfo
│   │       ├── ld.lld
│   │       ├── llc
│   │       ├── llvm-link
│   │       ├── llvm-objdump
│   │       └── opt
│   ├── include
│   │   ├── CL
│   │   │   ├── cl_ext.h
│   │   │   ├── cl_gl_ext.h
│   │   │   ├── cl_gl.h
│   │   │   ├── cl.h
│   │   │   ├── cl.hpp
│   │   │   ├── cl_platform.h
│   │   │   └── opencl.h
│   │   └── opencl-c.h
│   └── lib
│       └── x86_64
│           ├── bitcode
│           │   ├── hip.amdgcn.bc
│           │   ├── irif.amdgcn.bc
│           │   ├── ockl.amdgcn.bc
│           │   ├── oclc_correctly_rounded_sqrt_off.amdgcn.bc
│           │   ├── oclc_correctly_rounded_sqrt_on.amdgcn.bc
│           │   ├── oclc_daz_opt_off.amdgcn.bc
│           │   ├── oclc_daz_opt_on.amdgcn.bc
│           │   ├── oclc_finite_only_off.amdgcn.bc
│           │   ├── oclc_finite_only_on.amdgcn.bc
│           │   ├── oclc_isa_version_700.amdgcn.bc
│           │   ├── oclc_isa_version_701.amdgcn.bc
│           │   ├── oclc_isa_version_702.amdgcn.bc
│           │   ├── oclc_isa_version_801.amdgcn.bc
│           │   ├── oclc_isa_version_802.amdgcn.bc
│           │   ├── oclc_isa_version_803.amdgcn.bc
│           │   ├── oclc_isa_version_810.amdgcn.bc
│           │   ├── oclc_isa_version_900.amdgcn.bc
│           │   ├── oclc_isa_version_902.amdgcn.bc
│           │   ├── oclc_isa_version_904.amdgcn.bc
│           │   ├── oclc_isa_version_906.amdgcn.bc
│           │   ├── oclc_unsafe_math_off.amdgcn.bc
│           │   ├── oclc_unsafe_math_on.amdgcn.bc
│           │   ├── ocml.amdgcn.bc
│           │   └── opencl.amdgcn.bc
│           ├── libamdocl64.so
│           ├── libcltrace.so
│           ├── libOpenCL.so -> libOpenCL.so.1
│           └── libOpenCL.so.1
└── share
    ├── amd_comgr
    │   ├── LICENSE.txt
    │   ├── NOTICES.txt
    │   └── README.md
    └── rocm
        └── cmake
            ├── ROCMAnalyzers.cmake
            ├── ROCMClangTidy.cmake
            ├── ROCMConfig.cmake
            ├── ROCMCppCheck.cmake
            ├── ROCMCreatePackage.cmake
            ├── ROCMInstallSymlinks.cmake
            ├── ROCMInstallTargets.cmake
            ├── ROCMPackageConfigHelpers.cmake
            └── ROCMSetupVersion.cmake

28 directories, 139 files

root@z820:/opt/rocm#

What is wrong ?

@psychocrypt
Copy link
Collaborator

psychocrypt commented Mar 25, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants