From bb24f13fba8aed1624d7b1ee7eaea31dea9a93ee Mon Sep 17 00:00:00 2001 From: AndreaRigoni Date: Fri, 3 Apr 2026 12:58:36 +0000 Subject: [PATCH] fix compile errors in uLib env --- CLAUDE.md | 2 +- CMakeLists.txt | 4 ++++ README.md | 8 ++++---- conanfile.txt | 2 +- condaenv.yml | 13 +++++++++++-- src/Vtk/CMakeLists.txt | 4 +++- src/Vtk/uLibVtkInterface.cxx | 4 ++-- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7a59f7d..5cde700 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,7 +10,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co export MAMBA_EXE="/home/share/micromamba/bin/micromamba" export MAMBA_ROOT_PREFIX="/home/share/micromamba" eval "$(/home/share/micromamba/bin/micromamba shell hook --shell bash)" -micromamba activate mutom +micromamba activate uLib # Configure (from repo root, using Conan preset — uses Ninja + ccache) cmake --preset conan-release diff --git a/CMakeLists.txt b/CMakeLists.txt index a7e8625..f4ce092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,8 @@ find_package(Eigen3 CONFIG REQUIRED) get_target_property(EIGEN3_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) include_directories(${EIGEN3_INCLUDE_DIRS}) +find_package(OpenMP) + find_package(ROOT CONFIG REQUIRED) include(${ROOT_USE_FILE}) @@ -145,6 +147,8 @@ else() IOXML IOXMLParser ImagingCore + ImagingHybrid + ImagingSources InteractionStyle InteractionWidgets RenderingAnnotation diff --git a/README.md b/README.md index 35311d0..d3e4092 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ You can create and activate the environment using either `micromamba` or `conda` **Using Micromamba:** ```bash micromamba env create -f condaenv.yml -micromamba activate mutom +micromamba activate uLib ``` **Using Conda:** ```bash conda env create -f condaenv.yml -conda activate mutom +conda activate uLib ``` ### Configure and Build @@ -70,7 +70,7 @@ cmake --build build -j$(nproc) A `fast` conan profile is provided that uses **clang**, **lld** (LLVM linker), and **ccache**. Install them into your environment first: ```bash -micromamba install -n mutom -y clang clangxx lld -c conda-forge +micromamba install -n uLib -y clang clangxx lld -c conda-forge ``` Then build using the `fast` profile: @@ -91,6 +91,6 @@ The `fast` profile is defined at `~/.conan2/profiles/fast` and sets: ### Make python package ```bash -micromamba run -n mutom env USE_CUDA=ON poetry install +micromamba run -n uLib env USE_CUDA=ON poetry install ``` diff --git a/conanfile.txt b/conanfile.txt index 5351bfb..8c12c50 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,6 +1,6 @@ [requires] eigen/3.4.0 -boost/1.83.0 +boost/1.86.0 # pybind11/3.0.2 hdf5/1.14.3 diff --git a/condaenv.yml b/condaenv.yml index 8ec18fe..14370d4 100644 --- a/condaenv.yml +++ b/condaenv.yml @@ -1,4 +1,4 @@ -name: mutom +name: uLib channels: - conda-forge dependencies: @@ -7,4 +7,13 @@ dependencies: - cmake - conan - root - - vtk + - vtk=9.4 # VTK 9.4 + - pybind11 +# - boost=1.86.0 # requested by VTK 9.4 + - ninja + - clang + - clangxx + - lld + - ccache + - OpenMP + - Geant4 diff --git a/src/Vtk/CMakeLists.txt b/src/Vtk/CMakeLists.txt index 9600b8f..370f86c 100644 --- a/src/Vtk/CMakeLists.txt +++ b/src/Vtk/CMakeLists.txt @@ -37,6 +37,8 @@ list(APPEND HEADERS ${HEP_GEANT_HEADERS}) set(LIBRARIES Eigen3::Eigen ${ROOT_LIBRARIES} ${VTK_LIBRARIES} + VTK::ImagingHybrid + VTK::ImagingSources ${PACKAGE_LIBPREFIX}Math ${PACKAGE_LIBPREFIX}Detectors ${PACKAGE_LIBPREFIX}Geant) @@ -56,7 +58,7 @@ set_target_properties(${libname} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) -target_link_libraries(${libname} ${LIBRARIES} Qt6::Widgets) +target_link_libraries(${libname} PUBLIC ${LIBRARIES} Qt6::Widgets) install(TARGETS ${libname} EXPORT "uLibTargets" diff --git a/src/Vtk/uLibVtkInterface.cxx b/src/Vtk/uLibVtkInterface.cxx index f705ffd..c30a01e 100644 --- a/src/Vtk/uLibVtkInterface.cxx +++ b/src/Vtk/uLibVtkInterface.cxx @@ -183,7 +183,7 @@ public: vtkPolyData* polydata = nullptr; if (vtkActor *actor = vtkActor::SafeDownCast(m_Prop)) { if (actor->GetMapper()) { - polydata = vtkPolyData::SafeDownCast(actor->GetMapper()->GetDataSetInput()); + polydata = vtkPolyData::SafeDownCast(actor->GetMapper()->GetInput()); } } else if (vtkAssembly *asm_p = vtkAssembly::SafeDownCast(m_Prop)) { vtkPropCollection *parts = asm_p->GetParts(); @@ -192,7 +192,7 @@ public: for (int i = 0; i < parts->GetNumberOfItems(); ++i) { vtkActor *a = vtkActor::SafeDownCast(parts->GetNextProp()); if (a && a->GetMapper()) { - polydata = vtkPolyData::SafeDownCast(a->GetMapper()->GetDataSetInput()); + polydata = vtkPolyData::SafeDownCast(a->GetMapper()->GetInput()); if (polydata) break; } }