Skip to content

Commit

Permalink
Merge pull request #110 from rseng/update/analysis-2024-02-28
Browse files Browse the repository at this point in the history
Update from update/analysis-2024-02-28
  • Loading branch information
vsoch authored Feb 28, 2024
2 parents dc6ff3a + 8058513 commit b9d51aa
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 136 deletions.
125 changes: 65 additions & 60 deletions _repos/github/CRPropa/CRPropa3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
if(APPLE)
# rpath specific patches
cmake_minimum_required(VERSION 2.8.12)
else(APPLE)
# require > 2.8.8 for FILE DOWNLOAD fixes
# allow < 2.8.12 for debian backports
cmake_minimum_required(VERSION 2.8.11)
endif(APPLE)
cmake_minimum_required(VERSION 3.14)

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(CRPROPA_EXTRA_SOURCES)
Expand All @@ -18,17 +12,6 @@ set(CRPROPA_EXTRA_LIBRARIES)
set(CRPROPA_SWIG_DEFINES)
set(CRPROPA_SWIG_INPUTS)

macro(USE_CXX11)
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endmacro(USE_CXX11)
USE_CXX11()

if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
Expand Down Expand Up @@ -110,6 +93,15 @@ if(ENABLE_TESTING)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
endif(APPLE)

# temporary workaround for newer clang versions due to its handling of unwinding
# see: https://github.com/google/googletest/issues/3062
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
add_definitions(-DCRPROPA_TESTS_SKIP_EXCEPTIONS)
endif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")

endif(ENABLE_TESTING)

#
Expand Down Expand Up @@ -164,12 +156,13 @@ add_subdirectory(libs/sophia)
list(APPEND CRPROPA_EXTRA_LIBRARIES sophia gfortran)
list(APPEND CRPROPA_EXTRA_INCLUDES libs/sophia)

# GlacticMagneticLenses
option(ENABLE_GALACTICMAGETICLENS "Galactic Magnetic Lens" ON)
# Galactic magnetic lenses
option(ENABLE_GALACTICMAGNETICLENS "Galactic Magnetic Lens" ON)
option(INSTALL_EIGEN "Install provided EIGEN headers" OFF)
SET(EIGEN_PATH "" CACHE STRING "Use EIGEN from this path instead of the version shipped with CRPropa")
SET(WITH_GALACTIC_LENSES FALSE)
if(ENABLE_GALACTICMAGETICLENS)

if(ENABLE_GALACTICMAGNETICLENS)
SET(WITH_GALACTIC_LENSES TRUE)

if(EIGEN_PATH)
Expand All @@ -196,7 +189,7 @@ if(ENABLE_GALACTICMAGETICLENS)
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)
endif(ENABLE_GALACTICMAGETICLENS)
endif(ENABLE_GALACTICMAGNETICLENS)

# OpenMP (optional for shared memory multiprocessing)
option(ENABLE_OPENMP "OpenMP for multithreading" ON)
Expand Down Expand Up @@ -451,14 +444,43 @@ endif(BUILD_DOC)
# Python
# ----------------------------------------------------------------------------
option(ENABLE_PYTHON "Create python library via SWIG" ON)
find_package(PythonInterp)
find_package(PythonLibs)

if(ENABLE_PYTHON AND PYTHONLIBS_FOUND)
find_package(Python 3.0 REQUIRED COMPONENTS Interpreter Development NumPy)

if(ENABLE_PYTHON AND Python_FOUND)
find_package(SWIG 3.0 REQUIRED)
include(python/Python.cmake)
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${Python_INCLUDE_DIRS})

# print Python info in detail
message(STATUS "Python: Found!")
message(STATUS " version ${Python_VERSION}")
message(STATUS " executable: ${Python_EXECUTABLE}")
message(STATUS " libraries: ${Python_LIBRARIES}")
message(STATUS " headers: ${Python_INCLUDE_DIRS}")
message(STATUS " site packages: ${Python_SITELIB}")
if(Python_Development_FOUND)
message(STATUS " development libraries: Found!")
elseif(Python_Development_FOUND)
message(STATUS " development libraries: NOT found!")
endif(Python_Development_FOUND)


# use Python_INSTALL_PACKAGE_DIR if provided; otherwise, install in Python_SITELIB
set(Python_INSTALL_PACKAGE_DIR "${Python_SITELIB}" CACHE PATH "folder in which the python package is installed")
message(STATUS " package install directory: ${Python_INSTALL_PACKAGE_DIR}")


# look for NumPy
if(Python_NumPy_FOUND)
set(CMAKE_SWIG_FLAGS -DWITHNUMPY ${CRP})
list(APPEND CRPROPA_SWIG_DEFINES -DWITHNUMPY)
include_directories(${Python_NumPy_INCLUDE_DIRS})
message(STATUS "NumPy: Found!")
message(STATUS " headers: ${Python_NumPy_INCLUDE_DIRS} (version ${Python_NumPy_VERSION})")
elseif(Python_NumPy_FOUND)
message(STATUS "NumPy: NOT found!")
message(STATUS " CRPropa might work just fine with Python, but features like Galactic lenses will not be available.")
endif(Python_NumPy_FOUND)

if(SWIG_VERSION VERSION_GREATER 4.0)
# Use swig 4 builtin doxygen instead of external program
Expand All @@ -476,39 +498,22 @@ if(ENABLE_PYTHON AND PYTHONLIBS_FOUND)

if(ENABLE_SWIG_BUILTIN)
set(BUILTIN "-builtin")
set(PY3 "-py3")
if(SWIG_VERSION VERSION_LESS 4.0.2)
message(WARNING, "The SWIG builtin option should not be used with SWIG version below 4.0.2 due to https://github.com/swig/swig/issues/1595")
endif()
else(ENABLE_SWIG_BUILTIN)
set(BUILTIN "")
set(PY3 "")
endif(ENABLE_SWIG_BUILTIN)

if(PYTHON_VERSION_STRING VERSION_GREATER 3.0)
list(APPEND CRPROPA_SWIG_DEFINES -DSWIG_PYTHON3)
endif(PYTHON_VERSION_STRING VERSION_GREATER 3.0)

# tries to import numpy
execute_process(COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/python/checkNumpy.py" OUTPUT_VARIABLE numpyIncludePath)
if(numpyIncludePath)
MESSAGE(STATUS "Found numpy headers in " ${numpyIncludePath})
SET(CMAKE_SWIG_FLAGS -DWITHNUMPY ${CRP})
list(APPEND CRPROPA_SWIG_DEFINES -DWITHNUMPY)
include_directories(${numpyIncludePath})
else(numpyIncludePath)
MESSAGE(STATUS "Numpy not found.")
endif(numpyIncludePath)

set(SWIG_INCLUDES)
foreach(p in ${SWIG_INCLUDE_DIRECTORIES})
list(APPEND SWIG_INCLUDES -I${p})
endforeach()

file(GLOB_RECURSE CRPROPA_SWIG_INPUTS python/*.i)
set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/crpropa_wrap.cxx PROPERTIES GENERATED true )
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 ${PY3} -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_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
DEPENDS ${CRPROPA_SWIG_INPUTS} ${CRPROPA_INCLUDES} )

if(BUILD_DOC AND DOXYGEN_FOUND)
Expand All @@ -520,14 +525,15 @@ if(ENABLE_PYTHON AND PYTHONLIBS_FOUND)
# disable warnings on automatically generated interface code
set_target_properties(crpropa-swig PROPERTIES COMPILE_FLAGS "-w")
set_target_properties(crpropa-swig PROPERTIES OUTPUT_NAME "_crpropa")
target_link_libraries(crpropa-swig crpropa ${PYTHON_LIBRARIES})
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_SITE_PACKAGES}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/crpropa.py" DESTINATION "${PYTHON_SITE_PACKAGES}/crpropa")
install(TARGETS crpropa-swig LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/crpropa")
install(DIRECTORY "${CMAKE_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)
endif(ENABLE_PYTHON AND PYTHONLIBS_FOUND)

endif(ENABLE_PYTHON AND Python_FOUND)


# ----------------------------------------------------------------------------
Expand All @@ -538,7 +544,6 @@ 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)

# ------------------------------------------------------------------
Expand Down Expand Up @@ -643,23 +648,23 @@ if(ENABLE_TESTING)
endif(WITH_GALACTIC_LENSES)

# python tests
if(ENABLE_PYTHON AND PYTHONLIBS_FOUND)
if(ENABLE_PYTHON AND Python_FOUND)
CONFIGURE_FILE(test/testMagneticLensPythonInterface.py testMagneticLensPythonInterface.py COPYONLY)
if(numpyIncludePath AND WITH_GALACTIC_LENSES)
add_test(testMagneticLensPythonInterface ${PYTHON_EXECUTABLE} testMagneticLensPythonInterface.py)
add_test(testMagneticLensPythonInterface ${Python_EXECUTABLE} testMagneticLensPythonInterface.py)
endif(numpyIncludePath AND WITH_GALACTIC_LENSES)

CONFIGURE_FILE(test/testSimulationExecution.py testSimulationExecution.py COPYONLY)
add_test(testSimulationExecution ${PYTHON_EXECUTABLE} testSimulationExecution.py)
add_test(testSimulationExecution ${Python_EXECUTABLE} testSimulationExecution.py)

CONFIGURE_FILE(test/testDiffusionSDE.py testDiffusionSDE.py COPYONLY)
add_test(testDiffusionSDE ${PYTHON_EXECUTABLE} testDiffusionSDE.py)
add_test(testDiffusionSDE ${Python_EXECUTABLE} testDiffusionSDE.py)

CONFIGURE_FILE(test/testMomentumDiffusion.py testMomentumDiffusion.py COPYONLY)
add_test(testMomentumDiffusion ${PYTHON_EXECUTABLE} testMomentumDiffusion.py)
add_test(testMomentumDiffusion ${Python_EXECUTABLE} testMomentumDiffusion.py)

CONFIGURE_FILE(test/testPythonExtension.py testPythonExtension.py COPYONLY)
add_test(testPythonExtension ${PYTHON_EXECUTABLE} testPythonExtension.py)
endif(ENABLE_PYTHON AND PYTHONLIBS_FOUND)
add_test(testPythonExtension ${Python_EXECUTABLE} testPythonExtension.py)
endif(ENABLE_PYTHON AND Python_FOUND)

endif(ENABLE_TESTING)
18 changes: 17 additions & 1 deletion _repos/github/Griffan/VerifyBamID/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ enable_testing()
add_test(NAME myTest1
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND VerifyBamID --DisableSanityCheck --BamFile resource/test/test.bam --SVDPrefix resource/test/hapmap_3.3.b37.dat --Reference resource/test/chr20.fa.gz --NumPC 2)
#add_test( NAME myTest2
add_test(NAME myTest2
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND sh -c "diff resource/test/expected/result.Ancestry result.Ancestry && rm result.Ancestry result.selfSM")
add_test(NAME myTest3
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND VerifyBamID --DisableSanityCheck --PileupFile resource/test/expected/result.Pileup --SVDPrefix resource/test/hapmap_3.3.b37.dat --Reference resource/test/chr20.fa.gz --NumPC 2)
add_test(NAME myTest4
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND sh -c "diff resource/test/expected/result.Ancestry result.Ancestry && rm result.Ancestry result.selfSM")
add_test(NAME myTest5
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND VerifyBamID --DisableSanityCheck --PileupFile resource/test/test.LongRead.pileup --SVDPrefix resource/test/hapmap_3.3.b37.dat --Reference resource/test/chr20.fa.gz --NumPC 2)
add_test(NAME myTest6
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND sh -c "diff resource/test/expected/test.LongRead.pileup.Ancestry result.Ancestry && rm result.Ancestry result.selfSM")

#add_test( NAME myTestPlot
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# COMMAND sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run.plot.sh -i ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap_3.3.b37.dat.V -o ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap -r 1000g -g grey)
2 changes: 1 addition & 1 deletion _repos/github/MeasureTransport/MParT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if(NOT Kokkos_FOUND)
FetchContent_Declare(
kokkos
GIT_REPOSITORY https://github.com/kokkos/kokkos
GIT_TAG 4.2.00
GIT_TAG 3.7.00
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(kokkos)
Expand Down
52 changes: 2 additions & 50 deletions _repos/github/PDB-REDO/libcifpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 3.16)
# set the project name
project(
libcifpp
VERSION 6.1.0
VERSION 7.0.0
LANGUAGES CXX)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down Expand Up @@ -546,55 +546,7 @@ if(NOT PROJECT_IS_TOP_LEVEL)
endif()

if(BUILD_TESTING)
# We're using the older version 2 of Catch2
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9)

FetchContent_MakeAvailable(Catch2)

list(
APPEND
CIFPP_tests
unit-v2
unit-3d
format
model
rename-compound
sugar
spinner
validate-pdbx)

foreach(CIFPP_TEST IN LISTS CIFPP_tests)
set(CIFPP_TEST "${CIFPP_TEST}-test")
set(CIFPP_TEST_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/test/${CIFPP_TEST}.cpp")

add_executable(
${CIFPP_TEST} ${CIFPP_TEST_SOURCE}
"${CMAKE_CURRENT_SOURCE_DIR}/test/test-main.cpp")

target_link_libraries(${CIFPP_TEST} PRIVATE Threads::Threads cifpp::cifpp
Catch2::Catch2)
target_include_directories(${CIFPP_TEST} PRIVATE "${EIGEN_INCLUDE_DIR}")

if(MSVC)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options(${CIFPP_TEST} PRIVATE /EHsc)
endif()

add_custom_target(
"run-${CIFPP_TEST}"
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Run${CIFPP_TEST}.touch ${CIFPP_TEST})

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Run${CIFPP_TEST}.touch
COMMAND $<TARGET_FILE:${CIFPP_TEST}> --data-dir
${CMAKE_CURRENT_SOURCE_DIR}/test)

add_test(NAME ${CIFPP_TEST} COMMAND $<TARGET_FILE:${CIFPP_TEST}> --data-dir
${CMAKE_CURRENT_SOURCE_DIR}/test)
endforeach()
add_subdirectory(test)
endif()

# Optionally install the update scripts for CCD and dictionary files
Expand Down
2 changes: 1 addition & 1 deletion _repos/github/fogellab/multiWGCNA/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: multiWGCNA
Type: Package
Title: multiWGCNA
Version: 1.1.3
Version: 1.1.4
Authors@R: c(
person("Dario", "Tommasini", email="[email protected]",
role = c("aut","cre"),
Expand Down
19 changes: 17 additions & 2 deletions _repos/github/gnudatalanguage/gdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/whereami/.git" )
message(FATAL_ERROR "The src/whereami git submodule is not initialised.\n Please run `git submodule update --init`")
endif()

# create version string based on git metadata (based on https://github.com/nocnokneo/cmake-git-versioning-example)
# in case version.hpp does not exist (it is shipped in GDL tarballs but not stored in the repo)
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/version.hpp")
find_package(Git REQUIRED)
add_custom_target(version
${CMAKE_COMMAND} -D SRC=${CMAKE_SOURCE_DIR}/src/version.hpp.in
-D DST=${CMAKE_BINARY_DIR}/version.hpp
-D GIT_EXECUTABLE=${GIT_EXECUTABLE}
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GenerateVersionHeader.cmake
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()

# Set some policies to fix warnings in newer versions of cmake
# Since VERSION_GREATER_EQUAL is available only since 3.7, we use
# VERSION_GREATER combined with VERSION_EQUAL to achieve what we want
Expand All @@ -33,8 +46,6 @@ set(CMAKE_C_STANDARD 99)
# advice by Orion, mandatory for FC 28
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# X.X.X git becomes release X.X.X+1
set(VERSION "1.0.4 git")
enable_testing()

# cf issue 511, managing MultiArch on Debian ...
Expand Down Expand Up @@ -1031,6 +1042,10 @@ endif(EXPAT)

add_subdirectory(src)

if (TARGET version)
add_dependencies(gdl version)
endif()

if(NOT PYTHON_MODULE)
add_subdirectory(testsuite)
endif(NOT PYTHON_MODULE)
Expand Down
2 changes: 1 addition & 1 deletion _repos/github/lanl/spiner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ option(SPINER_BUILD_TESTS "Compile Tests" OFF)
cmake_dependent_option(SPINER_TEST_USE_KOKKOS "Use kokkos offloading for tests"
ON "SPINER_BUILD_TESTS" OFF)
cmake_dependent_option(
SPINER_TEST_USE_KOKKOS_CUDA "Use kokkos cuda offloading for tests" ON
SPINER_TEST_USE_KOKKOS_CUDA "Use kokkos cuda offloading for tests (affects submodule-build only)" ON
"SPINER_TEST_USE_KOKKOS" ON)

# CTest
Expand Down
Loading

0 comments on commit b9d51aa

Please sign in to comment.