4 Commits

Author SHA1 Message Date
AndreaRigoni
8566ceb662 feat: add condaenv.yml for environment setup and update README.md with detailed build instructions. 2026-02-20 18:05:40 +00:00
AndreaRigoni
5ae2e106ab added conanfile 2026-02-20 17:27:30 +00:00
c526f61f8c Merge pull request #3 from OpenCMT/andrea-dev
fix mismatch Origin - Position
2025-09-25 17:38:45 +02:00
94bad596ed Merge pull request #2 from OpenCMT/andrea-dev
fix export to Vti
2025-09-23 18:52:54 +02:00
11 changed files with 92 additions and 10 deletions

View File

@@ -84,11 +84,13 @@ enable_testing()
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
message(STATUS "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}")
find_package(Boost 1.45.0 COMPONENTS program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
find_package(Eigen3 CONFIG REQUIRED)
include(${EIGEN3_USE_FILE})
get_target_property(EIGEN3_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
include_directories(${EIGEN3_INCLUDE_DIRS})
find_package(ROOT CONFIG REQUIRED)
include(${ROOT_USE_FILE})

9
CMakeUserPresets.json Normal file
View File

@@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/CMakePresets.json"
]
}

View File

@@ -7,3 +7,57 @@ base toolkit library
CMT Cosmic Muon Tomography reconstruction, analysis and imaging software
Developed by University of Padova and INFN Sezione di Padova Italy
## Build Instructions
This project relies on `conan` (v2) for dependency management (Eigen3, Boost) and `cmake` for configuration. VTK is provided through the micromamba/conda-forge environment.
### Prerequisites
This project requires a `conda` or `micromamba` environment containing the necessary global tools like **ROOT**, **VTK**, and **Conan** (v2). We provide a `condaenv.yml` file to quickly build this environment.
#### Installing Micromamba (Optional)
If you do not have `conda` installed, `micromamba` is a fast and lightweight alternative. You can install it on Linux via:
```bash
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
```
#### Creating the Environment
You can create and activate the environment using either `micromamba` or `conda`.
**Using Micromamba:**
```bash
micromamba env create -f condaenv.yml
micromamba activate mutom
```
**Using Conda:**
```bash
conda env create -f condaenv.yml
conda activate mutom
```
### Configure and Build
1. **Configure Conan profile (if you haven't yet on your machine):**
```bash
conan profile detect
```
2. **Install Conan dependencies:**
```bash
conan install . --output-folder=build --build=missing
```
3. **Configure the project with CMake:**
```bash
cmake --preset conan-release
```
*(Alternatively: `cd build && cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release`)*
4. **Build the project:**
```bash
cmake --build build -j10
```

7
conanfile.txt Normal file
View File

@@ -0,0 +1,7 @@
[requires]
eigen/3.4.0
boost/1.83.0
[generators]
CMakeDeps
CMakeToolchain

10
condaenv.yml Normal file
View File

@@ -0,0 +1,10 @@
name: mutom
channels:
- conda-forge
dependencies:
- compiler-rt
- make
- cmake
- conan
- root
- vtk

View File

@@ -32,7 +32,7 @@ set(SOURCES VoxRaytracer.cpp
Structured2DGrid.cpp
Structured4DGrid.cpp)
set(LIBRARIES ${Eigen_LIBRARY}
set(LIBRARIES Eigen3::Eigen
${ROOT_LIBRARIES}
${VTK_LIBRARIES})

View File

@@ -14,7 +14,7 @@ set(SOURCES uLibVtkInterface.cxx
vtkVoxRaytracerRepresentation.cpp
vtkVoxImage.cpp)
set(LIBRARIES ${Eigen_LIBRARY}
set(LIBRARIES Eigen3::Eigen
${ROOT_LIBRARIES}
${VTK_LIBRARIES}
${PACKAGE_LIBPREFIX}Math)

View File

@@ -37,7 +37,7 @@
#endif
#include <vtkConfigure.h>
#include <vtkVersion.h>
#include <vtkProp.h>
#include <vtkActor.h>
#include <vtkSmartPointer.h>

View File

@@ -28,7 +28,7 @@
#ifndef VTKMUONSCATTER_H
#define VTKMUONSCATTER_H
#include <vtkConfigure.h>
#include <vtkVersion.h>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
#include <vtkAppendPolyData.h>

View File

@@ -28,11 +28,11 @@
#ifndef U_VTKVOXIMAGE_H
#define U_VTKVOXIMAGE_H
#include "vtk/vtkVolume.h"
#include "vtk/vtkImageData.h"
#include "vtk/vtkXMLImageDataReader.h"
#include "vtk/vtkXMLImageDataWriter.h"
#include "vtk/vtkCubeSource.h"
#include <vtkVolume.h>
#include <vtkImageData.h>
#include <vtkXMLImageDataReader.h>
#include <vtkXMLImageDataWriter.h>
#include <vtkCubeSource.h>
#include <Math/VoxImage.h>