Warning, /geant4/config/architecture.gmk is written in an unsupported language. File is not indexed.
0001 # ------------------------------------------------------------------------
0002 # GEANT 4 - Architecture configuration script for GNU Make
0003 #
0004 # First implementation: July 7th 1995
0005 #
0006 # Description
0007 # -----------
0008 # to override variables defined in this script, use "gmake -e", this will
0009 # cause environment variables to take precedence. In this case watch for
0010 # inadvertant overrides!
0011 #
0012 # List of the supported architectures/compilers and related flavors for
0013 # the environment variable G4SYSTEM:
0014 #
0015 # Linux-g++ Linux (CentOS7), gcc-4.8.4 (default)
0016 #
0017 # Darwin-clang MacOSX 10.14, clang-7
0018 #
0019 # WIN32-VC Windows 10 and Microsoft Visual C++ 14.11
0020 #
0021 # -------------------------------------------------------------------------
0022
0023 MAKEFLAGS= --no-print-directory
0024
0025 # Define that we are building Geant4 with Geant4Make
0026 #
0027 CPPFLAGS += -DG4GMAKE
0028 G4GMAKE := 1
0029
0030 # If not specified, the default path for G4 installation G4INSTALL is
0031 # set to $HOME/geant4 ...
0032 #
0033 ifndef G4INSTALL
0034 G4INSTALL := $(HOME)/geant4
0035 endif
0036
0037 # If not specified, the default path for G4 source G4BASE is
0038 # set to $G4INSTALL/source ...
0039 #
0040 ifndef G4BASE
0041 G4BASE := $(G4INSTALL)/source
0042 endif
0043
0044 # If not specified, the default path for the user's workdir is the same
0045 # as G4INSTALL ...
0046 #
0047 ifndef G4WORKDIR
0048 G4WORKDIR := $(G4INSTALL)
0049 endif
0050
0051 # If not specified, the default path for temporary files G4TMP is
0052 # set to $G4WORKDIR/tmp/$G4SYSTEM ...
0053 #
0054 ifndef G4TMP
0055 G4TMP := $(G4WORKDIR)/tmp
0056 endif
0057 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) )
0058
0059 # If not specified, the default path for G4 libraries G4LIB is
0060 # set to $G4INSTALL/lib/$G4SYSTEM ...
0061 #
0062 ifndef G4LIB
0063 G4LIB := $(G4INSTALL)/lib
0064 endif
0065 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) )
0066 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) )
0067
0068 # If not specified, the default path to install G4 include files is G4INCLUDE
0069 # set to $G4INSTALL/include ...
0070 #
0071 ifndef G4INCLUDE
0072 G4INCLUDE := $(G4INSTALL)/include
0073 endif
0074 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) )
0075
0076 # Backwards compatibility
0077 #
0078 ifneq ($(G4MAKESHLIB),)
0079 ifeq ($(G4LIB_NO_SHARED),)
0080 G4LIB_BUILD_SHARED = 1
0081 endif
0082 endif
0083
0084 # Defaults for library BUILD. No default for USE, ie. take what is found.
0085 # Default is building static libraries.
0086 #
0087 ifeq ($(G4LIB_BUILD_SHARED),)
0088 ifeq ($(G4LIB_BUILD_STATIC),)
0089 G4LIB_BUILD_STATIC = 1
0090 endif
0091 endif
0092
0093 # Specify if to build the DLL libraries on Windows. Default is NO.
0094 #
0095 ifneq ($(G4LIB_USE_DLL),)
0096 G4LIB_BUILD_DLL = 1
0097 CPPFLAGS += -DG4LIB_BUILD_DLL
0098 endif
0099 ifneq ($(G4LIB_BUILD_DLL),)
0100 G4LIB_BUILD_DLL = 1
0101 CPPFLAGS += -DG4LIB_BUILD_DLL
0102 G4LIB_USE_DLL = 1
0103 endif
0104
0105 # Specify if to build the G3TOG4 module or not. Default is NO.
0106 #
0107 ifneq ($(G4LIB_BUILD_G3TOG4),)
0108 G4LIB_BUILD_G3TOG4 = 1
0109 G4LIB_USE_G3TOG4 = 1
0110 endif
0111
0112 # Specify if to build the ZLIB module or not. Default is NO.
0113 #
0114 ifneq ($(G4LIB_BUILD_ZLIB),)
0115 G4LIB_BUILD_ZLIB = 1
0116 G4LIB_USE_ZLIB = 1
0117 endif
0118
0119 # Specify if to build the EXPAT module or not. Default is NO.
0120 #
0121 ifneq ($(G4LIB_BUILD_EXPAT),)
0122 G4LIB_BUILD_EXPAT = 1
0123 G4LIB_USE_EXPAT = 1
0124 endif
0125
0126 # If not specified, the default path for G4 binaries G4BIN is
0127 # set to $G4WORKDIR/bin/$G4SYSTEM ...
0128 #
0129 ifndef G4BIN
0130 G4BIN := $(G4WORKDIR)/bin
0131 endif
0132 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
0133
0134 # Use minimum C++14 standard constructs and compilation options ...
0135 #
0136 # CPPFLAGS += -DG4USE_STD14
0137 # G4USE_STD14 := 1
0138
0139 # If G4DEBUG or G4NO_OPTIMISE are not specified,
0140 # the default compilation is optimised ...
0141 #
0142 ifdef G4DEBUG
0143 CPPFLAGS += -DG4DEBUG
0144 G4DEBUG := 1
0145 else
0146 ifndef G4NO_OPTIMISE
0147 CPPFLAGS += -DG4OPTIMISE
0148 G4OPTIMISE := 1
0149 endif
0150 endif
0151
0152 ifdef G4MULTITHREADED
0153 CPPFLAGS += -DG4MULTITHREADED
0154 G4MULTITHREADED := 1
0155 endif
0156
0157 # CLHEP path, etc.
0158 #
0159 ifndef CLHEP_BASE_DIR
0160 CLHEP_BASE_DIR := $(G4BASE)/externals/clhep
0161 G4LIB_BUILD_CLHEP := 1
0162 G4LIB_USE_CLHEP := 1
0163 endif
0164 ifndef G4LIB_USE_CLHEP
0165 ifndef CLHEP_LIB
0166 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0167 CLHEP_LIB := CLHEP.lib
0168 else
0169 CLHEP_LIB := CLHEP
0170 #
0171 # If using the "granular" libraries of CLHEP, uncomment below
0172 #
0173 # CLHEP_LIB := CLHEP-HepMC -l CLHEP-Geometry -l CLHEP-Random -l CLHEP-Vector
0174 endif
0175 endif
0176 endif
0177 ifndef CLHEP_INCLUDE_DIR
0178 CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
0179 endif
0180 ifndef CLHEP_LIB_DIR
0181 CLHEP_LIB_DIR := $(CLHEP_BASE_DIR)/lib
0182 endif
0183
0184 # PTL path, etc.
0185 #
0186 ifndef PTL_BASE_DIR
0187 PTL_BASE_DIR := $(G4BASE)/externals/ptl
0188 G4LIB_BUILD_PTL := 1
0189 G4LIB_USE_PTL := 1
0190 endif
0191 ifndef G4LIB_USE_PTL
0192 ifndef PTL_LIB
0193 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0194 PTL_LIB := ptl.lib
0195 else
0196 PTL_LIB := ptl
0197 endif
0198 endif
0199 endif
0200 ifndef PTL_INCLUDE_DIR
0201 PTL_INCLUDE_DIR := $(PTL_BASE_DIR)/include
0202 endif
0203 ifndef CLHEP_LIB_DIR
0204 PTL_LIB_DIR := $(PTL_BASE_DIR)/lib
0205 endif
0206
0207 # USolids path, etc.
0208 #
0209 ifdef G4GEOM_USE_USOLIDS
0210 G4USOLIDS :=1
0211 endif
0212 ifdef G4GEOM_USE_PARTIAL_USOLIDS
0213 G4USOLIDS :=1
0214 endif
0215 ifdef G4USOLIDS
0216 G4LIB_USE_USOLIDS := 1
0217 ifndef USOLIDS_BASE_DIR
0218 $(error ERROR - Define path USOLIDS_BASE_DIR to VecGeom installation!)
0219 else
0220 ifndef USOLIDS_LIB
0221 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0222 USOLIDS_LIB := vecgeom.lib
0223 else
0224 USOLIDS_LIB := vecgeom
0225 endif
0226 endif
0227 ifndef USOLIDS_INCLUDE_DIR
0228 USOLIDS_INCLUDE_DIR := $(USOLIDS_BASE_DIR)/include
0229 endif
0230 ifndef USOLIDS_LIB_DIR
0231 USOLIDS_LIB_DIR := $(USOLIDS_BASE_DIR)/lib
0232 endif
0233 CPPFLAGS += -I$(USOLIDS_INCLUDE_DIR)
0234 endif
0235 endif
0236
0237 # Paths for G4 data
0238 #
0239 ifndef G4DATA
0240 G4DATA := $(G4INSTALL)/data
0241 endif
0242
0243 # Photon evaporation data
0244 #
0245 ifndef G4LEVELGAMMADATA
0246 G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
0247 endif
0248
0249 # Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
0250 #
0251 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0252 OUT_OBJ := -TP '-Fo'
0253 FOR_OBJ := '-Fo'
0254 OUT_LIB := '-out:'
0255 OUT_EXE := '-Fe'
0256 LIB_PATH := '-libpath:'
0257 CERNLIB_PATH := "c:\cern\pro\lib"
0258 PATH_DEL := \\
0259 #
0260 # pattern for next substitution
0261 #
0262 LIB_PATT := lib(LibName).a
0263 FLIB_PATT := (LibName).lib
0264 else
0265 OUT_OBJ := -o
0266 FOR_OBJ := -o
0267 OUT_LIB :=
0268 OUT_EXE := -o
0269 LIB_PATH := -L
0270 CERNLIB_PATH := /cern/pro/lib
0271 PATH_DEL := /
0272 #
0273 # pattern for next substitution
0274 #
0275 LIB_PATT := -l(LibName)
0276 FLIB_PATT := $(LIB_PATT)
0277 endif
0278
0279 # Variables for implicit rules, etc., as suggested in GNU Make manual...
0280 #
0281 CPPFLAGS += -Iinclude
0282 CPPFLAGS += -I$(CLHEP_INCLUDE_DIR) -I$(PTL_INCLUDE_DIR)
0283
0284 # Positional qualifiers in action...
0285 #
0286 ifndef LDFLAGS
0287 LDFLAGS :=
0288 #
0289 # run-time loading flags
0290 #
0291 G4STATIC_MODE :=
0292 G4NOSTATIC_MODE :=
0293 endif
0294 ifndef LOADLIBS
0295 LOADLIBS :=
0296 endif
0297 ifndef G4LIB_USE_CLHEP
0298 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0299 LDFLAGS += -link $(LIB_PATH)$(CLHEP_LIB_DIR)
0300 LOADLIBS += $(CLHEP_LIB)
0301 else
0302 LDFLAGS += -L$(CLHEP_LIB_DIR)
0303 LOADLIBS += -l$(CLHEP_LIB)
0304 endif
0305 endif
0306 ifndef G4LIB_USE_PTL
0307 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0308 LDFLAGS += -link $(LIB_PATH)$(PTL_LIB_DIR)
0309 LOADLIBS += $(PTL_LIB)
0310 else
0311 LDFLAGS += -L$(PTL_LIB_DIR)
0312 LOADLIBS += -l$(PTL_LIB)
0313 endif
0314 endif
0315 ifdef G4LIB_USE_USOLIDS
0316 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0317 LDFLAGS += -link $(LIB_PATH)$(USOLIDS_LIB_DIR)
0318 LOADLIBS += $(USOLIDS_LIB)
0319 else
0320 LDFLAGS += -L$(USOLIDS_LIB_DIR)
0321 LOADLIBS += -l$(USOLIDS_LIB)
0322 endif
0323 endif
0324 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0325 LDFLAGS += -link $(LIB_PATH)$(G4INSTALL)/lib
0326 endif
0327
0328 ifndef G4LIB_USE_EXPAT
0329 ifndef EXPATROOT
0330 EXPATROOT := /usr
0331 endif
0332 ifndef EXPATFLAGS
0333 EXPATFLAGS := -I$(EXPATROOT)/include
0334 endif
0335 ifndef EXPATLIBS
0336 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0337 EXPATLIBS := $(LIB_PATH)$(EXPATROOT)/lib expat.lib
0338 else
0339 EXPATLIBS := -L$(EXPATROOT)/lib -lexpat
0340 endif
0341 endif
0342 CPPFLAGS += $(EXPATFLAGS)
0343 LOADLIBS += $(EXPATLIBS)
0344 endif
0345
0346 ifndef G4LIB_USE_ZLIB
0347 ifndef ZLIBROOT
0348 ZLIBROOT := /usr
0349 endif
0350 ifndef ZLIBFLAGS
0351 ZLIBFLAGS := -I$(ZLIBROOT)/include
0352 endif
0353 ifndef ZLIBLIBS
0354 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0355 ZLIBLIBS := $(LIB_PATH)$(ZLIBROOT)/lib zlib.lib
0356 else
0357 ZLIBLIBS := -L$(ZLIBROOT)/lib -lz
0358 endif
0359 endif
0360 CPPFLAGS += $(ZLIBFLAGS)
0361 LOADLIBS += $(ZLIBLIBS)
0362 endif
0363
0364 # Graphic variables...
0365 #
0366 ifndef VISLIBS
0367 VISLIBS :=
0368 endif
0369 #
0370 # ---------------- OpenGL --------------------
0371 # The user can define his own values of OGLFLAGS and OGLLIBS.
0372 # OGLFLAGS gives the directory containing include files.
0373 # E.g.: OGLFLAGS := -I$(OGLHOME)/include
0374 # OGLLIBS gives the libraries.
0375 # E.g.: OGLLIBS := -L$(OGLHOME)/lib -lGL
0376 # Or : OGLLIBS := -L$(OGLHOME)/lib -lMesaGL
0377 # OGLHOME is often /usr or /usr/local. In such case, it is not necessary
0378 # to specify the path in OGLFLAGS, since added already by default by the
0379 # compiler. OGLHOME can also point to a special installation.
0380 # If the user does not set his/her own values, system-dependent values
0381 # are set below. Most system-dependent code assumes OGLHOME is set.
0382
0383 # ------------- OpenInventor -----------------
0384 # The path to the installation of OpenInventor (Coin) must be specified
0385 # if the package is installed in a location different
0386 # than default system directories (like... /usr or /usr/local).
0387 #
0388 ifndef OIVHOME
0389 OIVHOME := /usr/local/Inventor
0390 endif
0391 ifndef OIVFLAGS
0392 OIVFLAGS := -I$(OIVHOME)/include
0393 endif
0394 ifndef OIVLIBS
0395 ifdef G4VIS_USE_OIQT
0396 OIVLIBS := -L$(OIVHOME)/lib -lSoQt
0397 else
0398 OIVLIBS := -L$(OIVHOME)/lib -lSoXt
0399 endif
0400 OIVLIBS += -lCoin
0401 endif
0402
0403 # ----------------- GDML ---------------------
0404 # Setup path to XERCESC library if GDML plugin build is specified
0405 #
0406 ifneq ($(G4LIB_BUILD_GDML),)
0407 G4LIB_USE_GDML = 1
0408 endif
0409 ifdef G4LIB_USE_GDML
0410 ifndef XERCESCROOT
0411 XERCESCROOT := /usr/local/xercesc
0412 endif
0413 ifndef GDMLFLAGS
0414 GDMLFLAGS := -DG4LIB_USE_GDML -I$(XERCESCROOT)/include
0415 endif
0416 ifndef GDMLLIBS
0417 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
0418 GDMLLIBS := $(LIB_PATH)$(XERCESCROOT)/lib xerces-c.lib
0419 else
0420 GDMLLIBS := -L$(XERCESCROOT)/$(shell [ -d $(XERCESCROOT)/lib64 ] && echo "lib64" || echo "lib") -lxerces-c
0421 endif
0422 endif
0423 CPPFLAGS += $(GDMLFLAGS)
0424 endif
0425
0426 # For cfront compilers the repository location is set to
0427 # $G4TMP/$G4SYSTEM/g4.ptrepository.
0428 #
0429 G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
0430 G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
0431 G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
0432
0433 # Default archive call. Changed for: SUN-CC.
0434 #
0435 AR := ar rc
0436
0437 # Default echo used with makedepend. Changed for SUN-CC, Linux-g++, WIN32.
0438 #
0439 ECHO:= echo
0440
0441 # Default grep used with source/GNUmakefile. Changed for SUN-CC.
0442 #
0443 GREP := grep
0444
0445 # Default cut used with source/GNUmakefile. Changed for WIN32.
0446 #
0447 CUT := cut
0448
0449 # Default cat used with source/GNUmakefile. Changed for WIN32.
0450 #
0451 CAT := cat
0452
0453 # Default sed used with source/GNUmakefile. Changed for WIN32.
0454 #
0455 SED := sed
0456
0457 # Default find used with source/GNUmakefile. Changed for WIN32.
0458 #
0459 FIND := find
0460
0461 # Default sort used with source/GNUmakefile. Changed for WIN32.
0462 #
0463 SORT := sort
0464
0465 # Default touch used with source/GNUmakefile. Changed for WIN32.
0466 #
0467 TOUCH := touch
0468
0469 # Include geometry specific setup...
0470 #
0471 include $(G4INSTALL)/config/geomconf.gmk
0472
0473 # Include architecture dependent setups...
0474 #
0475 include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
0476
0477 # make certain that OGLFLAGS does NOT contain -I/usr/include
0478 # caused by OGLHOME being /usr, as e.g. on Linux
0479 #
0480 ifdef OGLFLAGS
0481 OGLFLAGS:= $(filter-out -I/usr/include,$(OGLFLAGS))
0482 OGLFLAGS:= $(filter-out -I/usr//include,$(OGLFLAGS))
0483 endif
0484
0485 # If there is no cbrt() function...
0486 #
0487 ifdef G4_NO_CBRT
0488 CPPFLAGS += -DG4_NO_CBRT
0489 endif
0490
0491 # Verbosity code can be left out (for better performance)
0492 # by defining G4_NO_VERBOSE.
0493 #
0494 ifndef G4_NO_VERBOSE
0495 CPPFLAGS += -DG4VERBOSE
0496 endif
0497
0498 # Trajectory related classes can be left out (for better performance)
0499 # by defining G4_NO_STORE_TRAJECTORY.
0500 #
0501 ifndef G4_NO_STORE_TRAJECTORY
0502 CPPFLAGS += -DG4_STORE_TRAJECTORY
0503 endif
0504
0505 # Template setup - repositories, special options etc
0506 #
0507 ifdef CFRONT_G4TEMPLATE_REPOSITORY
0508 ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
0509 ifdef G4EXEC_BUILD
0510 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
0511 else
0512 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
0513 endif
0514 else
0515 ifdef G4EXEC_BUILD
0516 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
0517 else
0518 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
0519 endif
0520 endif
0521 CXXFLAGS += $(CXXTEMPLATE_FLAGS)
0522 CFRONT := true
0523 endif
0524 ifdef CFRONT
0525 G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
0526 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
0527 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
0528 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
0529 endif