Docker Build Failure when compiling isaac_ros_nitros type conflict between cuda namespace and previously declared datatype

Hi,
I’ve created a docker build file (myDockerfile.isaac) for building a container for Jetson Orin Nano development board. The build is close to completing, but fails duing build of isaac_ros_nitros
It fails with a type conflict between what appears to be a cuda declaration, and a previous declaration:

/usr/local/cuda/include/cuda/std/detail/libcxx/include/cmath:572:101: error: ‘long double cuda::std::__3::hypot(long double, long double, long double)’ conflicts with a previous declaration

572 | inline _LIBCUDACXX_INLINE_VISIBILITY long double hypot( long double x, long double y, long double z ) { return sqrt(xx + yy + z*z); }
Any input would be greatly appreciated
BobA

— Here is a snipped from the build failure:
Starting >>> isaac_ros_nitros
Finished <<< isaac_ros_pointcloud_interfaces [25.1s]
Finished <<< isaac_ros_apriltag_interfaces [27.5s]
Finished <<< isaac_ros_tensor_list_interfaces [28.2s]
Finished <<< isaac_ros_bi3d_interfaces [26.6s]
Finished <<< isaac_ros_visual_slam_interfaces [48.8s]
— stderr: isaac_ros_nitros
In file included from /usr/local/cuda/include/cuda/std/cmath:19,
from /usr/local/cuda/include/cuda/std/complex:12,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/complex.hpp:23,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/tensor.hpp:30,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:30,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/local/cuda/include/cuda/std/detail/libcxx/include/cmath:569:101: error: ‘float cuda::std::__3::hypot(float, float, float)’ conflicts with a previous declaration
569 | inline _LIBCUDACXX_INLINE_VISIBILITY float hypot( float x, float y, float z ) { return sqrt(xx + yy + zz); }
| ^
In file included from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/emitter.h:10,
from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/yaml.h:11,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/parameter_parser.hpp:31,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/parameter.hpp:29,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/component.hpp:25,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/allocator.hpp:21,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:28,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,**
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/include/c++/9/cmath:1868:3: note: previous declaration ‘float std::hypot(float, float, float)’
1868 | hypot(float __x, float __y, float __z)
| ^~~~~
In file included from /usr/local/cuda/include/cuda/std/cmath:19,
from /usr/local/cuda/include/cuda/std/complex:12,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/complex.hpp:23,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/tensor.hpp:30,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:30,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,**
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/local/cuda/include/cuda/std/detail/libcxx/include/cmath:570:101: error: ‘double cuda::std::__3::hypot(double, double, double)’ conflicts with a previous declaration**
570 | inline _LIBCUDACXX_INLINE_VISIBILITY double hypot( double x, double y, double z ) { return sqrt(x
x + yy + zz); }
| ^
In file included from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/emitter.h:10,
from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/yaml.h:11,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/parameter_parser.hpp:31,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/parameter.hpp:29,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/component.hpp:25,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/allocator.hpp:21,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:28,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/include/c++/9/cmath:1872:3: note: previous declaration ‘double std::hypot(double, double, double)’
1872 | hypot(double __x, double __y, double __z)
| ^~~~~
In file included from /usr/local/cuda/include/cuda/std/cmath:19,
from /usr/local/cuda/include/cuda/std/complex:12,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/complex.hpp:23,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/tensor.hpp:30,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:30,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/local/cuda/include/cuda/std/detail/libcxx/include/cmath:572:101: error: ‘long double cuda::std::__3::hypot(long double, long double, long double)’ conflicts with a previous declaration
572 | inline _LIBCUDACXX_INLINE_VISIBILITY long double hypot( long double x, long double y, long double z ) { return sqrt(xx + yy + z*z); }
| ^
In file included from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/emitter.h:10,
from /opt/isaac_ros_ws/build/isaac_ros_nitros/_deps/yaml-cpp-src/include/yaml-cpp/yaml.h:11,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/parameter_parser.hpp:31,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/parameter.hpp:29,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/core/component.hpp:25,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/std/allocator.hpp:21,
from /opt/isaac_ros_ws/install/share/isaac_ros_gxf/gxf/include/gxf/multimedia/video.hpp:28,
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/include/isaac_ros_nitros/utils/vpi_utilities.hpp:20,**
from /opt/isaac_ros_ws/src/isaac_ros_nitros/isaac_ros_nitros/src/utils/vpi_utilities.cpp:11:
/usr/include/c++/9/cmath:1876:3: note: previous declaration ‘long double std::hypot(long double, long double, long double)’
1876 | hypot(long double __x, long double __y, long double __z)
| ^~~~~
make[2]: [CMakeFiles/isaac_ros_nitros.dir/build.make:188: CMakeFiles/isaac_ros_nitros.dir/src/utils/vpi_utilities.cpp.o] Error 1
make[2]: Waiting for unfinished jobs…
make[1]: [CMakeFiles/Makefile2:159: CMakeFiles/isaac_ros_nitros.dir/all] Error 2
**make: *** [Makefile:146: all] Error 2

Failed <<< isaac_ros_nitros [1min 16s, exited with code 2]
[Processing: isaac_ros_nitros]

Summary: 9 packages finished [1min 53s]
1 package failed: isaac_ros_nitros

wget https://raw.githubusercontent.com/NVIDIA-ISAAC-ROS/isaac_ros_common/main/docker/patches/libcudacxx_aarch64_cuda_11_4.diff -P /tmp

sudo patch -i /tmp/libcudacxx_aarch64_cuda_11_4.diff /usr/local/cuda-11.4/targets/aarch64-linux/include/cuda/std/detail/libcxx/include/cmath

Thankyou @eds17m007 for pointing to this. I do have another question.

sudo patch -i /tmp/libcudacxx_aarch64_cuda_11_4.diff /usr/local/cuda-11.4/targets/aarch64-linux/include/cuda/std/detail/libcxx/include/cmath

throws an error:

patching file /usr/local/cuda-11.4/targets/aarch64-linux/include/cuda/std/detail/libcxx/include/cmath
Hunk #1 FAILED at 565.
patch: **** Can’t reopen file /usr/local/cuda-11.4/targets/aarch64-linux/include/cuda/std/detail/libcxx/include/cmath : No such file or directory

It seems there are not target libraries present in the environment:

ls /usr/local/cuda-11.4/targets
only shows
sbsa-linux

linux directory. It does not contain aarch64-linux directory.

I must need to still install these libraries. Can you point me to how to do this?
Thankyou!
boba

** Update: I was able to install CUDA Toolkit 11.4, and get past this issue as follows**

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/cuda-ubuntu2004.pinsudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda-repo-ubuntu2004-11-4-local_11.4.0-470.42.01-1_arm64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-4-local_11.4.0-470.42.01-1_arm64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-4-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

Now compilation of isaac_ros_nitros completes!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.