Nano Orin: Unable to build Jetson-inference with jetpack 6.0 and python3.10

I build project jetson-inference from source on a jetson nano orin with jetpack 6.0 and python3.10

The steps from the manual Helllo AI World are working great until the make command.

Step CMAKE

CMAKE ../ → In the log is mentioned NumPy 2.2.6 (>= 2.0): skipping npymath linkage

but finished without an error.

Step Make

Building CXX Object →100%

Error in linking CXX shared library Linking CXX shared library ../../aarch64/lib/python/3.10/jetson_inference_python.so

Errormessage/usr/bin/ld: cannot find -lnpymath: No such file or directory

collect2: error: ld returned 1 exit status
make[2]: *** [python/bindings_python_3.10/CMakeFiles/jetson-inference-python-310.dir/build.make:238: aarch64/lib/python/3.10/jetson_inference_python.so] Error 1

How can I solve this error?

Kind Regards,

Edo

*** Please note that this reply is generated by LLM automatically ***

The error you’re encountering is related to the linking of the CXX shared library during the build process of the jetsoninference project on your Jetson Orin Nano with JetPack 6.0 and Python 3.10.

The specific error message you’re seeing is:

Linking CXX shared library aarch64/lib/python3.10/jetsoninference/python.so

This error is likely due to a compatibility issue between the NumPy version installed on your system and the version required by the jetsoninference project.

The log message “NumPy 2.26 > 2.0 skipping npymath linkage” suggests that the NumPy version installed on your system is 2.26, which is greater than the minimum required version of 2.0. However, this message is not directly related to the linking error.

To solve this error, you can try the following steps:

  1. Check the NumPy version: Verify that the NumPy version installed on your system is compatible with the jetsoninference project. You can check the NumPy version using the following command:

pip3 show numpy


   If the version is not compatible, you can try updating or downgrading NumPy to a compatible version.

2. **Clean and rebuild**: Try cleaning the build directory and rebuilding the project from scratch. This can help resolve any issues related to cached build files or dependencies.

   ```bash
make clean
make
  1. Check dependencies: Ensure that all dependencies required by the jetsoninference project are installed and up-to-date. You can check the dependencies using the following command:

pip3 install -r requirements.txt


4. **Check CMake configuration**: Verify that the CMake configuration is correct and that the necessary flags are set. You can check the CMake configuration using the following command:

   ```bash
cmake --build .
  1. Check library paths: Ensure that the library paths are correctly set and that the linker can find the necessary libraries. You can check the library paths using the following command:

ldd aarch64/lib/python3.10/jetsoninference/python.so


If none of these steps resolve the issue, you may want to try debugging the build process further or seeking help from the jetsoninference community or NVIDIA support.

In comparison to other Jetson models, the Jetson Orin Nano is a relatively new model, and compatibility issues may arise due to its unique hardware and software configurations. However, the steps outlined above should help resolve the linking error and allow you to build the jetsoninference project successfully.

It's also worth noting that the Jetson Orin Nano has a different hardware architecture compared to other Jetson models, which may require specific configurations or workarounds. If you're experiencing issues specific to the Jetson Orin Nano, you may want to consult the NVIDIA documentation or seek help from the Jetson community for more tailored advice.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

I downgrade to numpy 1.26.4 (default version ubuntu 22.04)

CMAKE response

found NumPy version: 1.26.4
– found NumPy include: /home/develop/.local/lib/python3.10/site-packages/numpy/core/include

CMake Warning at python/bindings/CMakeLists.txt:110 (message):
NumPy 1.26.4 (< 2.0) but ‘npymath’ not found: continuing without it

MAKE response

[100%] Linking CXX shared library ../../aarch64/lib/python/3.10/jetson_inference_python.so
/usr/bin/ld: cannot find -lnpymath: No such file or directory
collect2: error: ld returned 1 exit status

I did a manual search and found npy_math.h in ~/.local/lib/python3.10/site-packages/numpy/core/include/numpy.

I do not know how to solve this problem. I will go back to the 2.26 version from jetpack 6.0 so as flashed for the jetson nano orin 8gb.

If anyone can help me out. It seems something simple. In the manual on the Hello IA. Jetpack 6/0 is supported.

Hi,

Jetson-inference should work on the JetPack 6.0 with Numpy
Do you compile it with the commands below:

Based on the error message, could you also double-check if the library exists in your environment?

/usr/lib/python3.10/dist-packages/numpy/core/lib/libnpymath.a

Thanks.

I checked Numpy and found:

/usr/lib/python3/dist-packages/numpy/core/lib/libnpymath.a
/usr/lib/python3.10/dist-packages/numpy/core/lib/libnpymath.a

python3 -c “import numpy; print(numpy.version)”
2.2.6

Checking python version = Python -V = Python 3.10.12

Which Python = /usr/bin/python3

Checking Jetpack

head -n 1 /etc/nv_tegra_release

R36 (release), REVISION: 3.0, GCID: 36923193, BOARD: generic, EABI: aarch64, DATE: Fri Jul 19 23:24:25 UTC 2024

Jetpack Archive

JetPack 6.0

  • Jetson AGX Orin Series, Jetson Orin NX Series, Jetson Orin Nano Series L4T 36.3

Installation is done via the docs/building-repo-2.md

I solved the issue by making the following changes in the CMakefile.txt in jetson-inference/utils/python/bindings. I used the CMakefile.txt from jetson-inference/python/bindings as example.

The 2 modifications:

Mod 1. Remove the hard lib linking
if(${NUMPY_FOUND})
message(“-- found NumPy version: ${NUMPY_VERSION}”)
message(“-- found NumPy include: ${NUMPY_INCLUDE_DIR}”)

add_definitions(-DHAS_NUMPY)
include_directories(${NUMPY_INCLUDE_DIR})
# Hack - Remove hard lib link
# link_directories(${NUMPY_INCLUDE_DIR}/../lib)

else()
message(“-- NumPy not found”)
endif()

Mod 2. Remove hardlink npymath and check existence

#hack remove target_link npymath without checking
#if(${NUMPY_FOUND})
#target_link_libraries(jetson-utils-python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} npymath)
#endhack remove endif

#Hack - do check for exist npymath
if(${NUMPY_FOUND})
#Alleen voor NumPy < 2.0, en alleen als libnpymath daadwerkelijk gevonden wordt
if(DEFINED NUMPY_VERSION AND NUMPY_VERSION VERSION_LESS “2.0”)
find_library(NPYMATH_LIB NAMES npymath PATHS ${NUMPY_INCLUDE_DIR}/../lib NO_DEFAULT_PATH)
if(NPYMATH_LIB)
target_link_libraries(jetson-utils-python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} PRIVATE ${NPYMATH_LIB})
message(STATUS “Util NumPy ${NUMPY_VERSION} (<2.0): linking npymath → ${NPYMATH_LIB}”)
else()
message(WARNING “Util NumPy ${NUMPY_VERSION} (<2.0) maar ‘npymath’ niet gevonden: ga verder zonder.”)
endif()
else()
message(STATUS “Util NumPy ${NUMPY_VERSION} (>=2.0): npymath overslaan.”)
endif()
endif()

Thanks for your help!

Hi,

Good to know it works now.
Thanks a lot for the update.

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