IAP GITLAB

Commit 7cdb7637 authored by Ralf Ulrich's avatar Ralf Ulrich

Revised, speed-up, strengthened CI pipelines.

parent cda8c9a0
This diff is collapsed.
[submodule "Data"]
path = Data
url = ../../AirShowerPhysics/corsika-data
branch = master
cmake_minimum_required (VERSION 3.9)
# we would need 3.16 to have CMP0097 for external subproject submodule (non) support
# prevent in-source builds and give warning message
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
......@@ -117,6 +118,17 @@ endif ()
# add call to ./do-copyright.py to run as unit-test-case
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if (DEFINED ENV{CORSIKA_DATA})
message ("Found corsika-data in $ENV{CORSIKA_DATA}")
set (CORSIKA_DATA $ENV{CORSIKA_DATA})
add_subdirectory ($ENV{CORSIKA_DATA} corsika_data)
else ()
message ("CORSIKA_DATA not defined: NEED to download AirShowerPhysics/corsika-data via git submodule")
message ("cmake will fail if you did not do this already.")
set (CORSIKA_DATA ${PROJECT_SOURCE_DIR}/Data)
add_subdirectory (Data)
endif ()
# include potential ThirdParty code provided with CORSIKA
add_subdirectory (ThirdParty)
......
Subproject commit 6b490c6b70a37628b0b2ec8b4521fa710bc5029c
if (NOT DEFINED ENV{CORSIKA_DATA})
message (WARNING "WARNING: download corsika-data repository from gitlab for needed data tables, and set CORSIKA_DATA path!")
message (WARNING "WARNING: QGSJetII will not work without corsika-data. Set CORSIKA_DATA path!")
endif ()
add_custom_command (
......@@ -76,6 +76,7 @@ target_link_libraries (
CORSIKAenvironment
CORSIKAsetup
CORSIKArandom
CorsikaData
)
target_include_directories (
......
......@@ -33,7 +33,3 @@ double qgran_(int&) {
std::uniform_real_distribution<double> dist;
return dist(rng);
}
void lzmaopenfile_(const char*, int) {}
void lzmaclosefile_() {}
void lzmafillarray_(const double&, const int&) {}
......@@ -411,52 +411,62 @@ c fp(i) - pomeron vertex constant (i=icz)
c-----------------------------------------------------------------------------
c reading cross sections from the file
luseCompress=0
if(ifIIdat.ne.1)then
inquire(file=DATDIR(1:INDEX(DATDIR,' ')-1)//'qgsdat-II-04'
inquire(file=DATDIR(1:INDEX(DATDIR,' ')-1)//'qgsdat-II-04.bz2'
* ,exist=lcalc)
if (lcalc.and.CorDataCanDeCompress().ne.0) then
luseCompress=1
else
inquire(file=DATDIR(1:INDEX(DATDIR,' ')-1)//'qgsdat-II-04'
* ,exist=lcalc)
endif
else
inquire(file=fnIIdat(1:nfnIIdat),exist=lcalc) !used to link with nexus
luseCompress = (index(fnIIdat(1:nfnIIdat), ".bz2").eq.nfnIIdat-3)
inquire(file=fnIIdat(1:nfnIIdat), exist=lcalc) !used to link with nexus
endif
lzmaUse=0
if(lcalc)then
if(ifIIdat.ne.1)then
open(1,file=DATDIR(1:INDEX(DATDIR,' ')-1)//'qgsdat-II-04'
* ,status='old')
if (luseCompress.ne.0) then
call CorDataOpenFile(DATDIR(1:INDEX(DATDIR,' ')-1)
* //'qgsdat-II-04.bz2')
else
open(1,file=DATDIR(1:INDEX(DATDIR,' ')-1)//'qgsdat-II-04'
* ,status='old')
endif
else !used to link with nexus
if (LEN(fnIIdat).gt.6.and.
* fnIIdat(nfnIIdat-4:nfnIIdat) .eq. ".lzma") then
lzmaUse=1
call LzmaOpenFile(fnIIdat(1:nfnIIdat))
if (luseCompress.ne.0) then
call CorDataOpenFile(fnIIdat(1:nfnIIdat))
else
open(ifIIdat,file=fnIIdat(1:nfnIIdat),status='old')
open(ifIIdat, file=fnIIdat(1:nfnIIdat), status='old')
endif
endif
if (lzmaUse.ne.0) then
if(debug.ge.0)write (moniou,214) 'qgsdat-II-04.lzma'
call LzmaFillArray(csborn,size(csborn))
call LzmaFillArray(cs0,size(cs0))
call LzmaFillArray(cstot,size(cstot))
call LzmaFillArray(evk,size(evk))
call LzmaFillArray(qpomi,size(qpomi))
call LzmaFillArray(qpomis,size(qpomis))
call LzmaFillArray(qlegi,size(qlegi))
call LzmaFillArray(qfanu,size(qfanu))
call LzmaFillArray(qfanc,size(qfanc))
call LzmaFillArray(qdfan,size(qdfan))
call LzmaFillArray(qpomr,size(qpomr))
call LzmaFillArray(gsect,size(gsect))
call LzmaFillArray(qlegc0,size(qlegc0))
call LzmaFillArray(qlegc,size(qlegc))
call LzmaFillArray(qpomc,size(qpomc))
call LzmaFillArray(fsud,size(fsud))
call LzmaFillArray(qrt,size(qrt))
call LzmaFillArray(qrev,size(qrev))
call LzmaFillArray(fsud,size(fsud))
call LzmaFillArray(qrt,size(qrt))
call LzmaCloseFile()
if (luseCompress.ne.0) then
if(debug.ge.0)write (moniou,214) 'qgsdat-II-04.bz2'
call CorDataFillArray(csborn,size(csborn))
call CorDataFillArray(cs0,size(cs0))
call CorDataFillArray(cstot,size(cstot))
call CorDataFillArray(evk,size(evk))
call CorDataFillArray(qpomi,size(qpomi))
call CorDataFillArray(qpomis,size(qpomis))
call CorDataFillArray(qlegi,size(qlegi))
call CorDataFillArray(qfanu,size(qfanu))
call CorDataFillArray(qfanc,size(qfanc))
call CorDataFillArray(qdfan,size(qdfan))
call CorDataFillArray(qpomr,size(qpomr))
call CorDataFillArray(gsect,size(gsect))
call CorDataFillArray(qlegc0,size(qlegc0))
call CorDataFillArray(qlegc,size(qlegc))
call CorDataFillArray(qpomc,size(qpomc))
call CorDataFillArray(fsud,size(fsud))
call CorDataFillArray(qrt,size(qrt))
call CorDataFillArray(qrev,size(qrev))
call CorDataFillArray(fsud,size(fsud))
call CorDataFillArray(qrt,size(qrt))
call CorDataCloseFile()
else
if(debug.ge.0)write (moniou,214) 'qgsdat-II-04'
read (1,*)csborn,cs0,cstot,evk,qpomi,qpomis,qlegi,qfanu,qfanc
......@@ -1955,24 +1965,46 @@ c writing cross sections to the file
10 continue
c-----------------------------------------------------------------------------
c nuclear cross sections
c nuclear cross sections
luseCompress=0
if(ifIIncs.ne.2)then
inquire(file=DATDIR(1:INDEX(DATDIR,' ')-1)//'sectnu-II-04.bz2'
* ,exist=lcalc)
if (lcalc.and.CorDataCanDeCompress().ne.0) then
luseCompress=1
else
inquire(file=DATDIR(1:INDEX(DATDIR,' ')-1)//'sectnu-II-04'
* ,exist=lcalc)
* ,exist=lcalc)
endif
else !ctp
inquire(file=fnIIncs(1:nfnIIncs),exist=lcalc)
luseCompress = (index(fnIIncs(1:nfnIIncs), ".bz2").eq.nfnIIncs-3)
inquire(file=fnIIncs(1:nfnIIncs), exist=lcalc)
endif
if(lcalc)then
if(debug.ge.0)write (moniou,207)
if(ifIIncs.ne.2)then
open(2,file=DATDIR(1:INDEX(DATDIR,' ')-1)//'sectnu-II-04'
* ,status='old')
else !ctp
open(ifIIncs,file=fnIIncs(1:nfnIIncs),status='old')
if (luseCompress.ne.0) then
call CorDataOpenFile(
* DATDIR(1:INDEX(DATDIR,' ')-1)//'sectnu-II-04.bz2')
else
open(2,file=DATDIR(1:INDEX(DATDIR,' ')-1)//'sectnu-II-04'
* ,status='old')
endif
else !ctp
if (luseCompress.ne.0) then
call CorDataOpenFile(fnIIncs(1:nfnIIncs))
else
open(ifIIncs,file=fnIIncs(1:nfnIIncs),status='old')
endif
endif
if (luseCompress.ne.0)then
call CorDataFillArray(qgsasect, size(qgsasect))
call CorDataCloseFile()
else
read (2,*)qgsasect
close(2)
endif
read (2,*)qgsasect
close(2)
elseif(.not.producetables)then
write(moniou,*) "Missing sectnu-II-04 file !"
......
......@@ -100,13 +100,6 @@ double qgsect_(const double& e0n, const int& icz, const int& iap0, const int& ia
link to random number generation
*/
double qgran_(int&);
/**
dummy function from CRMC
*/
void lzmaopenfile_(const char* name, int length);
void lzmaclosefile_();
void lzmafillarray_(const double& dum, const int& idum);
}
#endif
......@@ -227,6 +227,11 @@ endif (NOT (${USE_CONEX_C8} IN_LIST ThirdPartyChoiceValues))
message (STATUS "USE_CONEX_C8='${USE_CONEX_C8}'")
add_library (C8::ext::conex STATIC IMPORTED GLOBAL)
get_directory_property (Boost_iostreams_FOUND DIRECTORY ${CORSIKA_DATA}/readLib DEFINITION Boost_iostreams_FOUND)
set (conex_boost "")
if (NOT Boost_iostreams_FOUND)
set (conex_boost "NO_BOOST=1")
endif (NOT Boost_iostreams_FOUND)
if ("x_${USE_CONEX_C8}" STREQUAL "x_SYSTEM")
find_package (CONEX REQUIRED)
......@@ -240,18 +245,24 @@ if ("x_${USE_CONEX_C8}" STREQUAL "x_SYSTEM")
set (CONEX_FOUND 1 PARENT_SCOPE)
else ()
message (STATUS "Building conex obtained via git and compiled")
message (STATUS "This will take a bit.....")
if (${CMAKE_VERSION} VERSION_LESS "3.16.0")
message (WARNING "You need cmake >= 3.16 to support proper external git submodules. Right now, it will be more inefficient than necessary.")
else (${CMAKE_VERSION} VERSION_LESS "3.16.0")
cmake_policy (SET CMP0097 NEW) # avoid cloning of git submodules
endif (${CMAKE_VERSION} VERSION_LESS "3.16.0")
ExternalProject_Add (cxroot
GIT_REPOSITORY https://gitlab.ikp.kit.edu/AirShowerPhysics/cxroot.git
GIT_SUBMODULES ""
GIT_TAG origin/master
GIT_SHALLOW 1
GIT_PROGRESS 1
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cxroot/source
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/cxroot/source
CONFIGURE_COMMAND ""
BUILD_COMMAND make CX_NO_ROOT=1 all
BUILD_COMMAND make CX_NO_ROOT=1 ${conex_boost} CORSIKA_DATA=${CORSIKA_DATA} all
INSTALL_COMMAND ""
BUILD_IN_SOURCE ON
EXCLUDE_FROM_ALL TRUE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment