Skip to content

Build failure when using conda #303

@oleksandr-pavlyk

Description

@oleksandr-pavlyk

I use conda environment to provide cmake and ninja needed to build nvbench.

I created the environment using conda create -n dev --yes python ipython numpy scipy pandas cmake ninja.

I attempted to build using

git clone https://github.com/NVIDIA/nvbench
cd nvbench
conda activate dev
cmake -B build --preset=nvbench-dev -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build
Configuration log
(dev) local-opavlyk@2u1g-b650-1311:~/repos/nvbench$ cmake -B build --preset nvbench-dev -DCMAKE_VERBOSE_MAKEFILE=ON
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 6% complete]
-- [download 7% complete]
-- [download 9% complete]
-- [download 12% complete]
-- [download 14% complete]
-- [download 17% complete]
-- [download 18% complete]
-- [download 20% complete]
-- [download 23% complete]
-- [download 26% complete]
-- [download 29% complete]
-- [download 32% complete]
-- [download 35% complete]
-- [download 36% complete]
-- [download 39% complete]
-- [download 41% complete]
-- [download 43% complete]
-- [download 45% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 50% complete]
-- [download 53% complete]
-- [download 54% complete]
-- [download 57% complete]
-- [download 60% complete]
-- [download 63% complete]
-- [download 65% complete]
-- [download 68% complete]
-- [download 71% complete]
-- [download 74% complete]
-- [download 77% complete]
-- [download 78% complete]
-- [download 81% complete]
-- [download 84% complete]
-- [download 87% complete]
-- [download 90% complete]
-- [download 91% complete]
-- [download 92% complete]
-- [download 93% complete]
-- [download 94% complete]
-- [download 95% complete]
-- [download 97% complete]
-- [download 100% complete]
-- The CUDA compiler identification is NVIDIA 13.1.115 with host compiler GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Testing CXX17 Support: TRUE
-- Testing CXX20 Support: TRUE
-- Testing CUDA17 Support: TRUE
-- Testing CUDA20 Support: TRUE
-- Found CUDAToolkit: /usr/local/cuda/targets/x86_64-linux/include;/usr/local/cuda/targets/x86_64-linux/include/cccl (found version "13.1.115")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Creating symlink from /localhome/local-opavlyk/repos/nvbench/compile_commands.json to /localhome/local-opavlyk/repos/nvbench/build/compile_commands.json...
-- Performing Test NVBench_CXX_FLAG__Wall
-- Performing Test NVBench_CXX_FLAG__Wall - Success
-- Performing Test NVBench_CXX_FLAG__Wextra
-- Performing Test NVBench_CXX_FLAG__Wextra - Success
-- Performing Test NVBench_CXX_FLAG__Wconversion
-- Performing Test NVBench_CXX_FLAG__Wconversion - Success
-- Performing Test NVBench_CXX_FLAG__Woverloaded_virtual
-- Performing Test NVBench_CXX_FLAG__Woverloaded_virtual - Success
-- Performing Test NVBench_CXX_FLAG__Wcast_qual
-- Performing Test NVBench_CXX_FLAG__Wcast_qual - Success
-- Performing Test NVBench_CXX_FLAG__Wpointer_arith
-- Performing Test NVBench_CXX_FLAG__Wpointer_arith - Success
-- Performing Test NVBench_CXX_FLAG__Wunused_local_typedefs
-- Performing Test NVBench_CXX_FLAG__Wunused_local_typedefs - Success
-- Performing Test NVBench_CXX_FLAG__Wunused_parameter
-- Performing Test NVBench_CXX_FLAG__Wunused_parameter - Success
-- Performing Test NVBench_CXX_FLAG__Wvla
-- Performing Test NVBench_CXX_FLAG__Wvla - Success
-- Performing Test NVBench_CXX_FLAG__Wgnu
-- Performing Test NVBench_CXX_FLAG__Wgnu - Failed
-- Performing Test NVBench_CXX_FLAG__Wno_gnu_line_marker
-- Performing Test NVBench_CXX_FLAG__Wno_gnu_line_marker - Success
-- Performing Test NVBench_CXX_FLAG__Werror
-- Performing Test NVBench_CXX_FLAG__Werror - Success
-- CPM: Using local package fmt@12.1.0
-- CPM: Adding package nlohmann_json@3.12.0 (3.12.0)
-- NVBench CUDA architectures: all-major
-- Configuring done (4.0s)
-- Generating done (0.1s)
-- Build files have been written to: /localhome/local-opavlyk/repos/nvbench/build
(dev) local-opavlyk@2u1g-b650-1311:~/repos/nvbench$

The build fails with linking errors, due to -lfmt linker option upsetting the linker.

[189/231] : && /usr/bin/g++ -Wl,--dependency-file=testing/CMakeFiles/nvbench.test.create.dir/link.d testing/CMakeFiles/nvbench.test.create.dir/create.cu.o -o bin/nvbench.test.create  -Wl,-rpath,/localhome/local-opavlyk/repos/nvbench/build/lib:/usr/local/cuda/extras/CUPTI/lib64:/localhome/local-opavlyk/miniforge/envs/dev/lib  lib/libnvbench.so  -lfmt  /usr/local/cuda/targets/x86_64-linux/lib/stubs/libnvidia-ml.so  /usr/local/cuda/targets/x86_64-linux/lib/stubs/libcuda.so  -ldl  /usr/lib/x86_64-linux-gnu/librt.a  /usr/local/cuda/extras/CUPTI/lib64/libcupti.so  /usr/local/cuda/extras/CUPTI/lib64/libnvperf_target.so  /usr/local/cuda/extras/CUPTI/lib64/libnvperf_host.so  /localhome/local-opavlyk/miniforge/envs/dev/lib/libfmt.so.12.1.0  -lstdc++fs  -lcudadevrt  -lcudart_static  -lrt  -lpthread  -ldl -L"/usr/local/cuda/targets/x86_64-linux/lib/stubs" -L"/usr/local/cuda/targets/x86_64-linux/lib" && :
FAILED: [code=1] bin/nvbench.test.create
: && /usr/bin/g++ -Wl,--dependency-file=testing/CMakeFiles/nvbench.test.create.dir/link.d testing/CMakeFiles/nvbench.test.create.dir/create.cu.o -o bin/nvbench.test.create  -Wl,-rpath,/localhome/local-opavlyk/repos/nvbench/build/lib:/usr/local/cuda/extras/CUPTI/lib64:/localhome/local-opavlyk/miniforge/envs/dev/lib  lib/libnvbench.so  -lfmt  /usr/local/cuda/targets/x86_64-linux/lib/stubs/libnvidia-ml.so  /usr/local/cuda/targets/x86_64-linux/lib/stubs/libcuda.so  -ldl  /usr/lib/x86_64-linux-gnu/librt.a  /usr/local/cuda/extras/CUPTI/lib64/libcupti.so  /usr/local/cuda/extras/CUPTI/lib64/libnvperf_target.so  /usr/local/cuda/extras/CUPTI/lib64/libnvperf_host.so  /localhome/local-opavlyk/miniforge/envs/dev/lib/libfmt.so.12.1.0  -lstdc++fs  -lcudadevrt  -lcudart_static  -lrt  -lpthread  -ldl -L"/usr/local/cuda/targets/x86_64-linux/lib/stubs" -L"/usr/local/cuda/targets/x86_64-linux/lib" && :
/usr/bin/ld: cannot find -lfmt: No such file or directory
collect2: error: ld returned 1 exit status

The issue appears to be caused by fmt library being fetched by CPM as well as installed into Python environment:

(dev) local-opavlyk@2u1g-b650-1311:~/repos/nvbench$ conda list fmt
# packages in environment at /localhome/local-opavlyk/miniforge/envs/dev:
#
# Name                     Version          Build            Channel
fmt                        12.1.0           hff5e90c_0       conda-forge

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions