When trying to compile G4GIDI_mass.cc and tpia_mass.cc in processes/hadronic/models/lend/src the Intel C++ Compiler requires huge amounts of memory (>>10 GB) when compiling with optimizations enabled. See https://software.intel.com/en-us/forums/intel-c-compiler/topic/611638 This is a compiler bug but it can be worked around by changing std::string -> const char* in the ZAMass struct in these files (actually it appears that these were once const char* and were changed to std::string at some point). Do you think it's possible to make that change? Another option is to compile these two files with -O0 which could be done like this (patch for sources.cmake in processes/hadronic/models/lend --- a/source/processes/hadronic/models/lend/sources.cmake +++ b/source/processes/hadronic/models/lend/sources.cmake @@ -172,4 +172,11 @@ set_source_files_properties( PROPERTIES COMPILE_DEFINITIONS G4PROCESSES_EXPORT ) - +# These two files require infinite memory when compiled with the Intel compiler and optimizations enabled. +if("${CMAKE_CXX_COMPILER_ID}" MATCHES Intel) + foreach(file ${G4had_lend_SOURCES}) + if ("${file}" MATCHES G4GIDI_mass.cc OR "${file}" MATCHES tpia_mass.cc) + set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS -O0) + endif() + endforeach() +endif() This will generate an ICC remark (overriding optimization flag -O2 with -O0 or something like that). If desired that remark could be silenced for these two files. I think switching from std::string to const char* is the cleaner solution, though.
Hi Thank you for reporting this problem. But we changed the declaration std::string to char const * in 10.02. Tatsumi