Skip to content

Commit

Permalink
Try to instantiate C8 class
Browse files Browse the repository at this point in the history
Test for missing libraries
  • Loading branch information
sfegan committed Mar 6, 2025
1 parent 2591f3b commit 689f993
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
32 changes: 30 additions & 2 deletions CMakeModules/FindCORSIKA8.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,52 @@
# also defined, but not for general use are
# CORSIKA8_LIBRARY, where to find the CORSIKA8 library.


find_path ( CORSIKA8_INCLUDE_DIR corsika.hpp PATH_SUFFIXES corsika HINTS ${CORSIKA8_DIR} )
cmake_path( GET CORSIKA8_INCLUDE_DIR PARENT_PATH CORSIKA8_INCLUDE_DIR)

find_library ( CORSIKA8_DATA_LIBRARY PATH_SUFFIXES corsika NAMES CorsikaData HINTS ${CORSIKA8_DIR} )
find_library ( PROPOSAL_LIBRARY NAMES PROPOSAL HINTS ${CORSIKA8_DIR} )
find_library ( EPOS_LIBRARY PATH_SUFFIXES corsika NAMES EPOS_static HINTS ${CORSIKA8_DIR} )
find_library ( QGSJET_LIBRARY PATH_SUFFIXES corsika NAMES QGSJetII_static HINTS ${CORSIKA8_DIR} )
find_library ( SIBYLL_LIBRARY PATH_SUFFIXES corsika NAMES Sibyll HINTS ${CORSIKA8_DIR} )
find_library ( PYTHIA8_LIBRARY PATH_SUFFIXES corsika NAMES pythia8 HINTS ${CORSIKA8_DIR} )
find_library ( CUBIC_INTERPOLATION_LIBRARY NAMES CubicInterpolation HINTS ${CORSIKA8_DIR} )
find_library ( SPDLOG_LIBRARY NAMES spdlog HINTS ${CORSIKA8_DIR} )
find_library ( FMT_LIBRARY NAMES fmt HINTS ${CORSIKA8_DIR} )
find_library ( YAML_LIBRARY NAMES yaml-cpp HINTS ${CORSIKA8_DIR} )
find_library ( BZ2_LIBRARY NAMES bz2 HINTS ${CORSIKA8_DIR} )
find_library ( GFORTRAN_LIBRARY NAMES gfortran HINTS ${CORSIKA8_DIR} /opt/local/lib/gcc13 )

set ( CORSIKA8_LIBRARIES
${CORSIKA8_DATA_LIBRARY}
${PROPOSAL_LIBRARY}
${EPOS_LIBRARY}
${QGSJET_LIBRARY}
${SIBYLL_LIBRARY}
${PYTHIA8_LIBRARY}
${CUBIC_INTERPOLATION_LIBRARY}
${SPDLOG_LIBRARY}
${FMT_LIBRARY})
${FMT_LIBRARY}
${YAML_LIBRARY}
${BZ2_LIBRARY}
${GFORTRAN_LIBRARY} )
set ( CORSIKA8_INCLUDE_DIRS ${CORSIKA8_INCLUDE_DIR} )

include ( FindPackageHandleStandardArgs )
# handle the QUIETLY and REQUIRED arguments and set CORSIKA8_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args( CORSIKA8 DEFAULT_MSG CORSIKA8_DATA_LIBRARY PROPOSAL_LIBRARY CUBIC_INTERPOLATION_LIBRARY SPDLOG_LIBRARY FMT_LIBRARY CORSIKA8_INCLUDE_DIR )
find_package_handle_standard_args( CORSIKA8 DEFAULT_MSG
CORSIKA8_DATA_LIBRARY
PROPOSAL_LIBRARY
EPOS_LIBRARY
QGSJET_LIBRARY
SIBYLL_LIBRARY
PYTHIA8_LIBRARY
CUBIC_INTERPOLATION_LIBRARY
SPDLOG_LIBRARY
FMT_LIBRARY
YAML_LIBRARY
BZ2_LIBRARY
GFORTRAN_LIBRARY
CORSIKA8_INCLUDE_DIR )
5 changes: 5 additions & 0 deletions src/simulation/corsika8_shower_generator_internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,8 @@ generate_showers(calin::simulation::tracker::TrackVisitor* visitor,

track_handoff_->clear_visitor();
}

CORSIKA8ShowerGenerator* CORSIKA8ShowerGenerator::new_instance(const config_type& config)
{
return new CORSIKA8ShowerGeneratorImpl(config);
}
6 changes: 5 additions & 1 deletion swig/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@

set(CALIN_SWIG_FILES atmosphere.i pmt.i vs_optics.i ray_processor.i tracker.i
detector_efficiency.i world_magnetic_model.i vcl_iact.i sct_optics.i
ray_propagator.i waveform_processor.i corsika8_shower_generator.i)
ray_propagator.i waveform_processor.i)

if(GEANT4_FOUND)
set(CALIN_SWIG_FILES ${CALIN_SWIG_FILES} geant4_shower_generator.i)
endif()

if(CORSIKA8_FOUND)
set(CALIN_SWIG_FILES ${CALIN_SWIG_FILES} corsika8_shower_generator.i)
endif()

set(CALIN_SWIG_TARGET simulation)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
Expand Down

0 comments on commit 689f993

Please sign in to comment.