diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed919dce29..1eb05e7cbf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,8 +431,8 @@ endif() if(NRN_ENABLE_PYTHON) # Make sure the USE_PYTHON macro is defined in the C++ code list(APPEND NRN_COMPILE_DEFS USE_PYTHON) - # Activate nanobind - nrn_add_external_project(nanobind) + # Ensure nanobind is there, but dont import, we don't want its CMake + nrn_add_external_project(nanobind, False) endif() # ============================================================================= diff --git a/cmake/ExternalProjectHelper.cmake b/cmake/ExternalProjectHelper.cmake index 3abadf7e589..78cc0268187 100644 --- a/cmake/ExternalProjectHelper.cmake +++ b/cmake/ExternalProjectHelper.cmake @@ -29,7 +29,7 @@ function(nrn_initialize_submodule path) endif() message(STATUS "Sub-module : missing ${path} : running git submodule update --init") execute_process( - COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${path} + COMMAND ${GIT_EXECUTABLE} submodule update --recursive --init -- ${path} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ret) if(NOT ret EQUAL 0) diff --git a/src/nrnpython/CMakeLists.txt b/src/nrnpython/CMakeLists.txt index 3141666b263..7b87e9a927a 100644 --- a/src/nrnpython/CMakeLists.txt +++ b/src/nrnpython/CMakeLists.txt @@ -14,15 +14,15 @@ install(TARGETS rxdmath DESTINATION ${NRN_INSTALL_SHARE_LIB_DIR}) # minimal nanobind interface # ============================================================================= add_library(nanobind INTERFACE) -target_sources(nanobind INTERFACE - ${NB_DIR}/src/common.cpp - ${NB_DIR}/src/error.cpp - ${NB_DIR}/src/nb_internals.cpp - ${NB_DIR}/src/nb_static_property.cpp - ${NB_DIR}/src/nb_type.cpp - ${NB_DIR}/src/nb_func.cpp - ${NB_DIR}/src/implicit.cpp - ) +target_sources( + nanobind + INTERFACE ${NB_DIR}/src/common.cpp + ${NB_DIR}/src/error.cpp + ${NB_DIR}/src/nb_internals.cpp + ${NB_DIR}/src/nb_static_property.cpp + ${NB_DIR}/src/nb_type.cpp + ${NB_DIR}/src/nb_func.cpp + ${NB_DIR}/src/implicit.cpp) target_include_directories(nanobind INTERFACE "${NB_DIR}/include" "${NB_DIR}/ext/robin_map/include") # ============================================================================= diff --git a/src/nrnpython/nrnpy_hoc.cpp b/src/nrnpython/nrnpy_hoc.cpp index b9ad2ad1b73..d6cf81b3456 100644 --- a/src/nrnpython/nrnpy_hoc.cpp +++ b/src/nrnpython/nrnpy_hoc.cpp @@ -2404,7 +2404,7 @@ static IvocVect* nrnpy_vec_from_python(void* v) { hoc_execerror(hoc_object_name(ho), " does not support the Python Sequence or Iterator protocol"); } - for(nb::handle item : po) { + for (nb::handle item: po) { if (!PyNumber_Check(item.ptr())) { char buf[50]; Sprintf(buf, "Some list items are not a number"); @@ -2423,7 +2423,7 @@ static IvocVect* nrnpy_vec_from_python(void* v) { x[i] = *(double*) (y + j); } } else { - for (long i=0; i