| 1 | package MEMPHYS | 
|---|
| 2 | version v7r0 | 
|---|
| 3 |  | 
|---|
| 4 | #////////////////////////////////////////////////// | 
|---|
| 5 | #/// Uses needed to build this package //////////// | 
|---|
| 6 | #////////////////////////////////////////////////// | 
|---|
| 7 |  | 
|---|
| 8 | use OpenScientist v16r0 Interfaces | 
|---|
| 9 |  | 
|---|
| 10 | #use Geant4 v2r* Interfaces | 
|---|
| 11 |  | 
|---|
| 12 | set G4RADIOACTIVEDATA "${OSC_G4RADIOACTIVEDATA}" | 
|---|
| 13 | set G4LEVELGAMMADATA "${OSC_G4LEVELGAMMADATA}" | 
|---|
| 14 | set G4LEDATA "${OSC_G4LEDATA}" | 
|---|
| 15 | set NeutronHPCrossSections "${OSC_NeutronHPCrossSections}" | 
|---|
| 16 |  | 
|---|
| 17 | #//////////////////////////////////////////////////////////// | 
|---|
| 18 | #/// From Interfaces/Platform /////////////////////////////// | 
|---|
| 19 | #//////////////////////////////////////////////////////////// | 
|---|
| 20 |  | 
|---|
| 21 | macro Platform_bin "${CMTCONFIG}" | 
|---|
| 22 | #set PLATFORMBIN "${Platform_bin}" | 
|---|
| 23 |  | 
|---|
| 24 | pattern Platform_paths \ | 
|---|
| 25 | path_remove LD_LIBRARY_PATH "$(<PACKAGE>ROOT)/$(Platform_bin)" WIN32 "" Darwin "" ;\ | 
|---|
| 26 | path_append LD_LIBRARY_PATH "$(<PACKAGE>ROOT)/$(Platform_bin)" WIN32 "" Darwin "" ;\ | 
|---|
| 27 | path_remove DYLD_LIBRARY_PATH "" Darwin "$(<PACKAGE>ROOT)/$(Platform_bin)" ;\ | 
|---|
| 28 | path_append DYLD_LIBRARY_PATH "" Darwin "$(<PACKAGE>ROOT)/$(Platform_bin)" ;\ | 
|---|
| 29 | path_remove PATH "$(<PACKAGE>ROOT)/$(Platform_bin)" WIN32 "$(<PACKAGE>ROOT)\$(Platform_bin)" ;\ | 
|---|
| 30 | path_append PATH "$(<PACKAGE>ROOT)/$(Platform_bin)" WIN32 "$(<PACKAGE>ROOT)\$(Platform_bin)" | 
|---|
| 31 |  | 
|---|
| 32 | # Darwin : to build dlls properly : | 
|---|
| 33 | macro make_shlib "$(make_shlib)" Darwin "$(MEMPHYSROOT)/cmt/cmt_make_shlib_common.sh extract" | 
|---|
| 34 |  | 
|---|
| 35 | #////////////////////////////////////////////////// | 
|---|
| 36 | #////////////////////////////////////////////////// | 
|---|
| 37 | #////////////////////////////////////////////////// | 
|---|
| 38 |  | 
|---|
| 39 | branches run | 
|---|
| 40 |  | 
|---|
| 41 | build_strategy no_prototypes | 
|---|
| 42 | include_path none | 
|---|
| 43 |  | 
|---|
| 44 | include_dirs $(MEMPHYSROOT) | 
|---|
| 45 |  | 
|---|
| 46 | # With Geant4 global libs : | 
|---|
| 47 | macro MEMPHYS_Geant4_incs "${OSC_Geant4_incs}" | 
|---|
| 48 | macro MEMPHYS_Geant4_linkopts "-L${OSC_Geant4_lib} -lG4physicslists -lG4readout -lG4run -lG4event -lG4tracking -lG4processes -lG4digits_hits -lG4track -lG4particles -lG4geometry -lG4graphics_reps -lG4materials -lG4intercoms -lG4global -lCLHEP" | 
|---|
| 49 |  | 
|---|
| 50 | # Waiting Geant4 DLL on Windows... | 
|---|
| 51 | # Darwin : problem too with dylibs. | 
|---|
| 52 | macro MEMPHYS_libopts "" WIN32 " -no_share" Darwin " -no_share" | 
|---|
| 53 | #macro MEMPHYS_libopts "" WIN32 "" | 
|---|
| 54 |  | 
|---|
| 55 | #////////////////////////////////////////////////// | 
|---|
| 56 | #/// Over Geant4 kernel and AIDA interfaces only // | 
|---|
| 57 | #////////////////////////////////////////////////// | 
|---|
| 58 |  | 
|---|
| 59 | # Over Geant4 and AIDA only : | 
|---|
| 60 | library MEMPHYSCore ${MEMPHYS_libopts} -s=../source *.cxx | 
|---|
| 61 |  | 
|---|
| 62 | #JEC 17/11/05 add the G4readout_incs to manage G4DigiManager | 
|---|
| 63 | macro MEMPHYSCore_cppflags "${OSC_AIDA_incs} ${MEMPHYS_Geant4_incs}" | 
|---|
| 64 | #macro MEMPHYSCore_shlibflags "${MEMPHYS_Geant4_linkopts}" | 
|---|
| 65 | macro MEMPHYSCore_linkopts "-L${MEMPHYSROOT}/$(Platform_bin) -lMEMPHYSCore" WIN32 "${MEMPHYSROOT}\$(Platform_bin)\MEMPHYSCore.lib" | 
|---|
| 66 |  | 
|---|
| 67 | #////////////////////////////////////////////////// | 
|---|
| 68 | #/// DLD callbacks //////////////////////////////// | 
|---|
| 69 | #////////////////////////////////////////////////// | 
|---|
| 70 |  | 
|---|
| 71 | # Must not use Geant4 singletons if having not Geant4 shared libs. | 
|---|
| 72 | macro MEMPHYS_kind "dll" | 
|---|
| 73 | library MEMPHYS -s=../source/Callbacks Callbacks.cxx InventorCallbacks.cxx | 
|---|
| 74 | #macro MEMPHYS_cppflags "${MEMPHYS_Geant4_incs} ${OSC_OnX_incs}" | 
|---|
| 75 | macro MEMPHYS_cppflags "${OSC_G4Lab_incs} ${OSC_AIDA_incs} ${OSC_OnX_incs} ${OSC_Inventor_incs}" | 
|---|
| 76 | macro MEMPHYS_shlibflags "${OSC_Inventor_linkopts} ${OSC_OnX_linkopts}" | 
|---|
| 77 |  | 
|---|
| 78 | #////////////////////////////////////////////////// | 
|---|
| 79 | #/// Application "a la Geant4 examples" /////////// | 
|---|
| 80 | #////////////////////////////////////////////////// | 
|---|
| 81 |  | 
|---|
| 82 | # Over Geant4 and AIDA only : | 
|---|
| 83 | application MEMPHYS_batch ../applications/MEMPHYS_batch.cxx use_linkopts='"${MEMPHYSCore_linkopts} ${MEMPHYS_Geant4_linkopts} ${OSC_AIDA_linkopts}"' | 
|---|
| 84 | #macro MEMPHYS_batch_cppflags "${MEMPHYSCore_cppflags} " | 
|---|
| 85 | macro MEMPHYS_batch_cppflags "${MEMPHYSCore_cppflags}" | 
|---|
| 86 |  | 
|---|
| 87 | # Over AIDA only : | 
|---|
| 88 | application MEMPHYS_analysis ../applications/MEMPHYS_analysis.cxx use_linkopts='"$(OSC_AIDA_linkopts)"' | 
|---|
| 89 |  | 
|---|
| 90 | # Over G4Lab : | 
|---|
| 91 | application MEMPHYS_session ../applications/MEMPHYS_session.cxx ../applications/HitsCollectionAccessor.cxx use_linkopts='"${MEMPHYSCore_linkopts} ${OSC_G4Lab_linkopts} ${MEMPHYS_Geant4_linkopts} ${OSC_Inventor_linkopts} ${OSC_OnX_linkopts}"' | 
|---|
| 92 | macro MEMPHYS_session_cppflags "${MEMPHYS_Geant4_incs} ${MEMPHYS_batch_cppflags}" | 
|---|
| 93 |  | 
|---|
| 94 | application test -group=debug -s=../source test.cxx | 
|---|
| 95 |  | 
|---|
| 96 | #////////////////////////////////////////////////// | 
|---|
| 97 | #/// Things using ROOT //////////////////////////// | 
|---|
| 98 | #////////////////////////////////////////////////// | 
|---|
| 99 | use ROOT v1r* Interfaces | 
|---|
| 100 |  | 
|---|
| 101 | # Example of ROOT program to work on a MEMPHYS.root file : | 
|---|
| 102 | application MEMPHYS_analysis_ROOT -group=ROOT ../applications/MEMPHYS_analysis_ROOT.cxx use_linkopts='"${ROOT_Gpad_linkopts} ${ROOT_freetype_linkopts} ${ROOT_Graf_linkopts} ${ROOT_Tree_linkopts} ${ROOT_Hist_linkopts} ${ROOT_Matrix_linkopts} ${ROOT_Core_linkopts} ${ROOT_Cint_linkopts}"' | 
|---|
| 103 |  | 
|---|
| 104 | # Compiled version of scripts/ROOT/aida.C | 
|---|
| 105 | application MEMPHYS_analysis_aida_ROOT -group=ROOT ../applications/MEMPHYS_analysis_aida_ROOT.cxx use_linkopts='"${OSC_AIDA_linkopts} ${ROOT_Gpad_linkopts} ${ROOT_freetype_linkopts} ${ROOT_Graf_linkopts} ${ROOT_Hist_linkopts} ${ROOT_Matrix_linkopts} ${ROOT_Core_linkopts} ${ROOT_Cint_linkopts}"' | 
|---|
| 106 | macro MEMPHYS_analysis_aida_ROOT_cppflags "${OSC_AIDA_incs}" | 
|---|
| 107 |  | 
|---|
| 108 | # Declare AIDA to rootcint. | 
|---|
| 109 | # See scripts/ROOT/aida.C for a usage example. | 
|---|
| 110 |  | 
|---|
| 111 | macro MEMPHYS_cint_cintflags "${OSC_AIDA_incs}" | 
|---|
| 112 | macro MEMPHYS_cint_LinkDef_h "../source/ROOT/LinkDef.h" | 
|---|
| 113 | document rootcint MEMPHYS_rootcint_AIDA -group=ROOT ${MEMPHYSROOT}/source/ROOT/MEMPHYS_cint.h | 
|---|
| 114 |  | 
|---|
| 115 | library MEMPHYSAIDADict -group=ROOT -import=ROOT ${dict}/MEMPHYS_cintDict.cpp | 
|---|
| 116 | macro MEMPHYSAIDADict_shlibflags "$(OSC_AIDA_linkopts) ${ROOT_Core_linkopts} ${ROOT_Cint_linkopts}" | 
|---|
| 117 |  | 
|---|
| 118 | #////////////////////////////////////////////////// | 
|---|
| 119 | #////////////////////////////////////////////////// | 
|---|
| 120 | #////////////////////////////////////////////////// | 
|---|
| 121 |  | 
|---|
| 122 | private | 
|---|
| 123 | macro build_library_links "true" WIN32 "" | 
|---|
| 124 | macro remove_library_links "true" WIN32 "" | 
|---|
| 125 |  | 
|---|
| 126 | # WIN32 : /GR to enable RTTI and dynamic cast. | 
|---|
| 127 | # WIN32 : /GX to enable exception handling (for STL). | 
|---|
| 128 | macro_append cppflags "" WIN32 " /GX /GR" | 
|---|
| 129 |  | 
|---|
| 130 | # DEBUG : | 
|---|
| 131 | #macro_append cflags  " -g" WIN32 " /ZI /Od" | 
|---|
| 132 | #macro_append cppflags  " -g" WIN32 " /ZI /Od" | 
|---|
| 133 | #macro_append cpplinkflags  " -g" WIN32 " /DEBUG" | 
|---|
| 134 |  | 
|---|
| 135 | # OPTIMIZE : | 
|---|
| 136 | macro_append cflags  " -O" WIN32 " /O2" | 
|---|
| 137 | macro_append cppflags  " -O" WIN32 " /O2" | 
|---|
| 138 | macro_append cpplinkflags  " -O" WIN32 "" | 
|---|
| 139 | public | 
|---|
| 140 |  | 
|---|
| 141 | #////////////////////////////////////////////////// | 
|---|
| 142 | #// Run time ////////////////////////////////////// | 
|---|
| 143 | #////////////////////////////////////////////////// | 
|---|
| 144 |  | 
|---|
| 145 | apply_pattern Platform_paths | 
|---|
| 146 |  | 
|---|