From 7211bdfa081e3ccbee0297bb9e17b873d879c1c5 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 12 Jun 2025 16:54:48 +0200 Subject: [PATCH 01/14] Changed relative paths to source to CMAKE_CURRENT_SOURCE_DIR/path Also added CRPROPA_EXTRA_INCLUDES as cache variable for subproject support --- CMakeLists.txt | 78 ++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa1e5dede..31eeb10bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(CRPropa Fortran C CXX) set(CRPROPA_RELEASE_VERSION 3.2.1+) # Update for new release set(CMAKE_CXX_STANDARD 11) -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) set(CRPROPA_EXTRA_SOURCES) set(CRPROPA_EXTRA_INCLUDES) @@ -88,8 +88,8 @@ list(APPEND CRPROPA_EXTRA_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/src/Version.cpp") # Why is it not recommended use a pre-compiled copy of Google Test?) option(ENABLE_TESTING "Build tests and enable test target" ON) if(ENABLE_TESTING) - include_directories(libs/gtest/include) - add_subdirectory(libs/gtest) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/gtest/include) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/gtest) if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1") endif(APPLE) @@ -142,19 +142,19 @@ if(ENABLE_COVERAGE) endif(ENABLE_COVERAGE) # kiss (provided) -add_subdirectory(libs/kiss) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/kiss) list(APPEND CRPROPA_EXTRA_LIBRARIES kiss) -list(APPEND CRPROPA_EXTRA_INCLUDES libs/kiss/include) +list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/kiss/include) # HepID (provided) -add_subdirectory(libs/HepPID) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/HepPID) list(APPEND CRPROPA_EXTRA_LIBRARIES HepPID) -list(APPEND CRPROPA_EXTRA_INCLUDES libs/HepPID/include) +list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/HepPID/include) # SOPHIA (provided) -add_subdirectory(libs/sophia) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/sophia) list(APPEND CRPROPA_EXTRA_LIBRARIES sophia gfortran) -list(APPEND CRPROPA_EXTRA_INCLUDES libs/sophia) +list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/sophia) # Galactic magnetic lenses option(ENABLE_GALACTICMAGNETICLENS "Galactic Magnetic Lens" ON) @@ -171,24 +171,24 @@ if(ENABLE_GALACTICMAGNETICLENS) else(EIGEN_PATH) # Eigen redux (provided) message("Using provided EIGEN") - list(APPEND CRPROPA_EXTRA_INCLUDES libs/eigen3) + list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/eigen3) endif(EIGEN_PATH) if(INSTALL_EIGEN) - install(DIRECTORY libs/eigen3/ DESTINATION include) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/eigen3/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include) endif(INSTALL_EIGEN) # healpix redux (provided) - add_subdirectory(libs/healpix_base) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base) list(APPEND CRPROPA_EXTRA_LIBRARIES healpix_base) - list(APPEND CRPROPA_EXTRA_INCLUDES libs/healpix_base/include) - install(DIRECTORY libs/healpix_base/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") + list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base/include) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base/include/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include FILES_MATCHING PATTERN "*.h") list(APPEND CRPROPA_SWIG_DEFINES -DWITH_GALACTIC_LENSES) - list(APPEND CRPROPA_EXTRA_SOURCES src/magneticLens/MagneticLens.cpp) - list(APPEND CRPROPA_EXTRA_SOURCES src/magneticLens/ModelMatrix.cpp) - list(APPEND CRPROPA_EXTRA_SOURCES src/magneticLens/Pixelization.cpp) - list(APPEND CRPROPA_EXTRA_SOURCES src/magneticLens/ParticleMapsContainer.cpp) + list(APPEND CRPROPA_EXTRA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticLens/MagneticLens.cpp) + list(APPEND CRPROPA_EXTRA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticLens/ModelMatrix.cpp) + list(APPEND CRPROPA_EXTRA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticLens/Pixelization.cpp) + list(APPEND CRPROPA_EXTRA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticLens/ParticleMapsContainer.cpp) endif(ENABLE_GALACTICMAGNETICLENS) # OpenMP (optional for shared memory multiprocessing) @@ -252,7 +252,7 @@ endif(MUPARSER_FOUND) find_package(ZLIB) if(ZLIB_FOUND) list(APPEND CRPROPA_EXTRA_INCLUDES ${ZLIB_INCLUDE_DIRS}) - list(APPEND CRPROPA_EXTRA_INCLUDES "libs/zstream-cpp") + list(APPEND CRPROPA_EXTRA_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/libs/zstream-cpp") list(APPEND CRPROPA_EXTRA_LIBRARIES ${ZLIB_LIBRARIES}) add_definitions (-DCRPROPA_HAVE_ZLIB) list(APPEND CRPROPA_SWIG_DEFINES -DCRPROPA_HAVE_ZLIB) @@ -289,7 +289,7 @@ if(APPLE OR USE_ABSOLUTE_RPATH) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(ABSOLUTE_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") if(NOT IS_ABSOLUTE ${ABSOLUTE_RPATH}) - set(ABSOLUTE_RPATH ${CMAKE_BINARY_DIR}/${ABSOLUTE_RPATH}) + set(ABSOLUTE_RPATH ${CMAKE_CURRENT_BINARY_DIR}/${ABSOLUTE_RPATH}) endif() list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${ABSOLUTE_RPATH}" isSystemDir) @@ -313,31 +313,33 @@ if(DOWNLOAD_DATA) message("-- Downloading data files from sciebo ~ 73 MB") file(DOWNLOAD https://ruhr-uni-bochum.sciebo.de/public.php/webdav/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM - ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM + ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM USERPWD "3juW9sntQX2IWBS") - file(STRINGS ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM DATA_CHECKSUM LIMIT_COUNT 1 LENGTH_MINIMUM 32 LENGTH_MAXIMUM 32) + file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz-CHECKSUM DATA_CHECKSUM LIMIT_COUNT 1 LENGTH_MINIMUM 32 LENGTH_MAXIMUM 32) file(DOWNLOAD https://ruhr-uni-bochum.sciebo.de/public.php/webdav/data-${CRPROPA_DATAFILE_VER}.tar.gz - ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz + ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz USERPWD "3juW9sntQX2IWBS" EXPECTED_MD5 "${DATA_CHECKSUM}") message("-- Extracting data file") else() message("-- Downloading of data file disabled") endif(DOWNLOAD_DATA) -if(EXISTS ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/data ${CMAKE_BINARY_DIR}/data/ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/data ${CMAKE_CURRENT_BINARY_DIR}/data/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) else() - message(WARNING "CRPropa data file not found at ${CMAKE_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz + message(WARNING "CRPropa data file not found at ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz CRPropa should compile, but will likely not work properly! Please install data file manually, or use the automatic download which is enabled by default.") endif() # ---------------------------------------------------------------------------- # Library and Binary # ---------------------------------------------------------------------------- -file(GLOB_RECURSE CRPROPA_INCLUDES RELATIVE ${CMAKE_SOURCE_DIR} include/*.h) +file(GLOB_RECURSE CRPROPA_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h) +# set CRPROPA_EXTRA_INCLUDES as cache variable to hand it over when used as subproject +set(CRPROPA_EXTRA_INCLUDES "${CRPROPA_EXTRA_INCLUDES}" CACHE STRING "The include paths of the extra libraries that are needed." FORCE) include_directories(include ${CRPROPA_EXTRA_INCLUDES}) add_library(crpropa SHARED @@ -428,7 +430,7 @@ if(BUILD_DOC) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml COPYONLY) add_custom_target(doxy ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) - set_source_files_properties(${CMAKE_BINARY_DIR}/docstrings_from_doxy.i PROPERTIES GENERATED true ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/docstrings_from_doxy.i PROPERTIES GENERATED true ) add_custom_target(docstrings_from_doxy COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/libs/doxy2swig/doxy2swig.py ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml -o ${CMAKE_CURRENT_BINARY_DIR}/docstrings_from_doxy.i DEPENDS doxy @@ -489,9 +491,9 @@ if(ENABLE_PYTHON AND Python_FOUND) list(APPEND CRPROPA_SWIG_DEFINES -doxygen) else() if(BUILD_DOC AND DOXYGEN_FOUND) - LIST(APPEND CRPROPA_SWIG_INPUTS ${CMAKE_BINARY_DIR}/docstrings_from_doxy.i) + LIST(APPEND CRPROPA_SWIG_INPUTS ${CMAKE_CURRENT_BINARY_DIR}/docstrings_from_doxy.i) list(APPEND CRPROPA_SWIG_DEFINES -DWITH_DOXYGEN) - list(APPEND SWIG_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}) + list(APPEND SWIG_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}) endif(BUILD_DOC AND DOXYGEN_FOUND) endif(SWIG_VERSION VERSION_GREATER 4.0) @@ -515,7 +517,7 @@ if(ENABLE_PYTHON AND Python_FOUND) file(GLOB_RECURSE CRPROPA_SWIG_INPUTS python/*.i) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/crpropa_wrap.cxx PROPERTIES GENERATED true) add_custom_target(crpropa-swig-wrapper - COMMAND swig ${BUILTIN} -c++ -python -I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/libs/HepPID/include ${SWIG_INCLUDES} ${CRPROPA_SWIG_DEFINES} -dirprot -o ${CMAKE_CURRENT_BINARY_DIR}/crpropa_wrap.cxx -outdir ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/python/crpropa${BUILTIN}.i + COMMAND swig ${BUILTIN} -c++ -python -I${CMAKE_CURRENT_SOURCE_DIR}/include -I${CMAKE_CURRENT_SOURCE_DIR}/libs/HepPID/include ${SWIG_INCLUDES} ${CRPROPA_SWIG_DEFINES} -dirprot -o ${CMAKE_CURRENT_BINARY_DIR}/crpropa_wrap.cxx -outdir ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/python/crpropa${BUILTIN}.i DEPENDS ${CRPROPA_SWIG_INPUTS} ${CRPROPA_INCLUDES} ) if(BUILD_DOC AND DOXYGEN_FOUND) @@ -530,7 +532,7 @@ if(ENABLE_PYTHON AND Python_FOUND) target_link_libraries(crpropa-swig crpropa ${Python_LIBRARIES} ${Python_LIBRARY}) add_dependencies(crpropa-swig crpropa-swig-wrapper) - install(DIRECTORY "${CMAKE_SOURCE_DIR}/python/crpropa" DESTINATION "${Python_INSTALL_PACKAGE_DIR}") + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/python/crpropa" DESTINATION "${Python_INSTALL_PACKAGE_DIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/crpropa.py" DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa") install(TARGETS crpropa-swig LIBRARY DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa") install(FILES ${CRPROPA_SWIG_INPUTS} DESTINATION share/crpropa/swig_interface) @@ -543,10 +545,10 @@ endif(ENABLE_PYTHON AND Python_FOUND) # ---------------------------------------------------------------------------- add_definitions(-DCRPROPA_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") install(TARGETS crpropa DESTINATION lib) -install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h") -install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") -install(DIRECTORY ${CMAKE_BINARY_DIR}/data/ DESTINATION share/crpropa/ PATTERN ".git" EXCLUDE) -install(DIRECTORY libs/kiss/include/ DESTINATION include) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data/ DESTINATION share/crpropa/ PATTERN ".git" EXCLUDE) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/kiss/include/ DESTINATION include) # ------------------------------------------------------------------ # Documentation From aba73c149eda67b70a6237624e1a977ebae6d8e7 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Fri, 4 Jul 2025 14:38:32 +0200 Subject: [PATCH 02/14] fixed memory.h not found by changing it to --- src/magneticField/turbulentField/PlaneWaveTurbulence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/magneticField/turbulentField/PlaneWaveTurbulence.cpp b/src/magneticField/turbulentField/PlaneWaveTurbulence.cpp index 47d2e46aa..dec90acc0 100644 --- a/src/magneticField/turbulentField/PlaneWaveTurbulence.cpp +++ b/src/magneticField/turbulentField/PlaneWaveTurbulence.cpp @@ -59,7 +59,7 @@ #ifdef ENABLE_FAST_WAVES #include -#include +#include #endif namespace crpropa { From 8f687659d23be42212605e264d4978d5c44ded9a Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 14:09:41 +0200 Subject: [PATCH 03/14] istreams can now be loaded into particle collector --- include/crpropa/module/TextOutput.h | 6 ++++++ src/module/TextOutput.cpp | 25 +++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/include/crpropa/module/TextOutput.h b/include/crpropa/module/TextOutput.h index 0c21caf43..1e35034bd 100644 --- a/include/crpropa/module/TextOutput.h +++ b/include/crpropa/module/TextOutput.h @@ -70,6 +70,12 @@ class TextOutput: public Output { @param collector object of type ParticleCollector that will store the information */ static void load(const std::string &filename, ParticleCollector *collector); + /** Loads a stream to a particle collector. + This is useful for analysis involving, e.g., magnetic lenses. + @param in stream containing the data to be loaded in the same format TextOutput outputs the data + @param collector object of type ParticleCollector that will store the information + */ + static void load(std::istream* in, ParticleCollector *collector); std::string getDescription() const; void dumpIndexList(std::vector indicies); diff --git a/src/module/TextOutput.cpp b/src/module/TextOutput.cpp index cbb50487b..2b343ae2e 100644 --- a/src/module/TextOutput.cpp +++ b/src/module/TextOutput.cpp @@ -291,21 +291,14 @@ void TextOutput::process(Candidate *c) const { } void TextOutput::load(const std::string &filename, ParticleCollector *collector){ - - std::string line; std::istream *in; std::ifstream infile(filename.c_str()); - - Output output; - double lengthScale = output.getLengthScale(); - double timeScale = output.getTimeScale(); - double energyScale = output.getEnergyScale(); if (!infile.good()) throw std::runtime_error("crpropa::TextOutput: could not open file " + filename); in = &infile; - - if (kiss::ends_with(filename, ".gz")){ + + if (kiss::ends_with(filename, ".gz")){ #ifdef CRPROPA_HAVE_ZLIB in = new zstream::igzstream(*in); #else @@ -313,7 +306,19 @@ void TextOutput::load(const std::string &filename, ParticleCollector *collector) #endif } - while (std::getline(*in, line)) { + load(*in, collector); +} + +void TextOutput::load(std::istream &in, ParticleCollector *collector){ + + std::string line; + + Output output; + double lengthScale = output.getLengthScale(); + double timeScale = output.getTimeScale(); + double energyScale = output.getEnergyScale(); + + while (std::getline(in, line)) { std::stringstream stream(line); if (stream.peek() == '#') continue; From 0b13a080889288fb2a9575a50c4c45bf26131527 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 14:10:21 +0200 Subject: [PATCH 04/14] adjusted more relative paths to absolute path --- CMakeLists.txt | 248 ++++++++++++++++++++++++------------------------- 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa67173eb..035e9acb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,79 +340,80 @@ endif() file(GLOB_RECURSE CRPROPA_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h) # set CRPROPA_EXTRA_INCLUDES as cache variable to hand it over when used as subproject set(CRPROPA_EXTRA_INCLUDES "${CRPROPA_EXTRA_INCLUDES}" CACHE STRING "The include paths of the extra libraries that are needed." FORCE) +mark_as_advanced(CRPROPA_EXTRA_INCLUDES) include_directories(include ${CRPROPA_EXTRA_INCLUDES}) add_library(crpropa SHARED - src/base64.cpp - src/Candidate.cpp - src/Clock.cpp - src/Common.cpp - src/Cosmology.cpp - src/EmissionMap.cpp - src/Geometry.cpp - src/GridTools.cpp - src/Module.cpp - src/ModuleList.cpp - src/ParticleID.cpp - src/ParticleMass.cpp - src/ParticleState.cpp - src/PhotonBackground.cpp - src/ProgressBar.cpp - src/Random.cpp - src/Source.cpp - src/Variant.cpp - src/module/AdiabaticCooling.cpp - src/module/Acceleration.cpp - src/module/Boundary.cpp - src/module/BreakCondition.cpp - src/module/CandidateSplitting.cpp - src/module/DiffusionSDE.cpp - src/module/EMDoublePairProduction.cpp - src/module/EMInverseComptonScattering.cpp - src/module/EMPairProduction.cpp - src/module/EMTripletPairProduction.cpp - src/module/ElasticScattering.cpp - src/module/ElectronPairProduction.cpp - src/module/HDF5Output.cpp - src/module/MomentumDiffusion.cpp - src/module/NuclearDecay.cpp - src/module/Observer.cpp - src/module/Output.cpp - src/module/OutputShell.cpp - src/module/ParticleCollector.cpp - src/module/PhotoDisintegration.cpp - src/module/PhotoPionProduction.cpp - src/module/PhotonOutput1D.cpp - src/module/PropagationBP.cpp - src/module/PropagationCK.cpp - src/module/Redshift.cpp - src/module/RestrictToRegion.cpp - src/module/SimplePropagation.cpp - src/module/SynchrotronRadiation.cpp - src/module/TextOutput.cpp - src/module/Tools.cpp - src/magneticField/ArchimedeanSpiralField.cpp - src/magneticField/JF12Field.cpp - src/magneticField/JF12FieldSolenoidal.cpp - src/magneticField/MagneticField.cpp - src/magneticField/MagneticFieldGrid.cpp - src/magneticField/PolarizedSingleModeMagneticField.cpp - src/magneticField/PT11Field.cpp - src/magneticField/turbulentField/GridTurbulence.cpp - src/magneticField/turbulentField/HelicalGridTurbulence.cpp - src/magneticField/turbulentField/PlaneWaveTurbulence.cpp - src/magneticField/turbulentField/SimpleGridTurbulence.cpp - src/magneticField/TF17Field.cpp - src/magneticField/UF23Field.cpp - src/magneticField/KST24Field.cpp - src/magneticField/CMZField.cpp - src/advectionField/AdvectionField.cpp - src/advectionField/TimeDependentAdvectionField.cpp - src/massDistribution/ConstantDensity.cpp - src/massDistribution/Cordes.cpp - src/massDistribution/Ferriere.cpp - src/massDistribution/Massdistribution.cpp - src/massDistribution/Nakanishi.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/base64.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Candidate.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Clock.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Common.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Cosmology.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/EmissionMap.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Geometry.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/GridTools.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Module.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ModuleList.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleID.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleMass.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleState.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/PhotonBackground.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ProgressBar.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Random.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Source.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Variant.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/AdiabaticCooling.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Acceleration.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Boundary.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/BreakCondition.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/CandidateSplitting.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/DiffusionSDE.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/EMDoublePairProduction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/EMInverseComptonScattering.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/EMPairProduction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/EMTripletPairProduction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/ElasticScattering.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/ElectronPairProduction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/HDF5Output.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/MomentumDiffusion.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/NuclearDecay.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Observer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Output.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/OutputShell.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/ParticleCollector.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/PhotoDisintegration.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/PhotoPionProduction.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/PhotonOutput1D.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/PropagationBP.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/PropagationCK.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Redshift.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/RestrictToRegion.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/SimplePropagation.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/SynchrotronRadiation.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/TextOutput.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/module/Tools.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/ArchimedeanSpiralField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/JF12Field.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/JF12FieldSolenoidal.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/MagneticField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/MagneticFieldGrid.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/PolarizedSingleModeMagneticField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/PT11Field.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/turbulentField/GridTurbulence.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/turbulentField/HelicalGridTurbulence.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/turbulentField/PlaneWaveTurbulence.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/turbulentField/SimpleGridTurbulence.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/TF17Field.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/UF23Field.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/KST24Field.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/magneticField/CMZField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/advectionField/AdvectionField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/advectionField/TimeDependentAdvectionField.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/massDistribution/ConstantDensity.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/massDistribution/Cordes.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/massDistribution/Ferriere.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/massDistribution/Massdistribution.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/massDistribution/Nakanishi.cpp ${CRPROPA_EXTRA_SOURCES} ) @@ -427,8 +428,8 @@ if(BUILD_DOC) find_package(Doxygen) if(DOXYGEN_FOUND) MESSAGE(STATUS "Found Doxygen to build documentation") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml COPYONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml" ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml COPYONLY) add_custom_target(doxy ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/docstrings_from_doxy.i PROPERTIES GENERATED true ) @@ -536,7 +537,7 @@ if(ENABLE_PYTHON AND Python_FOUND) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/python/crpropa" DESTINATION "${Python_INSTALL_PACKAGE_DIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/crpropa.py" DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa") install(TARGETS crpropa-swig LIBRARY DESTINATION "${Python_INSTALL_PACKAGE_DIR}/crpropa") - install(FILES ${CRPROPA_SWIG_INPUTS} DESTINATION share/crpropa/swig_interface) + install(FILES ${CRPROPA_SWIG_INPUTS} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/crpropa/swig_interface) endif(ENABLE_PYTHON AND Python_FOUND) @@ -544,12 +545,11 @@ endif(ENABLE_PYTHON AND Python_FOUND) # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- -add_definitions(-DCRPROPA_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") -install(TARGETS crpropa DESTINATION lib) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h") -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data/ DESTINATION share/crpropa/ PATTERN ".git" EXCLUDE) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/kiss/include/ DESTINATION include) +install(TARGETS crpropa DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/crpropa/ PATTERN ".git" EXCLUDE) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/kiss/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include) # ------------------------------------------------------------------ # Documentation @@ -569,8 +569,8 @@ if(BUILD_DOC AND DOXYGEN_FOUND AND SPHINX_EXECUTABLE) find_package_handle_standard_args(Sphinx "Failed to find sphinx-build executable" SPHINX_EXECUTABLE) - set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc) - set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc) + set(SPHINX_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/doc") + set(SPHINX_BUILD "${CMAKE_CURRENT_BINARY_DIR}/doc") add_custom_target(doc ${SPHINX_EXECUTABLE} -b html -Dbreathe_projects.CRPropa3=${CMAKE_CURRENT_BINARY_DIR}/xml @@ -586,90 +586,90 @@ endif(BUILD_DOC AND DOXYGEN_FOUND AND SPHINX_EXECUTABLE) # ---------------------------------------------------------------------------- if(ENABLE_TESTING) enable_testing() - add_executable(testCore test/testCore.cpp) - target_link_libraries(testCore crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testCore testCore) + add_executable(testCore ${CMAKE_CURRENT_SOURCE_DIR}/test/testCore.cpp) + target_link_libraries(testCore crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) + add_test(testCore ${CMAKE_CURRENT_BINARY_DIR}/testCore) - add_executable(testVector3 test/testVector3.cpp) + add_executable(testVector3 ${CMAKE_CURRENT_SOURCE_DIR}/test/testVector3.cpp) target_link_libraries(testVector3 crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testVector3 testVector3) + add_test(testVector3 ${CMAKE_CURRENT_BINARY_DIR}/testVector3) - add_executable(testModuleList test/testModuleList.cpp) + add_executable(testModuleList ${CMAKE_CURRENT_SOURCE_DIR}/test/testModuleList.cpp) target_link_libraries(testModuleList crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testModuleList testModuleList) + add_test(testModuleList ${CMAKE_CURRENT_BINARY_DIR}/testModuleList) - add_executable(testMagneticField test/testMagneticField.cpp) + add_executable(testMagneticField ${CMAKE_CURRENT_SOURCE_DIR}/test/testMagneticField.cpp) target_link_libraries(testMagneticField crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testMagneticField testMagneticField) + add_test(testMagneticField ${CMAKE_CURRENT_BINARY_DIR}/testMagneticField) - add_executable(testTurbulentField test/testTurbulentField.cpp) + add_executable(testTurbulentField ${CMAKE_CURRENT_SOURCE_DIR}/test/testTurbulentField.cpp) target_link_libraries(testTurbulentField crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testTurbulentField testTurbulentField) + add_test(testTurbulentField ${CMAKE_CURRENT_BINARY_DIR}/testTurbulentField) - add_executable(testAdvectionField test/testAdvectionField.cpp) + add_executable(testAdvectionField ${CMAKE_CURRENT_SOURCE_DIR}/test/testAdvectionField.cpp) target_link_libraries(testAdvectionField crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testAdvectionField testAdvectionField) + add_test(testAdvectionField ${CMAKE_CURRENT_BINARY_DIR}/testAdvectionField) - add_executable(testDensity test/testDensity.cpp) + add_executable(testDensity ${CMAKE_CURRENT_SOURCE_DIR}/test/testDensity.cpp) target_link_libraries(testDensity crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testDensity testDensity) + add_test(testDensity ${CMAKE_CURRENT_BINARY_DIR}/testDensity) - add_executable(testPropagation test/testPropagation.cpp) + add_executable(testPropagation ${CMAKE_CURRENT_SOURCE_DIR}/test/testPropagation.cpp) target_link_libraries(testPropagation crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testPropagation testPropagation) + add_test(testPropagation ${CMAKE_CURRENT_BINARY_DIR}/testPropagation) - add_executable(testBreakCondition test/testBreakCondition.cpp) + add_executable(testBreakCondition ${CMAKE_CURRENT_SOURCE_DIR}/test/testBreakCondition.cpp) target_link_libraries(testBreakCondition crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testBreakCondition testBreakCondition) + add_test(testBreakCondition ${CMAKE_CURRENT_BINARY_DIR}/testBreakCondition) - add_executable(testInteraction test/testInteraction.cpp) + add_executable(testInteraction ${CMAKE_CURRENT_SOURCE_DIR}/test/testInteraction.cpp) target_link_libraries(testInteraction crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testInteraction testInteraction) + add_test(testInteraction ${CMAKE_CURRENT_BINARY_DIR}/testInteraction) - add_executable(testSource test/testSource.cpp) + add_executable(testSource ${CMAKE_CURRENT_SOURCE_DIR}/test/testSource.cpp) target_link_libraries(testSource crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testSource testSource) + add_test(testSource ${CMAKE_CURRENT_BINARY_DIR}/testSource) - add_executable(testOutput test/testOutput.cpp) + add_executable(testOutput ${CMAKE_CURRENT_SOURCE_DIR}/test/testOutput.cpp) target_link_libraries(testOutput crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testOutput testOutput) + add_test(testOutput ${CMAKE_CURRENT_BINARY_DIR}/testOutput) - add_executable(testFunctionalGroups test/testFunctionalGroups.cpp) + add_executable(testFunctionalGroups ${CMAKE_CURRENT_SOURCE_DIR}/test/testFunctionalGroups.cpp) target_link_libraries(testFunctionalGroups crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testFunctionalGroups testFunctionalGroups) + add_test(testFunctionalGroups ${CMAKE_CURRENT_BINARY_DIR}/testFunctionalGroups) - add_executable(testAdiabaticCooling test/testAdiabaticCooling.cpp) + add_executable(testAdiabaticCooling ${CMAKE_CURRENT_SOURCE_DIR}/test/testAdiabaticCooling.cpp) target_link_libraries(testAdiabaticCooling crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testAdiabaticCooling testAdiabaticCooling) + add_test(testAdiabaticCooling ${CMAKE_CURRENT_BINARY_DIR}/testAdiabaticCooling) - add_executable(testCandidateSplitting test/testCandidateSplitting.cpp) + add_executable(testCandidateSplitting ${CMAKE_CURRENT_SOURCE_DIR}/test/testCandidateSplitting.cpp) target_link_libraries(testCandidateSplitting crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testCandidateSplitting testCandidateSplitting) + add_test(testCandidateSplitting ${CMAKE_CURRENT_BINARY_DIR}/testCandidateSplitting) if(WITH_GALACTIC_LENSES) - add_executable(testGalacticMagneticLens test/testMagneticLens.cpp) + add_executable(testGalacticMagneticLens ${CMAKE_CURRENT_SOURCE_DIR}/test/testMagneticLens.cpp) target_link_libraries(testGalacticMagneticLens crpropa gtest gtest_main pthread ${COVERAGE_LIBS}) - add_test(testGalacticMagneticLens testGalacticMagneticLens) + add_test(testGalacticMagneticLens ${CMAKE_CURRENT_BINARY_DIR}/testGalacticMagneticLens) endif(WITH_GALACTIC_LENSES) # python tests if(ENABLE_PYTHON AND Python_FOUND) - CONFIGURE_FILE(test/testMagneticLensPythonInterface.py testMagneticLensPythonInterface.py COPYONLY) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test/testMagneticLensPythonInterface.py ${CMAKE_CURRENT_BINARY_DIR}/testMagneticLensPythonInterface.py COPYONLY) if(numpyIncludePath AND WITH_GALACTIC_LENSES) - add_test(testMagneticLensPythonInterface ${Python_EXECUTABLE} testMagneticLensPythonInterface.py) + add_test(testMagneticLensPythonInterface ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/testMagneticLensPythonInterface.py) endif(numpyIncludePath AND WITH_GALACTIC_LENSES) - CONFIGURE_FILE(test/testSimulationExecution.py testSimulationExecution.py COPYONLY) - add_test(testSimulationExecution ${Python_EXECUTABLE} testSimulationExecution.py) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test/testSimulationExecution.py ${CMAKE_CURRENT_BINARY_DIR}/testSimulationExecution.py COPYONLY) + add_test(testSimulationExecution ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/testSimulationExecution.py) - CONFIGURE_FILE(test/testDiffusionSDE.py testDiffusionSDE.py COPYONLY) - add_test(testDiffusionSDE ${Python_EXECUTABLE} testDiffusionSDE.py) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test/testDiffusionSDE.py ${CMAKE_CURRENT_BINARY_DIR}/testDiffusionSDE.py COPYONLY) + add_test(testDiffusionSDE ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/testDiffusionSDE.py) - CONFIGURE_FILE(test/testMomentumDiffusion.py testMomentumDiffusion.py COPYONLY) - add_test(testMomentumDiffusion ${Python_EXECUTABLE} testMomentumDiffusion.py) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test/testMomentumDiffusion.py ${CMAKE_CURRENT_BINARY_DIR}/testMomentumDiffusion.py COPYONLY) + add_test(testMomentumDiffusion ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/testMomentumDiffusion.py) - CONFIGURE_FILE(test/testPythonExtension.py testPythonExtension.py COPYONLY) - add_test(testPythonExtension ${Python_EXECUTABLE} testPythonExtension.py) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test/testPythonExtension.py ${CMAKE_CURRENT_BINARY_DIR}/testPythonExtension.py COPYONLY) + add_test(testPythonExtension ${Python_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/testPythonExtension.py) endif(ENABLE_PYTHON AND Python_FOUND) endif(ENABLE_TESTING) From e461eb8c846f7c1205a1348a7537cb8bf5c29d87 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 14:38:26 +0200 Subject: [PATCH 05/14] fixed wrong header --- include/crpropa/module/TextOutput.h | 2 +- src/module/TextOutput.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/crpropa/module/TextOutput.h b/include/crpropa/module/TextOutput.h index 1e35034bd..93c1e2799 100644 --- a/include/crpropa/module/TextOutput.h +++ b/include/crpropa/module/TextOutput.h @@ -75,7 +75,7 @@ class TextOutput: public Output { @param in stream containing the data to be loaded in the same format TextOutput outputs the data @param collector object of type ParticleCollector that will store the information */ - static void load(std::istream* in, ParticleCollector *collector); + static void load(std::istream &in, ParticleCollector *collector); std::string getDescription() const; void dumpIndexList(std::vector indicies); diff --git a/src/module/TextOutput.cpp b/src/module/TextOutput.cpp index 2b343ae2e..c350fe099 100644 --- a/src/module/TextOutput.cpp +++ b/src/module/TextOutput.cpp @@ -307,6 +307,7 @@ void TextOutput::load(const std::string &filename, ParticleCollector *collector) } load(*in, collector); + infile.close(); } void TextOutput::load(std::istream &in, ParticleCollector *collector){ @@ -365,7 +366,6 @@ void TextOutput::load(std::istream &in, ParticleCollector *collector){ collector->process(c); } - infile.close(); } std::string TextOutput::getDescription() const { From 6cd72641d3f0c147e3671e1567c5267cdd7c7ede Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 15:43:07 +0200 Subject: [PATCH 06/14] cleanup (ModuleList.cpp was added twice) --- CMakeLists.txt | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 035e9acb7..8b534881a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,16 +118,16 @@ if(ENABLE_COVERAGE) if(ENABLE_TESTING) SET(COVERAGE_LIBS "-coverage -lgcov") add_custom_target(coverage_clean - COMMAND ${LCOV_PATH} --directory . --zerocounters + COMMAND ${LCOV_PATH} --directory ${CMAKE_CURRENT_BINARY_DIR} --zerocounters ) add_custom_target(coverage # generate coverage data - COMMAND ${LCOV_PATH} --directory . --capture --output-file coverage.info VERBATIM + COMMAND ${LCOV_PATH} --directory ${CMAKE_CURRENT_BINARY_DIR} --capture --output-file ${CMAKE_CURRENT_BINARY_DIR}/coverage.info VERBATIM # clean external libs - COMMAND ${LCOV_PATH} --remove coverage.info "/usr/include/*" "/usr/lib/*" "*/libs/gtest/*" "*/libs/eigen3/*" "*/libs/zstream-cpp/*" "*/build/*" -o coverage.info.cleaned VERBATIM + COMMAND ${LCOV_PATH} --remove ${CMAKE_CURRENT_BINARY_DIR}/coverage.info "/usr/include/*" "/usr/lib/*" "*/libs/gtest/*" "*/libs/eigen3/*" "*/libs/zstream-cpp/*" "*/build/*" -o ${CMAKE_CURRENT_BINARY_DIR}/coverage.info.cleaned VERBATIM # Generate html output - COMMAND ${GENHTML_PATH} -o coverageReport coverage.info.cleaned VERBATIM - COMMAND echo "Generated coverage report in coverageReport/index.html" + COMMAND ${GENHTML_PATH} -o ${CMAKE_CURRENT_BINARY_DIR}/coverageReport ${CMAKE_CURRENT_BINARY_DIR}/coverage.info.cleaned VERBATIM + COMMAND echo "Generated coverage report in ${CMAKE_CURRENT_BINARY_DIR}/coverageReport/index.html" ) endif(ENABLE_TESTING) @@ -174,14 +174,14 @@ if(ENABLE_GALACTICMAGNETICLENS) list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/eigen3) endif(EIGEN_PATH) if(INSTALL_EIGEN) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/eigen3/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/eigen3/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include) endif(INSTALL_EIGEN) # healpix redux (provided) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base) list(APPEND CRPROPA_EXTRA_LIBRARIES healpix_base) list(APPEND CRPROPA_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base/include) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base/include/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/healpix_base/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") list(APPEND CRPROPA_SWIG_DEFINES -DWITH_GALACTIC_LENSES) @@ -205,7 +205,6 @@ endif(ENABLE_OPENMP) # Additional configuration OMP_SCHEDULE set(OMP_SCHEDULE "static,100" CACHE STRING "FORMAT type,chunksize") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/ModuleList.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/src/ModuleList.cpp" @ONLY) -list(APPEND CRPROPA_EXTRA_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/src/ModuleList.cpp") # Google Performance Tools (optional as possible performance tweak for OpenMP) find_package(GooglePerfTools) @@ -321,14 +320,14 @@ if(DOWNLOAD_DATA) ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz USERPWD "3juW9sntQX2IWBS" EXPECTED_MD5 "${DATA_CHECKSUM}") - message("-- Extracting data file") else() message("-- Downloading of data file disabled") endif(DOWNLOAD_DATA) if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/data ${CMAKE_CURRENT_BINARY_DIR}/data/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + message("-- Extracting data file") + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf data-${CRPROPA_DATAFILE_VER}.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory data-${CRPROPA_DATAFILE_VER}/data data/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory data-${CRPROPA_DATAFILE_VER}/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) else() message(WARNING "CRPropa data file not found at ${CMAKE_CURRENT_BINARY_DIR}/data-${CRPROPA_DATAFILE_VER}.tar.gz CRPropa should compile, but will likely not work properly! Please install data file manually, or use the automatic download which is enabled by default.") @@ -353,7 +352,7 @@ add_library(crpropa SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/Geometry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/GridTools.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/Module.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/ModuleList.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/ModuleList.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleID.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleMass.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/ParticleState.cpp @@ -430,7 +429,7 @@ if(BUILD_DOC) MESSAGE(STATUS "Found Doxygen to build documentation") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml" ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml COPYONLY) - add_custom_target(doxy ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) + add_custom_target(doxy ${DOXYGEN_EXECUTABLE} Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/docstrings_from_doxy.i PROPERTIES GENERATED true ) add_custom_target(docstrings_from_doxy @@ -573,7 +572,7 @@ if(BUILD_DOC AND DOXYGEN_FOUND AND SPHINX_EXECUTABLE) set(SPHINX_BUILD "${CMAKE_CURRENT_BINARY_DIR}/doc") add_custom_target(doc ${SPHINX_EXECUTABLE} -b html - -Dbreathe_projects.CRPropa3=${CMAKE_CURRENT_BINARY_DIR}/xml + -Dbreathe_projects.CRPropa3=xml ${SPHINX_SOURCE} ${SPHINX_BUILD} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation with Sphinx") From fe921e6e32b17f39577aea37f904e93238746237 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 17:23:14 +0200 Subject: [PATCH 07/14] added previous removed definition which is required by Common.cpp --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b534881a..d9d6b9b80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -544,6 +544,7 @@ endif(ENABLE_PYTHON AND Python_FOUND) # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- +add_definitions(-DCRPROPA_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") install(TARGETS crpropa DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") From 40edd830aeb3e487a1d38430cc0992f9ac61c2bc Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Thu, 14 Aug 2025 18:59:47 +0200 Subject: [PATCH 08/14] added binary folder to search in Common::getDataPath --- CMakeLists.txt | 3 +++ src/Common.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9d6b9b80..0eeeabf77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -544,6 +544,9 @@ endif(ENABLE_PYTHON AND Python_FOUND) # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- + +# makes the binary directory visible to c++, needed to have a last resort when searching for data +add_definitions(-DCRPROPA_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") add_definitions(-DCRPROPA_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") install(TARGETS crpropa DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h") diff --git a/src/Common.cpp b/src/Common.cpp index a8bf997fd..8d7bd917c 100644 --- a/src/Common.cpp +++ b/src/Common.cpp @@ -50,6 +50,18 @@ std::string getDataPath(std::string filename) { } } +#ifdef CRPROPA_BINARY_DIR + { + std::string _path = CRPROPA_BINARY_DIR "/data"; + if (is_directory(_path)) { + dataPath = _path; + KISS_LOG_INFO + << "getDataPath: use binary path, " << dataPath << std::endl; + return concat_path(dataPath, filename); + } + } +#endif + dataPath = "data"; KISS_LOG_INFO << "getDataPath: use default, " << dataPath << std::endl; return concat_path(dataPath, filename); From edca45f3587c9052986ba7a8c2a5c456c3e064d2 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Mon, 16 Feb 2026 15:43:29 +0100 Subject: [PATCH 09/14] specified another possible name for google perftools directory --- cmake/FindGooglePerfTools.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindGooglePerfTools.cmake b/cmake/FindGooglePerfTools.cmake index 3d4ca76c5..b02f984ef 100644 --- a/cmake/FindGooglePerfTools.cmake +++ b/cmake/FindGooglePerfTools.cmake @@ -7,7 +7,7 @@ # STACKTRACE_LIBRARIES, where to find the stacktrace library. # PROFILER_LIBRARIES, where to find the profiler library. -FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h) +FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR NAMES google/heap-profiler.h gperftools/heap-profiler.h) SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc) FIND_LIBRARY(TCMALLOC_LIBRARY NAMES ${TCMALLOC_NAMES}) From 335898d37b0d837d83b5786c59e395b9aaf915f0 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Mon, 16 Feb 2026 16:32:05 +0100 Subject: [PATCH 10/14] added .vscode --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 75599931a..0aacf2fd3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ cmake/CMakeFiles/ *.dat *.ipynb_checkpoints *.idea +*.vscode \ No newline at end of file From 123796aec6e68c472958b2348966939975a6e7c7 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Mon, 16 Feb 2026 16:32:39 +0100 Subject: [PATCH 11/14] updated Cpp-projects.md to funciton correctly --- doc/pages/Cpp-projects.md | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/doc/pages/Cpp-projects.md b/doc/pages/Cpp-projects.md index adcd8d619..f989bb176 100644 --- a/doc/pages/Cpp-projects.md +++ b/doc/pages/Cpp-projects.md @@ -1,49 +1,49 @@ ## Using CRPropa from C++ Although is highly recommended to use and [to extend](Extending CRPropa) CRPropa with the default Python binding, there is also a possibility to use it within a C++ code when Python or SWIG are not available or desirable. -To include CRPropa classes and definitions it is sufficient to include ``crpropa/CRPropa.h``, example: +To include CRPropa classes and definitions it is sufficient to include ``CRPropa.h``, example: ```c++ -#include "crpropa/CRPropa.h" +#include "CRPropa.h" using namespace crpropa; int main(void) { - ModuleList sim; - sim.add(new SimplePropagation(1*kpc, 10*Mpc)); - sim.add(new Redshift()); - sim.add(new PhotoPionProduction(CMB)); - sim.add(new PhotoPionProduction(IRB)); - sim.add(new PhotoDisintegration(CMB)); - sim.add(new PhotoDisintegration(IRB)); - sim.add(new NuclearDecay()); - sim.add(new ElectronPairProduction(CMB)); - sim.add(new ElectronPairProduction(IRB)); - sim.add(new MinimumEnergy(1*EeV)); - - ref_ptr obs = new Observer(); - obs->add(new Observer1D()); - obs->onDetection(new TextOutput("events.txt", Output::Event1D)); - obs->onDetection(new TextOutput()); - sim.add(obs); - - ref_ptr source = new Source(); - source->add(new SourceUniform1D(1*Mpc, 1000*Mpc)); - source->add(new SourceRedshift1D()); - - ref_ptr composition = - new SourceComposition(1*EeV, 100*EeV, -1); - composition->add(1, 1, 1); - composition->add(4, 2, 1); - composition->add(14, 7, 1); - composition->add(56, 26, 1); - source->add(composition); - - sim.setShowProgress(true); - sim.run(source, 2000, true); - - return 0; + ModuleList sim; + sim.add(new SimplePropagation(1*kpc, 10*Mpc)); + sim.add(new Redshift()); + sim.add(new PhotoPionProduction(new CMB())); + sim.add(new PhotoPionProduction(new IRB_Kneiske04())); + sim.add(new PhotoDisintegration(new CMB())); + sim.add(new PhotoDisintegration(new IRB_Kneiske04())); + sim.add(new NuclearDecay()); + sim.add(new ElectronPairProduction(new CMB())); + sim.add(new ElectronPairProduction(new IRB_Kneiske04())); + sim.add(new MinimumEnergy(1*EeV)); + + ref_ptr obs = new Observer(); + obs->add(new Observer1D()); + obs->onDetection(new TextOutput("events.txt", Output::Event1D)); + obs->onDetection(new TextOutput()); + sim.add(obs); + + ref_ptr source = new Source(); + source->add(new SourceUniform1D(1*Mpc, 1000*Mpc)); + source->add(new SourceRedshift1D()); + + ref_ptr composition = + new SourceComposition(1*EeV, 100*EeV, -1); + composition->add(1, 1, 1); + composition->add(4, 2, 1); + composition->add(14, 7, 1); + composition->add(56, 26, 1); + source->add(composition); + + sim.setShowProgress(true); + sim.run(source.get(), 2000, true); + + return 0; } ``` From cc4f4e8ed748fc31b7b861f8675d018a9ba18976 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Mon, 16 Feb 2026 16:33:09 +0100 Subject: [PATCH 12/14] added conda install instructions and updated some old instructions --- doc/pages/Installation.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/pages/Installation.md b/doc/pages/Installation.md index c9f69ead5..a9e3971d6 100644 --- a/doc/pages/Installation.md +++ b/doc/pages/Installation.md @@ -38,12 +38,12 @@ The following packages are provided with the source code and do not need to be i mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local - make - make install + cmake --build . + cmake --install . ``` -2. A set of unit tests can be run with ```make test```. If the tests are - successful continue with ```make install``` to install CRPropa at the +2. A set of unit tests can be run with ```ctest```. If the tests are + successful continue with ```cmake --install .``` to install CRPropa at the specified path, or leave it in the build directory. Make sure the environment variables are set accordingly: e.g. for an installation under $HOME/.local and using Python 3 set @@ -54,7 +54,7 @@ The following packages are provided with the source code and do not need to be i export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig:$PKG_CONFIG_PATH ``` -However, we highly recommend to use a virtualenv setup to install CRPropa! +However, we highly recommend to use a virtualenv or conda setup to install CRPropa! ### Installation in python virtualenv @@ -117,11 +117,11 @@ worthwhile effort afterwards. mkdir build cd build CMAKE_PREFIX_PATH=$CRPROPA_DIR cmake -DCMAKE_INSTALL_PREFIX=$CRPROPA_DIR .. - make - make install + cmake --build . + cmake --install . ``` -5. A set of unit tests can be run with ```make test```. +5. A set of unit tests can be run with ```ctest```. 6. (optional) Check the installation. ```python @@ -135,6 +135,13 @@ worthwhile effort afterwards. There also exists [bash script](https://github.com/adundovi/CRPropa3-scripts/tree/master/deploy_crpropa) for GNU/Linux systems which automate the described procedure. +### Installation in conda environment + +On high performance cluster most modules that CRPropa requires are usally not provided by default. +A popular way to install programs locally that require certain preinstalled libraries with specific +versions (this then can lead to conflicts between programs) is to use conda environments. +A detailed installation guide for conda can be found on their [website](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html). +After installing conda and creating a new environment with `conda create {ENVNAME}` and activating it with `conda activate {ENVNAME}`, CRPropa can then simply be installed with `conda install crpropa::crpropa -c conda-forge` or `conda install crpropa::crpropa==master -c conda-forge` if you want the newest development version. ### CMake flags When using cmake, the following options can be set by adding flags to the cmake command, e.g. From cfd826f98557987d5f5524fa565c856994b3d1d7 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Mon, 16 Feb 2026 16:39:47 +0100 Subject: [PATCH 13/14] added changes to CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 344caca60..cb3ea9dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Fixed r term in source distribution for SNR and Pulsar * Fixed wrong mass inheritance for secondaries other than nuclei or electron/positron * Fixed wrong generation of interval ranges in ObserverTimeEvolution +* Improved CMakeLists.txt to better work as submodule on other cpp based projects ### New features: From 40635277aca7efc8959f5fa1369e519795bafafc Mon Sep 17 00:00:00 2001 From: Jan-Niklas Bohnensack Date: Wed, 1 Apr 2026 01:56:36 +0200 Subject: [PATCH 14/14] Removed conda install instructions since conda package is not officially supported yet --- doc/pages/Installation.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/pages/Installation.md b/doc/pages/Installation.md index a9e3971d6..259d29815 100644 --- a/doc/pages/Installation.md +++ b/doc/pages/Installation.md @@ -135,13 +135,6 @@ worthwhile effort afterwards. There also exists [bash script](https://github.com/adundovi/CRPropa3-scripts/tree/master/deploy_crpropa) for GNU/Linux systems which automate the described procedure. -### Installation in conda environment - -On high performance cluster most modules that CRPropa requires are usally not provided by default. -A popular way to install programs locally that require certain preinstalled libraries with specific -versions (this then can lead to conflicts between programs) is to use conda environments. -A detailed installation guide for conda can be found on their [website](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html). -After installing conda and creating a new environment with `conda create {ENVNAME}` and activating it with `conda activate {ENVNAME}`, CRPropa can then simply be installed with `conda install crpropa::crpropa -c conda-forge` or `conda install crpropa::crpropa==master -c conda-forge` if you want the newest development version. ### CMake flags When using cmake, the following options can be set by adding flags to the cmake command, e.g.