matthewfeickert / atlas-cmake-nanobind-example

Example nanobind CPython extension (taken from the docs) for an ATLAS CMake environment
MIT License
0 stars 0 forks source link

ATLAS CMake + nanobind linking error #6

Open matthewfeickert opened 1 week ago

matthewfeickert commented 1 week ago

After discussing with @nilserik78 today, I revised this repository to show multiple examples and then an issue.

As of https://github.com/matthewfeickert/atlas-cmake-nanobind-example/commit/9c812d48b94f427cdf010694406cba44c29137ac:

However, on the feat/get-nanobind-example-working branch, if I try to take the nanobind docs example and naively port it over to build with ATLAS CMake then I get linking errors.

The attached log is from running

$ . ./run_docker.sh
[bash][atlas]:workdir > bash build_atlas_cmake.sh &> build_atlas_cmake_error.txt

(build_atlas_cmake_error.txt) and as can be seen from this snippet, nanobind exists and is found, but the linking goes very wrong with lots of undefined references to CPython's C-API exceptions

...
[100%] Linking CXX shared module ../x86_64-el9-gcc13-opt/lib/nanobind_example_ext.cpython-311-x86_64-linux-gnu.so
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a(nb_internals.cpp.o): in function `nanobind::detail::default_exception_translator(std::__exception_ptr::exception_ptr const&, void*)':
/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:224: undefined reference to `PyExc_RuntimeError'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:224: undefined reference to `PyErr_SetString'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:222: undefined reference to `PyExc_OverflowError'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:222: undefined reference to `PyErr_SetString'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:220: undefined reference to `PyExc_ValueError'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:220: undefined reference to `PyErr_SetString'
...

I haven't fully dug in here, but general advice and debugging suggestions would be welcome.

cc @kratsg @ekourlit @henryiii @lukasheinrich @nikoladze @jpivarski @Moelf @alexander-held

matthewfeickert commented 1 week ago

Also maybe worth noting that if I change the CMakeLists.txt for nanobind from using NB_STATIC

nanobind_add_module(
  # Name of the extension
  nanobind_example_ext

  # Target the stable ABI for Python 3.12+, which reduces
  # the number of binary wheels that must be built. This
  # does nothing on older Python versions
  STABLE_ABI

  # Build libnanobind statically and merge it into the
  # extension (which itself remains a shared library)
  #
  # If your project builds multiple extensions, you can
  # replace this flag by NB_SHARED to conserve space by
  # reusing a shared libnanobind across libraries
  NB_STATIC

  # Source code goes here
  "${CMAKE_CURRENT_SOURCE_DIR}/src/nanobind_example_ext.cpp"
)

to NB_SHARED

nanobind_add_module(
  # Name of the extension
  nanobind_example_ext

  # Target the stable ABI for Python 3.12+, which reduces
  # the number of binary wheels that must be built. This
  # does nothing on older Python versions
  STABLE_ABI

  # Build libnanobind statically and merge it into the
  # extension (which itself remains a shared library)
  #
  # If your project builds multiple extensions, you can
  # replace this flag by NB_SHARED to conserve space by
  # reusing a shared libnanobind across libraries
  NB_SHARED

  # Source code goes here
  "${CMAKE_CURRENT_SOURCE_DIR}/src/nanobind_example_ext.cpp"
)

that I hit undefined references earlier on in the build

...
[ 88%] Linking CXX shared library ../x86_64-el9-gcc13-opt/lib/libnanobind.so
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: CMakeFiles/nanobind.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o: in function `nanobind::detail::init(char const*)':
/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:351: undefined reference to `PyInterpreterState_Get'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:351: undefined reference to `PyInterpreterState_GetDict'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:355: undefined reference to `PyUnicode_FromFormat'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:359: undefined reference to `PyDict_GetItem'
/opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ld: /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp:362: undefined reference to `PyCapsule_GetPointer'
...
matthewfeickert commented 1 week ago

Maybe related: Library order in static linking (2013-07-09)

matthewfeickert commented 1 week ago

As @nilserik78 suggested seeing the actual command being given by enabling the CMake command CMAKE_VERBOSE_MAKEFILE=ON for:

normal CMake: ``` Run Build Command(s): /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile -j8 /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -S/workdir/normal_cmake -B/workdir/build_normal_cmake --check-build-system CMakeFiles/Makefile.cmake 0 /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_progress_start /workdir/build_normal_cmake/CMakeFiles /workdir/build_normal_cmake//CMakeFiles/progress.marks /usr/bin/gmake -f CMakeFiles/Makefile2 all gmake[1]: Entering directory '/workdir/build_normal_cmake' /usr/bin/gmake -f CMakeFiles/nanobind-static.dir/build.make CMakeFiles/nanobind-static.dir/depend gmake[2]: Entering directory '/workdir/build_normal_cmake' cd /workdir/build_normal_cmake && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /workdir/normal_cmake /workdir/normal_cmake /workdir/build_normal_cmake /workdir/build_normal_cmake /workdir/build_normal_cmake/CMakeFiles/nanobind-static.dir/DependInfo.cmake "--color=" gmake[2]: Leaving directory '/workdir/build_normal_cmake' /usr/bin/gmake -f CMakeFiles/nanobind-static.dir/build.make CMakeFiles/nanobind-static.dir/build gmake[2]: Entering directory '/workdir/build_normal_cmake' [ 7%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp [ 15%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp [ 23%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o [ 38%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o [ 38%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o [ 46%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp [ 61%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o [ 61%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp [ 69%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp [ 76%] Building CXX object CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp [ 84%] Linking CXX static library libnanobind-static.a /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -P CMakeFiles/nanobind-static.dir/cmake_clean_target.cmake /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/nanobind-static.dir/link.txt --verbose=1 /opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ar qc libnanobind-static.a "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o" /opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ranlib libnanobind-static.a gmake[2]: Leaving directory '/workdir/build_normal_cmake' [ 84%] Built target nanobind-static /usr/bin/gmake -f CMakeFiles/nanobind_example_ext.dir/build.make CMakeFiles/nanobind_example_ext.dir/depend gmake[2]: Entering directory '/workdir/build_normal_cmake' cd /workdir/build_normal_cmake && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /workdir/normal_cmake /workdir/normal_cmake /workdir/build_normal_cmake /workdir/build_normal_cmake /workdir/build_normal_cmake/CMakeFiles/nanobind_example_ext.dir/DependInfo.cmake "--color=" gmake[2]: Leaving directory '/workdir/build_normal_cmake' /usr/bin/gmake -f CMakeFiles/nanobind_example_ext.dir/build.make CMakeFiles/nanobind_example_ext.dir/build gmake[2]: Entering directory '/workdir/build_normal_cmake' [ 92%] Building CXX object CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -Dnanobind_example_ext_EXPORTS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o -MF CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o.d -o CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o -c /workdir/normal_cmake/src/nanobind_example_ext.cpp [100%] Linking CXX shared module nanobind_example_ext.cpython-311-x86_64-linux-gnu.so /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/nanobind_example_ext.dir/link.txt --verbose=1 /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -fPIC -O3 -DNDEBUG -Wl,-s -Wl,--gc-sections -shared -o nanobind_example_ext.cpython-311-x86_64-linux-gnu.so CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o libnanobind-static.a gmake[2]: Leaving directory '/workdir/build_normal_cmake' [100%] Built target nanobind_example_ext ```

build_normal_cmake_log.txt

and for

ATLAS CMake: ``` Run Build Command(s): /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile -j8 /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -P /workdir/build_atlas_cmake/CMakeFiles/VerifyGlobs.cmake /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -S/workdir/atlas_cmake/Projects/WorkDir -B/workdir/build_atlas_cmake --check-build-system CMakeFiles/Makefile.cmake 0 ... /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_progress_start /workdir/build_atlas_cmake/CMakeFiles /workdir/build_atlas_cmake//CMakeFiles/progress.marks /usr/bin/gmake -f CMakeFiles/Makefile2 all gmake[1]: Entering directory '/workdir/build_atlas_cmake' /usr/bin/gmake -f CMakeFiles/atlas_tests.dir/build.make CMakeFiles/atlas_tests.dir/depend /usr/bin/gmake -f nanobind_example/CMakeFiles/Package_nanobind_example.dir/build.make nanobind_example/CMakeFiles/Package_nanobind_example.dir/depend /usr/bin/gmake -f nanobind_example/CMakeFiles/nanobind-static.dir/build.make nanobind_example/CMakeFiles/nanobind-static.dir/depend ... [ 15%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp [ 23%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp [ 30%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp ... [ 46%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp [ 61%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp [ 69%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp [ 76%] Building CXX object nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DNB_COMPACT_ASSERTIONS -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/ext/robin_map/include -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -ffunction-sections -fdata-sections -fno-strict-aliasing -MD -MT nanobind_example/CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o -MF CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o.d -o CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o -c /usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp [ 84%] Linking CXX static library ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a cd /workdir/build_atlas_cmake/nanobind_example && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -P CMakeFiles/nanobind-static.dir/cmake_clean_target.cmake cd /workdir/build_atlas_cmake/nanobind_example && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/nanobind-static.dir/link.txt --verbose=1 /opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ar qc ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/common.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/error.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o" "CMakeFiles/nanobind-static.dir/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o" /opt/lcg/binutils/2.40-acaab/x86_64-el9/bin/ranlib ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a [ 84%] Built target nanobind-static /usr/bin/gmake -f nanobind_example/CMakeFiles/nanobind_example_ext.dir/build.make nanobind_example/CMakeFiles/nanobind_example_ext.dir/depend gmake[2]: Entering directory '/workdir/build_atlas_cmake' cd /workdir/build_atlas_cmake && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /workdir/atlas_cmake/Projects/WorkDir /workdir/atlas_cmake/nanobind_example /workdir/build_atlas_cmake /workdir/build_atlas_cmake/nanobind_example /workdir/build_atlas_cmake/nanobind_example/CMakeFiles/nanobind_example_ext.dir/DependInfo.cmake "--color=" gmake[2]: Leaving directory '/workdir/build_atlas_cmake' /usr/bin/gmake -f nanobind_example/CMakeFiles/nanobind_example_ext.dir/build.make nanobind_example/CMakeFiles/nanobind_example_ext.dir/build gmake[2]: Entering directory '/workdir/build_atlas_cmake' [ 92%] Building CXX object nanobind_example/CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o cd /workdir/build_atlas_cmake/nanobind_example && /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -DROOTCORE -DXAOD_ANALYSIS -DXAOD_STANDALONE -Dnanobind_example_ext_EXPORTS -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/include/python3.11 -I/usr/AnalysisBaseExternals/25.2.30/InstallArea/x86_64-el9-gcc13-opt/lib/python3.11/site-packages/nanobind/include -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -std=c++20 -fPIC -fvisibility=hidden -Os -ffunction-sections -fdata-sections -MD -MT nanobind_example/CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o -MF CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o.d -o CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o -c /workdir/atlas_cmake/nanobind_example/src/nanobind_example_ext.cpp [100%] Linking CXX shared module ../x86_64-el9-gcc13-opt/lib/nanobind_example_ext.cpython-311-x86_64-linux-gnu.so cd /workdir/build_atlas_cmake/nanobind_example && /opt/cmake/3.29.5/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/nanobind_example_ext.dir/link.txt --verbose=1 /workdir/build_atlas_cmake/CMakeFiles/atlas_build_run.sh /opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -fPIC -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000 -Wl,--hash-style=both -shared -o ../x86_64-el9-gcc13-opt/lib/nanobind_example_ext.cpython-311-x86_64-linux-gnu.so CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a ```

build_atlas_cmake_log.txt

So the explicit linking commands that work and fail (selected from the text above) are:

/opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -fPIC -O3 -DNDEBUG -Wl,-s -Wl,--gc-sections -shared  -o nanobind_example_ext.cpython-311-x86_64-linux-gnu.so CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o  libnanobind-static.a
/opt/lcg/gcc/13.1.0-b3d18/x86_64-el9/bin/g++ -fPIC  -march=x86-64-v2 -DNDEBUG -O2 -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -Wl,--gc-sections  -Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000 -Wl,--hash-style=both -shared  -o ../x86_64-el9-gcc13-opt/lib/nanobind_example_ext.cpython-311-x86_64-linux-gnu.so CMakeFiles/nanobind_example_ext.dir/src/nanobind_example_ext.cpp.o  ../x86_64-el9-gcc13-opt/lib/libnanobind-static.a

I'll note that the failing ATLAS CMake linking has -Wl,--no-undefined. Off the top of my head, I assume that if you want to edit CXXFLAGS you need to catch them in a CMake variable, then manually edit them, and then reassign the CMake variable, or something like that.