Problem 1796 - Cannot compile GEANT4 example with ROOT6
Summary: Cannot compile GEANT4 example with ROOT6
Status: RESOLVED INVALID
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: analysis/AnaEx01 (show other problems)
Version: 10.1
Hardware: All All
: P5 trivial
Assignee: Ivana.Hrivnacova
URL:
Depends on:
Blocks:
 
Reported: 2015-10-25 22:52 CET by Olivier Delaune
Modified: 2015-10-29 00:06 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Olivier Delaune 2015-10-25 22:52:06 CET
I installed GEANT4 4.10.1 patch2. I tried to compile the example in "extended/analysis/AnaEx02"
Doing a classical cmake, make, it is not possible to compile successfully this example using ROOT6
A bug report was opened on the ROOT bugtracker (https://sft.its.cern.ch/jira/browse/ROOT-7748) but it is not a ROOT-related issue. Thus, I think you should add 

"include(${ROOT_USE_FILE})"
after find_package(ROOT)

as recommended here: https://sft.its.cern.ch/jira/browse/ROOT-7748?focusedCommentId=71279&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-71279

Probably this fix should be applied on all example that uses ROOT.
Comment 1 Ivana.Hrivnacova 2015-10-29 00:06:19 CET
Hello,

As ROOT6 is built against c++11 standard, you need to build Geant4 libraries against this standard, too, as the application code should use compatible libraries.
Geant4 10.1 is built by default with c++98 standard, so you have to select c++1 via CMake option:
-DGEANT4_BUILD_CXXSTD=c++11

This option is then automatically propagated to the example build via
include(${Geant4_USE_FILE})

Best regards,