Compare commits
4 Commits
54997fe0ac
...
8566ceb662
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8566ceb662 | ||
|
|
5ae2e106ab | ||
| c526f61f8c | |||
| 94bad596ed |
@@ -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
9
CMakeUserPresets.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 4,
|
||||
"vendor": {
|
||||
"conan": {}
|
||||
},
|
||||
"include": [
|
||||
"build/CMakePresets.json"
|
||||
]
|
||||
}
|
||||
54
README.md
54
README.md
@@ -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
7
conanfile.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
[requires]
|
||||
eigen/3.4.0
|
||||
boost/1.83.0
|
||||
|
||||
[generators]
|
||||
CMakeDeps
|
||||
CMakeToolchain
|
||||
10
condaenv.yml
Normal file
10
condaenv.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
name: mutom
|
||||
channels:
|
||||
- conda-forge
|
||||
dependencies:
|
||||
- compiler-rt
|
||||
- make
|
||||
- cmake
|
||||
- conan
|
||||
- root
|
||||
- vtk
|
||||
@@ -32,7 +32,7 @@ set(SOURCES VoxRaytracer.cpp
|
||||
Structured2DGrid.cpp
|
||||
Structured4DGrid.cpp)
|
||||
|
||||
set(LIBRARIES ${Eigen_LIBRARY}
|
||||
set(LIBRARIES Eigen3::Eigen
|
||||
${ROOT_LIBRARIES}
|
||||
${VTK_LIBRARIES})
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include <vtkConfigure.h>
|
||||
#include <vtkVersion.h>
|
||||
#include <vtkProp.h>
|
||||
#include <vtkActor.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user