Skip to content

Commit

Permalink
Resolving merge conflicts between main and fork/alexwenym
Browse files Browse the repository at this point in the history
  • Loading branch information
nickkamp1 committed Jan 10, 2024
2 parents 96f6067 + c14285f commit 791ed48
Show file tree
Hide file tree
Showing 258 changed files with 11,308 additions and 2,425 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
matrix:
#os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-20.04, macos-11]
arch: [x86_64, auto32, auto64, aarch64, ppc64le, s390x, arm64]

steps:
- name: Checkout LeptonInjector
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@
*/*ipynb_checkpoint*
*/*/*ipynb_checkpoint*
*/*/*/*ipynb_checkpoint*

# build
*build

# pycache
*pycache*
*/*pycache*
*/*/*pycache*
*/*/*/*pycache*
*/*/*/*/*pycache*
130 changes: 86 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,8 @@ else()
endif()

# load python and pybind11
include(Python)
include(pybind11)
if(CMAKE_VERSION VERSION_LESS 3.12.0)
if(Python_ROOT_DIR)
MESSAGE(WARNING "Python_ROOT_DIR is set but will be ignored by this version of CMake; set PYTHON_EXECUTABLE instead")
endif()
find_package(PythonInterp)
find_package(PythonLibs)
set(PYTHON_FOUND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
else()
if(PYTHON_EXECUTABLE)
MESSAGE(WARNING "PYTHON_EXECUTABLE is set but will be ignored by this version of CMake; set Python_ROOT_DIR instead")
endif()
find_package(Python COMPONENTS Interpreter Development)
set(PYTHON_FOUND Python_Interpreter_FOUND AND Python_Development_FOUND)
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
set(PYTHON_LIBRARIES "${Python_LIBRARIES}")
set(PYTHON_VERSION_MAJOR "${Python_VERSION_MAJOR}")
set(PYTHON_VERSION_MINOR "${Python_VERSION_MINOR}")
endif()

# load project dependencies
include(rk)
Expand Down Expand Up @@ -109,33 +91,35 @@ add_library(LeptonInjector SHARED)
set_property(TARGET LeptonInjector PROPERTY POSITION_INDEPENDENT_CODE ON)
if(${MACOSX})
target_link_libraries(LeptonInjector
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
rk
delabella
PRIVATE
PUBLIC
delabella_shared
photospline
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
)
else()
target_link_libraries(LeptonInjector
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
-Wl,--whole-archive
rk
delabella
-Wl,--no-whole-archive
PRIVATE
PUBLIC
photospline
delabella_shared
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
)
endif()

Expand All @@ -148,15 +132,48 @@ if(DEFINED SKBUILD)
message(STATUS "Setting LeptonInjector install lib dir to: ${CI_INSTALL_PREFIX}/lib")
message(STATUS "Setting LeptonInjector install include dir to: ${CI_INSTALL_PREFIX}/include")
install(TARGETS LeptonInjector
delabella_shared
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION "${CI_INSTALL_PREFIX}/lib"
PUBLIC_HEADER DESTINATION "${CI_INSTALL_PREFIX}/include")
else()
install(TARGETS LeptonInjector
delabella_shared
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector.libs
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
else()
install(TARGETS LeptonInjector
delabella_shared
LI_utilities
LI_serialization
LI_math
LI_dataclasses
LI_geometry
LI_detector
LI_crosssections
LI_distributions
LI_injection
EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
Expand Down Expand Up @@ -205,9 +222,34 @@ if(DEFINED SKBUILD)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(TARGETS injection
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(FILES ${PROJECT_SOURCE_DIR}/python/__init__.py DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(FILES ${PROJECT_SOURCE_DIR}/python/__init__.py
DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(FILES ${PROJECT_SOURCE_DIR}/python/LIDarkNews.py
DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
install(FILES ${PROJECT_SOURCE_DIR}/python/LIController.py
DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector)
endif()

# Export targets for use in downstream CMake projects
# -----------------------------------------------------------------------------
include(CMakePackageConfigHelpers)
# Make importable from build directory
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT ${PROJECT_NAME}Config FILE ${PROJECT_NAME}Config.cmake)

# Make importable from install location
set(_config_dir share/${PROJECT_NAME}/cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${_config_dir}
)
install(EXPORT ${PROJECT_NAME}Config
DESTINATION ${_config_dir}
)

MESSAGE("")
MESSAGE("Done!")
MESSAGE("Run `make` then `make install`")
15 changes: 12 additions & 3 deletions cmake/Packages/Python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ IF(CMAKE_VERSION VERSION_LESS 3.12.0)
IF(Python_ROOT_DIR)
MESSAGE(WARNING "Python_ROOT_DIR is set but will be ignored by this version of CMake; set PYTHON_EXECUTABLE instead")
ENDIF(Python_ROOT_DIR)
find_package(PythonInterp)
find_package(PythonLibs)
IF(PYTHON_VERSION)
find_package(PythonInterp ${PYTHON_VERSION})
find_package(PythonLibs ${PYTHON_VERSION})
ELSE(PYTHON_VERSION)
find_package(PythonInterp)
find_package(PythonLibs)
ENDIF(PYTHON_VERSION)
set(PYTHON_FOUND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
ELSE()
IF(PYTHON_EXECUTABLE)
MESSAGE(WARNING "PYTHON_EXECUTABLE is set but will be ignored by this version of CMake; set Python_ROOT_DIR instead")
ENDIF(PYTHON_EXECUTABLE)
FIND_PACKAGE(Python COMPONENTS Interpreter Development)
IF(PYTHON_VERSION)
FIND_PACKAGE(Python ${PYTHON_VERSION} COMPONENTS Interpreter Development)
ELSE(PYTHON_VERSION)
FIND_PACKAGE(Python COMPONENTS Interpreter Development)
ENDIF(PYTHON_VERSION)
SET(PYTHON_FOUND "${Python_FOUND}")
SET(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
SET(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Packages/cereal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ endif()
set(JUST_INSTALL_CEREAL ON CACHE INTERNAL "Cereal just install library.")
set(SKIP_PORTABILITY_TEST ON CACHE INTERNAL "Skip cereal portability tests.")
set(SKIP_PERFORMANCE_COMPARISON ON CACHE INTERNAL "Skip cereal performance comparison.")
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/cereal" "extern/cereal" EXCLUDE_FROM_ALL)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/cereal" "extern/cereal")
include_directories("${PROJECT_SOURCE_DIR}/vendor/cereal/include")
12 changes: 11 additions & 1 deletion cmake/Packages/delabella.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/vendor/delabella/CMakeLists.txt")
message(FATAL_ERROR "The delabella submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()

add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/delabella EXCLUDE_FROM_ALL)
add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/delabella)
#add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/delabella)
#install(TARGETS delabella_shared
# ARCHIVE DESTINATION lib)
#set(_config_dir share/delabella/cmake)
#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/delabellaConfigVersion.cmake"
# DESTINATION ${_config_dir}
#)
#install(EXPORT delabellaConfig
# DESTINATION ${_config_dir}
#)
5 changes: 3 additions & 2 deletions cmake/Packages/photospline.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/vendor/photospline/CMakeLists.txt")
message(FATAL_ERROR "The photospline submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()

add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/photospline EXCLUDE_FROM_ALL)
#add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/photospline EXCLUDE_FROM_ALL)
add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/photospline)
if(DEFINED SKBUILD)
if(${CIBUILDWHEEL})
message(STATUS "Setting photospline install lib dir to: ${CI_INSTALL_PREFIX}/lib")
Expand All @@ -42,6 +43,6 @@ if(DEFINED SKBUILD)
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/leptoninjector.libs
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
install(TARGETS photospline DESTINATION ${CMAKE_INSTALL_LIBDIR})
#install(TARGETS photospline DESTINATION ${CMAKE_INSTALL_LIBDIR})
#install(TARGETS spglam DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
2 changes: 1 addition & 1 deletion cmake/testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set_target_properties(gmock_main PROPERTIES FOLDER extern)
macro(package_add_test TESTNAME)
add_executable(${TESTNAME} ${ARGN})
target_link_libraries(${TESTNAME} gtest gmock gtest_main LeptonInjector)
add_dependencies(${TESTNAME} rk)
add_dependencies(${TESTNAME} rk_static)
add_test(NAME ${TESTNAME} COMMAND ${TESTNAME} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
set_target_properties(${TESTNAME} PROPERTIES FOLDER tests)
endmacro()
Expand Down
42 changes: 21 additions & 21 deletions projects/crosssections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,33 @@ LIST (APPEND crosssections_SOURCES
${PROJECT_SOURCE_DIR}/projects/crosssections/private/CrossSection.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/CrossSectionCollection.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/DipoleFromTable.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/DarkNewsCrossSection.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/DarkNewsDecay.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/NeutrissimoDecay.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/DISFromSpline.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/HNLFromSpline.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/ElasticScattering.cxx
${PROJECT_SOURCE_DIR}/projects/crosssections/private/DummyCrossSection.cxx
)
add_library(LI_crosssections OBJECT ${crosssections_SOURCES})
set_property(TARGET LI_crosssections PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(LI_crosssections PUBLIC
${PROJECT_SOURCE_DIR}/projects/crosssections/public/
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/projects/crosssections/public/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/LeptonInjector/crosssections/>
)
add_dependencies(LI_crosssections rk photospline)
add_dependencies(LI_crosssections LI_serialization LI_utilities LI_math LI_dataclasses LI_detector)

target_link_libraries(LI_crosssections photospline)
target_link_libraries(LI_crosssections rk)

get_target_property(photospline_INCLUDES photospline INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(LI_crosssections INTERFACE ${CFITSIO_INCLUDE_DIR})
target_include_directories(LI_crosssections PUBLIC ${photospline_INCLUDES})
message("cfitsio include dir ${CFITSIO_INCLUDE_DIR}")

target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/vendor/rk/include)
target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/projects/serialization/public/)
target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/projects/utilities/public/)
target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/projects/math/public/)
target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/projects/detector/public/)
target_include_directories(LI_crosssections PUBLIC ${PROJECT_SOURCE_DIR}/projects/dataclasses/public/)

install(TARGETS LI_crosssections
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
target_link_libraries(LI_crosssections
PRIVATE
$<BUILD_INTERFACE:rk_static>
pybind11::embed
PUBLIC
photospline
LI_serialization
LI_utilities
LI_math
LI_dataclasses
LI_detector
)

install(DIRECTORY "${PROJECT_SOURCE_DIR}/projects/crosssections/public/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
Expand All @@ -47,7 +45,9 @@ package_add_test(UnitTest_DipoleFromTable ${PROJECT_SOURCE_DIR}/projects/crossse
#package_add_test(UnitTest_ElasticScattering ${PROJECT_SOURCE_DIR}/projects/crosssections/private/test/ElasticScattering_TEST.cxx)

pybind11_add_module(crosssections ${PROJECT_SOURCE_DIR}/projects/crosssections/private/pybindings/crosssections.cxx)
target_link_libraries(crosssections PRIVATE LeptonInjector photospline rk)
target_link_libraries(crosssections PRIVATE LeptonInjector photospline rk_static pybind11::embed)
pybind11_add_module(pyDarkNewsSerializer ${PROJECT_SOURCE_DIR}/projects/crosssections/private/pybindings/pyDarkNewsSerializer.cxx)
target_link_libraries(pyDarkNewsSerializer PRIVATE LeptonInjector photospline rk_static pybind11::embed)
if(DEFINED SKBUILD)
set_target_properties(crosssections PROPERTIES
BUILD_WITH_INSTALL_RPATH FALSE
Expand Down
26 changes: 13 additions & 13 deletions projects/crosssections/private/CrossSectionCollection.cxx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* CrossSectionCollection.cxx
*/

#include <map>
#include <set>
#include <vector>
#include <string>
#include <memory>

#include "LeptonInjector/dataclasses/Particle.h"

#include "LeptonInjector/crosssections/CrossSection.h"
#include "LeptonInjector/crosssections/CrossSectionCollection.h"

#include <map> // for map
#include <set> // for operator==
#include <tuple> // for tie
#include <limits> // for numeric...
#include <vector> // for vector
#include <utility> // for pair

#include "LeptonInjector/crosssections/CrossSection.h" // for CrossSe...
#include "LeptonInjector/crosssections/Decay.h" // for Decay
#include "LeptonInjector/dataclasses/InteractionRecord.h" // for Interac...
#include "LeptonInjector/dataclasses/InteractionSignature.h" // for Interac...
#include "LeptonInjector/dataclasses/Particle.h" // for Particle

namespace LI {
namespace crosssections {

Expand Down
Loading

0 comments on commit 791ed48

Please sign in to comment.