Building error with linking with nvcc; MPCD; HPMC #1788
Closed
WeikangXian
started this conversation in
General
Replies: 1 comment 1 reply
-
The output you provide is not sufficient to determine which gcc and cmake you use. You need to ensure that you are not using any build tools (compiler, linker, etc...) provided by a conda distribution. These are rarely compatible with the host system and in your case appear to cause CMake to generate invalid build commands. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi hoomd-blue community,
I am brand-new into hoodmd. I was just trying to build the package from source.
The machine OS is Ubuntu 22.04.2 LTS.
I prepared the prerequisties properly.
Then:
cmake -B build/hoomd -S hoomd-blue -GNinja -DPython_EXECUTABLE=/home/anaconda3/bin/python3 -DENABLE_GPU=on -DHOOMD_GPU_PLATFORM=CUDA -DENABLE_MPI=on -DENABLE_TBB=on -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native
BUT it showed:
[747/763] Linking CXX shared library CMakeFiles/_mpcd.dir/cmake_device_link.o
FAILED: CMakeFiles/_mpcd.dir/cmake_device_link.o
/usr/local/cuda-11.8/bin/nvcc -forward-unknown-to-host-compiler -Xcudafe --diag_suppress=code_is_unreachable -Xcompiler=-Wall -Xcompiler=-Wconversion -Xcompiler=-Wno-attributes -DCUSPARSE_NEW_API -O3 -DNDEBUG --generate-code=arch=compute_60,code=[sm_60] --generate-code=arch=compute_70,code=[sm_70] --generate-code=arch=compute_80,code=[sm_80] --generate-code=arch=compute_80,code=[compute_80] -Xcompiler=-Wl,-rpath,/home/wxian3/anaconda3/lib,-Wl,-rpath,-Wl,/home/wxian3/anaconda3/lib,-Wl,--enable-new-dtags -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink hoomd/mpcd/CMakeFiles/_mpcd.dir/module.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ATCollisionMethod.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellCommunicator.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellThermoCompute.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellList.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CollisionMethod.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/Communicator.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ExternalField.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/Integrator.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitGeometryFiller.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitPoreGeometryFiller.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/Sorter.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SRDCollisionMethod.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/StreamingGeometry.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/StreamingMethod.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/VirtualParticleFiller.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ATCollisionMethodGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellThermoComputeGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellListGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CommunicatorGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitGeometryFillerGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitPoreGeometryFillerGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SorterGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SRDCollisionMethodGPU.cc.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ATCollisionMethodGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/BounceBackNVEGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellThermoComputeGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CellListGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ConfinedStreamingMethodGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/CommunicatorGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ExternalField.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/ParticleData.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitGeometryFillerGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SlitPoreGeometryFillerGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SorterGPU.cu.o hoomd/mpcd/CMakeFiles/_mpcd.dir/SRDCollisionMethodGPU.cu.o -o CMakeFiles/_mpcd.dir/cmake_device_link.o -L/usr/local/cuda-11.8/targets/x86_64-linux/lib/stubs -L/usr/local/cuda-11.8/targets/x86_64-linux/lib /usr/local/cuda-11.8/lib64/libcudadevrt.a -lgomp -lcudadevrt -lcudart_static -lrt -lpthread -ldl
nvlink warning : Stack size for entry function '_ZN5hoomd4mpcd3gpu6kernel16srd_draw_vectorsILb1EEEvP7double3PdPKS4_NS_7Index3DE4int35uint3S9_mtdjj' cannot be statically determined (target: sm_60)
nvlink warning : Stack size for entry function '_ZN5hoomd4mpcd3gpu6kernel16srd_draw_vectorsILb1EEEvP7double3PdPKS4_NS_7Index3DE4int35uint3S9_mtdjj' cannot be statically determined (target: sm_70)
nvlink warning : Stack size for entry function '_ZN5hoomd4mpcd3gpu6kernel16srd_draw_vectorsILb1EEEvP7double3PdPKS4_NS_7Index3DE4int35uint3S9_mtdjj' cannot be statically determined (target: sm_80)
gcc: error: unrecognized command-line option ‘-Wl’; did you mean ‘-W’?
gcc: error: unrecognized command-line option ‘-rpath’
gcc: error: unrecognized command-line option ‘-Wl’; did you mean ‘-W’?
gcc: error: unrecognized command-line option ‘-rpath’
gcc: error: unrecognized command-line option ‘-Wl’; did you mean ‘-W’?
gcc: error: unrecognized command-line option ‘-Wl’; did you mean ‘-W’?
ninja: build stopped: subcommand failed.
But after searching for a while, I didn't pinpoint where the problem was. I checked online and found that it may relate to linking with nvcc as discussed in this link:
https://forums.developer.nvidia.com/t/solved-error-while-linking-with-nvcc/46476
Then I turned off: -DBUILD_HPMC=off -DBUILD_MPCD=off. It worked with no problem hereafter.
Just want to raise hands to see what problem I may have.
Thank you.
Best,
Weikang
Beta Was this translation helpful? Give feedback.
All reactions