diff --git a/modules/pythia8/CMakeLists.txt b/modules/pythia8/CMakeLists.txt index 07396a43f37610f364f460abb14bdc21b2bd002a..d07add39c46831488db115b91c1a0607eb860c4a 100644 --- a/modules/pythia8/CMakeLists.txt +++ b/modules/pythia8/CMakeLists.txt @@ -23,8 +23,8 @@ file (MAKE_DIRECTORY ${CORSIKA_Pythia8_MODULE_DIR}) add_library (C8::ext::pythia8 STATIC IMPORTED GLOBAL) if ("x_${USE_Pythia8_C8}" STREQUAL "x_SYSTEM") - - find_package (Pythia8 8310 EXACT REQUIRED) + + find_package (Pythia8 8310 EXACT REQUIRED) message (STATUS "Using system-level Pythia8 version ${Pythia8_VERSION} at ${Pythia8_PREFIX}") set (Pythia8_INCLUDE_DIRS ${Pythia8_INCLUDE_DIR}) set_target_properties ( @@ -40,24 +40,25 @@ if ("x_${USE_Pythia8_C8}" STREQUAL "x_SYSTEM") configure_file (Pythia8ConfigurationDirectory.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/Pythia8ConfigurationDirectory_install.hpp @ONLY) # install and build are both the same here since it is external - set (Pythia8_PREFIX_INSTALL ${Pythia8_PREFIX}) - set (Pythia8_LIBDIR ${Pythia8_LIBRARY}) - set (Pythia8_LIBDIR_INSTALL ${Pythia8_LIBRARY}) - set (Pythia8_INCDIR ${Pythia8_INCLUDE_DIR}) - set (Pythia8_INCDIR_INSTALL ${Pythia8_INCLUDE_DIR}) - + set (Pythia8_PREFIX_INSTALL ${Pythia8_PREFIX}) + set (Pythia8_LIBDIR ${Pythia8_LIBRARY}) + set (Pythia8_LIBDIR_INSTALL ${Pythia8_LIBRARY}) + set (Pythia8_INCDIR ${Pythia8_INCLUDE_DIR}) + set (Pythia8_INCDIR_INSTALL ${Pythia8_INCLUDE_DIR}) + message (STATUS "Pythia8 (system) at ${Pythia8_PREFIX}") else () + set (_C8_Pythia8_Download_Dir "https://pythia.org/download/pythia83") set (_C8_Pythia8_VERSION "8312") message (STATUS "Building modules/pythia8 using pythia${_C8_Pythia8_VERSION}.tar.bz2") message (STATUS "This will take a bit.....") # this is not a full Pythia8 install, it is a bit simplified, e.g. no pythia8-config, no examples # and also, it is fitted into the normal CORSIKA8 install "include/corsika_modules/Pythia8, lib/corsika" ExternalProject_Add (pythia8 - URL ${CMAKE_CURRENT_SOURCE_DIR}/pythia${_C8_Pythia8_VERSION}.tar.bz2 - URL_MD5 7e85d7ff3f0886f8e834f51aff4bacf0 + URL ${_C8_Pythia8_Download_Dir}/pythia${_C8_Pythia8_VERSION}.tar.bz2 + URL_MD5 0acde09714b5383ac807edb10f161dd9 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/pythia8/source" INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/pythia8/install" CONFIGURE_COMMAND ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/pythia8/install @@ -79,16 +80,16 @@ else () set (Pythia8_PREFIX ${INSTALL_DIR}) set (Pythia8_INCLUDE_DIR ${Pythia8_PREFIX}/include/corsika_modules) set (Pythia8_LIBDIR ${Pythia8_PREFIX}/lib/corsika) - set (Pythia8_LIBDIR_INSTALL ${Pythia8_PREFIX_INSTALL}/lib/corsika) + set (Pythia8_LIBDIR_INSTALL ${Pythia8_PREFIX_INSTALL}/lib/corsika) set (Pythia8_INCDIR ${Pythia8_PREFIX}/include/corsika_modules) - set (Pythia8_INCDIR_INSTALL ${Pythia8_PREFIX_INSTALL}/include/corsika_modules) + set (Pythia8_INCDIR_INSTALL ${Pythia8_PREFIX_INSTALL}/include/corsika_modules) add_dependencies (C8::ext::pythia8 pythia8) set (CORSIKA_Pythia8_LOCATION ${Pythia8_PREFIX}) # build location configure_file (Pythia8ConfigurationDirectory.hpp.in ${CORSIKA_Pythia8_MODULE_DIR}/Pythia8ConfigurationDirectory.hpp @ONLY) set (CORSIKA_Pythia8_LOCATION ${Pythia8_PREFIX_INSTALL}) # install location configure_file (Pythia8ConfigurationDirectory.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/Pythia8ConfigurationDirectory_install.hpp @ONLY) - + install (DIRECTORY ${Pythia8_PREFIX}/ DESTINATION ${Pythia8_PREFIX_INSTALL}) set (Pythia8_INCLUDE_DIRS ${Pythia8_INCLUDE_DIR}) @@ -103,7 +104,7 @@ else () TARGET C8::ext::pythia8 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${Pythia8_INCLUDE_DIRS}> - $<INSTALL_INTERFACE:include/corsika/modules/pythia8/include> + $<INSTALL_INTERFACE:include/corsika/modules/pythia8/include> ) message (STATUS "Pythia8 build at: ${Pythia8_PREFIX}, final install to: ${Pythia8_PREFIX_INSTALL}") diff --git a/modules/pythia8/pythia8312.tar.bz2 b/modules/pythia8/pythia8312.tar.bz2 deleted file mode 100644 index 0cc9bc012ac8f803e8120f875dacdf3597893772..0000000000000000000000000000000000000000 Binary files a/modules/pythia8/pythia8312.tar.bz2 and /dev/null differ diff --git a/modules/pythia8/strip-pythia8-package.py b/modules/pythia8/strip-pythia8-package.py deleted file mode 100755 index 2ddd8435a2a9379ea7b168be6f6d40d41c976719..0000000000000000000000000000000000000000 --- a/modules/pythia8/strip-pythia8-package.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import shutil - -if (not os.path.exists('bin/pythia8-config') or - not os.path.exists('include/Pythia8/Pythia.h') or - not os.path.exists('src/Event.cc')) : - print ("You can only run this script from within an unpacked PYTHIA tar filedirectory. This was not detected!") - sys.exit(1) - -# find version -version = 'undefined' -pythia_header = open('include/Pythia8/Pythia.h') -for line in pythia_header: - line_list = line.strip().split(' ') - if (len(line_list) == 3 and - line_list[0] == '#define' and - line_list[1] == 'PYTHIA_VERSION_INTEGER') : - version = line_list[2] - break -pythia_header.close() - -if (version == 'undefined'): - print ("Could not find Pythia version info") - sys.exit(2) - -print ("Pythia version: {}".format(version)) - -if (os.path.exists('c8_package')) : - print ('Temporary directory \"c8_package\" already exists. Cleanup first.') - sys.exit(3) - -tmpdir = 'c8_package/pythia{}'.format(version) -print ('create \"{}\"'.format(tmpdir)) -os.makedirs(tmpdir) - -copy_files_s = "AUTHORS bin CODINGSTYLE configure COPYING GUIDELINES include Makefile Makefile.inc README share src" -copy_files = copy_files_s.split() - -for filename in os.listdir('./') : - file = os.path.join('./', filename) - fileNew = os.path.join(tmpdir, filename) - if (filename in copy_files) : - isdir = '' - if (os.path.isdir(file)): isdir = ' [dir]' - print ('Keep \"{}\"{}'.format(file, isdir)) - if (os.path.isfile(file)): - shutil.copy(file, tmpdir) - else: - shutil.copytree(file, fileNew) - -print ('Remove \"include/Pythia8Plugins\"') -plugindir = os.path.join(tmpdir, 'include/Pythia8Plugins') -if (os.path.exists(plugindir)): - shutil.rmtree(plugindir) - -# remove anything in share/Pythia but xmldoc that contains parameter definitions \"<parm\" -sharedir = os.path.join(tmpdir, 'share/Pythia8') -if (not os.path.isdir(sharedir)) : - print ('Why there is no \"share/Pythia8\" directory?') -else : - print ('Only keep \"xmldoc\" inside \"share/Phythia8\"') - - for filename in os.listdir(sharedir) : - file = os.path.join(sharedir, filename) - if (os.path.isdir(file)) : - if (not 'xmldoc' in file) : - print ('Remove \"{}\"'.format(file)) - shutil.rmtree(file) - else : - cleanupXMLDOC = False - if (cleanupXMLDOC) : - for filename_xml in os.listdir(file) : - xml = os.path.join(file, filename_xml) - xml_data = open(xml) - keep = False - for xml_line in xml_data: - if ('<parm ' in xml_line) : - keep = True - break - xml_data.close() - if (not keep): - print ('Removing {}'.format(xml)) - os.unlink(xml) - -# ... 'examples' subdirectory must exist ... -os.mkdir(os.path.join(tmpdir, 'examples')) - -print ('Create tar file \"pythia{version}-stripped.tar.bz2\"'.format(version=version)) -os.system('cd c8_package && tar cjf pythia{version}-stripped.tar.bz2 pythia{version} && mv pythia{version}-stripped.tar.bz2 ..'.format(version=version)) -os.system('md5sum pythia{version}-stripped.tar.bz2'.format(version=version)) - -# cleanup -shutil.rmtree('c8_package') - -