# $Id: architecture.gmk,v 1.71 2001/05/30 15:04:13 gunter Exp $ # ------------------------------------------------------------------------ # GEANT 4 - Architecture configuration script for GNU Make # # First implementation: July 7th 1995 # # Description # ----------- # to override variables defined in this script, use "gmake -e", this will # cause environment variables to take precedence. In this case watch for # inadvertant overrides! # # List of the supported architectures/compilers and related flavors for # the environment variable G4SYSTEM: # # SUN-CC SunOS 5.6, CC 4.2 compiler (default) # # HP-aCC HP-UX 10.20, aCC A.01.23 compiler # # DEC-cxx DEC-OSF/1 4.0, DEC C++ 6.1 # # Linux-g++ Linux (Red Hat 6.1), egcs 1.1.2 # # WIN32-VC Windows/NT and Microsoft Visual C++ 6.0 # Adding CYGWIN32 tools (make, g++ as "makedepend", sh...) # Note: you will need to set your environment, see the # installation guide. # ------------------------------------------------------------------------- # Definition of HEP_ODBMS_LIBS, OBJY_LIBS and OSPACE_LIBS by HepODBMS. # Note: If G4ODBMS is defined, it calls for HEP_ODBMS setup files in # $(HEP_ODBMS_DIR)/etc/. # ifdef G4ODBMS # variables LHCXXTOP and PLATF are used in HepODBMS setup include $(HEP_ODBMS_DIR)/etc/$(OS).mk G4ODBMS_LIBS := $(HEP_ODBMS_LIBS) $(OBJY_LIBS) $(OSPACE_LIBS) endif MAKEFLAGS= --no-print-directory # If not specified, the default platform for G4SYSTEM is SUN-CC ... # ifndef G4SYSTEM G4SYSTEM := SUN-CC endif ifeq ($(G4SYSTEM),WIN32-VC-NICE) G4SYSTEM := WIN32-VC endif # If not specified, the default path for G4 installation G4INSTALL is # set to $HOME/geant4 ... # ifndef G4INSTALL G4INSTALL := $(HOME)/geant4 endif # If not specified, the default path for G4 source G4BASE is # set to $G4INSTALL/source ... # ifndef G4BASE G4BASE := $(G4INSTALL)/source endif # If not specified, the default path for the user's workdir is the same # as G4INSTALL ... # ifndef G4WORKDIR G4WORKDIR := $(G4INSTALL) endif # If not specified, the default path for temporary files G4TMP is # set to $G4WORKDIR/tmp/$G4SYSTEM ... # ifndef G4TMP G4TMP := $(G4WORKDIR)/tmp endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) ) # If not specified, the default path for G4 libraries G4LIB is # set to $G4INSTALL/lib/$G4SYSTEM ... # ifndef G4LIB G4LIB := $(G4INSTALL)/lib endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) ) G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) ) # If not specified, the default path to install G4 include files is G4INCLUDE # set to $G4INSTALL/include ... # ifndef G4INCLUDE G4INCLUDE := $(G4INSTALL)/include endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) ) # backwards compatiblity ifneq ($(G4MAKESHLIB),) G4LIB_BUILD_SHARED = 1 endif # defaults for library BUILD. No default for USE, ie. take what is found. ifeq ($(G4LIB_BUILD_SHARED),) ifeq ($(G4LIB_BUILD_STATIC),) # default is building static libs G4LIB_BUILD_STATIC = 1 endif endif # If not specified, the default path for G4 binaries G4BIN is # set to $G4WORKDIR/bin/$G4SYSTEM ... # ifndef G4BIN G4BIN := $(G4WORKDIR)/bin endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) ) #################### schema directories & setup for G4ODBMS ################### # ifdef G4ODBMS # If not specified, the default path for G4 schema G4SCHEMA_DIR is # set to $G4LIB/$G4SYSTEM/schema ... # ifndef G4SCHEMA_DIR G4SCHEMA_DIR := $(G4LIB)/$(G4SYSTEM)/schema G4SCHEMA_BOOT := $(G4SCHEMA_DIR)/G4SCHEMA G4SCHEMA_INCLUDE := $(G4SCHEMA_DIR)/include endif ifndef G4SCHEMA_FDID G4SCHEMA_FDID := 207 endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_DIR) ] && mkdir -p $(G4SCHEMA_DIR) ) G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_INCLUDE) ] && mkdir -p $(G4SCHEMA_INCLUDE) ) # If not specified, the default path for G4 example schema G4EXAMPLE_BOOT_DIR is # set to $G4WORKDIR/exampleSchema (for persistency examples)... # ifndef G4EXAMPLE_BOOT_DIR G4EXAMPLE_BOOT_DIR := $(G4WORKDIR)/exampleSchema/$(G4SYSTEM) endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_BOOT_DIR) ] && mkdir -p $(G4EXAMPLE_BOOT_DIR) ) ifndef G4EXAMPLE_BOOT G4EXAMPLE_BOOT = $(G4EXAMPLE_BOOT_DIR)/$(name) endif # If not specified, the default path for G4 example runtime federated # database directory G4EXAMPLE_FD_DIR is set to $G4WORKDIR/exampleFD # (for persistency examples)... # ifndef G4EXAMPLE_FD_DIR G4EXAMPLE_FD_DIR := $(G4WORKDIR)/exampleFD/$(G4SYSTEM) endif G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_FD_DIR) ] && mkdir -p $(G4EXAMPLE_FD_DIR) ) G4DDLX_FLAGS := -DTEMPLATEP_HIDES_FNCD ifndef G4EXAMPLE_FD G4EXAMPLE_FD = $(G4EXAMPLE_FD_DIR)/$(name) endif endif # ########################### end setup for G4ODBMS ############################# # If G4DEBUG or G4NO_OPTIMISE are not specified, # the default compilation is optimised ... # ifdef G4DEBUG CPPFLAGS += -DG4DEBUG G4DEBUG := 1 else ifndef G4NO_OPTIMISE CPPFLAGS += -DG4OPTIMISE G4OPTIMISE := 1 endif endif # CLHEP path, etc. # ifndef CLHEP_BASE_DIR CLHEP_BASE_DIR := /afs/cern.ch/sw/geant4/dev/CLHEP/$(G4SYSTEM)/pro endif ifndef CLHEP_INCLUDE_DIR CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include endif ifndef CLHEP_LIB_DIR CLHEP_LIB_DIR := $(CLHEP_BASE_DIR)/lib endif ifndef CLHEP_LIB ifeq ($(G4SYSTEM),WIN32-VC) CLHEP_LIB := CLHEP.lib else CLHEP_LIB := CLHEP endif endif # Native STL is the default # CPPFLAGS += -DG4USE_STL G4STLINC := $(G4BASE)/global/STLInterface # Path to ObjectSpace STL (or STLport <- only test for Win/NT) # ifdef G4USE_OSPACE # ObjectSpace STL implementation # ifndef OSPACE_BASE_DIR OSPACE_BASE_DIR := /afs/cern.ch/sw/geant4/dev/ObjectSpace/$(G4SYSTEM)/pro/ToolKit endif OSPACEINC := -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)/ospace/stl OSPACELIBS := -L$(OSPACE_BASE_DIR)/lib -lospace ifeq ($(G4SYSTEM),WIN32-VC) OSPACE_BASE_DIR := $(OBJECT_SPACE_BASE) OSPACEINC := -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)/ospace/stl -I$(OSPACE_BASE_DIR) OSPACELIBS := '-libpath':$(OSPACE_BASE_DIR)/lib std-2.1-vc5.0-mt.lib CPPFLAGS += -DG4USE_OLDSTL CPPFLAGS += -DOS_WIN_NT_4_0 -DOS_MULTI_THREADED -D_WIN32_WINNT $(OSPACEINC) endif else ifdef G4USE_STLPORT # STLport STL implementation # (derived from SGI implementation) - TEST on WIN32 # ifeq ($(G4SYSTEM),WIN32-VC) STLPORT_BASE_DIR := $(STLPORT_BASE) OSPACEINC := -I$(STLPORT_BASE_DIR)/stl CPPFLAGS += -DG4USE_OLDSTL CPPFLAGS += -D_NOTHREADS -D__STL_NO_NEW_IOSTREAMS -D__STL_NO_NAMESPACES CPPFLAGS += -D__STL_NO_NEW_STYLE_HEADERS endif endif #STLport endif #OPSPACE # Paths for G4 data # ifndef G4DATA G4DATA := $(G4INSTALL)/data endif # Photon evaporation data # ifndef G4LEVELGAMMADATA G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation endif # Toggle variables (positional qualifiers) between WIN32-VC and UNIX... # ifeq ($(G4SYSTEM),WIN32-VC) OUT_OBJ := -TP '-Fo' FOR_OBJ := '-Fo' OUT_LIB := '-out:' OUT_EXE := '-Fe' LIB_PATH := '-libpath:' CERNLIB_PATH := "z:\p32\cern\new\df\lib" PATH_DEL := \\ # # pattern for next substitution # LIB_PATT := lib(LibName).a FLIB_PATT := (LibName).lib else OUT_OBJ := -o FOR_OBJ := -o OUT_LIB := OUT_EXE := -o LIB_PATH := -L CERNLIB_PATH := /cern/pro/lib PATH_DEL := / # # pattern for next substitution # LIB_PATT := -l(LibName) FLIB_PATT := $(LIB_PATT) endif # Variables for implicit rules, etc., as suggested in GNU Make manual... # CPPFLAGS += -Iinclude -I$(G4STLINC) CPPFLAGS += -I$(CLHEP_INCLUDE_DIR) # Positional qualifiers in action... # ifeq ($(G4SYSTEM),WIN32-VC) LDFLAGS := -link $(LIB_PATH)$(CLHEP_LIB_DIR) LOADLIBS := $(CLHEP_LIB) else LDFLAGS := -L$(CLHEP_LIB_DIR) # LDFLAGS := LOADLIBS := -l$(CLHEP_LIB) # LOADLIBS := $(CLHEP_LIB_DIR)/lib$(CLHEP_LIB).a LOADLIBS += -lm endif # Graphic variables... # ifndef VISLIBS VISLIBS := endif # ------------------ X11 --------------------- X11FLAGS := X11LIBS := -lXmu -lXt -lXext -lX11 # ----------------- Motif -------------------- XMFLAGS := XMLIBS := -lXm # ---------------- Athena -------------------- XAWFLAGS := XAWLIBS := -lXaw # ---------------- OpenGL -------------------- # The user can define his own values of OGLFLAGS and OGLLIBS. # OGLFLAGS gives the directory containing include files. # E.g.: OGLFLAGS := -I$(OGLHOME)/include # OGLLIBS gives the libraries. # E.g.: OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL # Or : OGLLIBS := -L$(OGLHOME)/lib -lMesaGLU -lMesaGL # OGLHOME is often /usr or /usr/local. Or it can point to a special # installation. # If the user does not set his/her own values, system-dependent values # are set below. Most system-dependent code assumes OGLHOME is set. # ------------- OpenInventor ----------------- ifndef HEPVISINC HEPVISINC := $(HEPVISDIR)/include endif ifndef HEPVISLIB HEPVISLIB := $(HEPVISDIR)/source endif ifndef OIVFLAGS OIVFLAGS := -I${HEPVISINC} endif ifndef OIVLIBS OIVLIBS := -L${HEPVISLIB} -lHEPVis -lInventorXt -lInventor -lGLU -lGL endif # ----------------- OPACS -------------------- # lesstiff is bugged for popups ; then OPACS/Xo uses # the Xaw widgets for handling popups. The OPACS distrib # for Linux assumes that lesstif is used by default. To be # coherent we set in Geant4 the default toolkit to lesstif # on Linux in order to link with -lXaw, etc... ifndef G4_OPACS_WIDGET_SET ifeq ($(G4SYSTEM),Linux-g++) G4_OPACS_WIDGET_SET := lesstif else G4_OPACS_WIDGET_SET := Xm endif endif # For cfront compilers the repository location is set to # $G4TMP/$G4SYSTEM/g4.ptrepository. # G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY) # Default archive call. Changed for: SUN-CC. # AR := ar r # Default echo used with makedepend. Changed for SUN-CC, Linux-g++. # ECHO:= echo # Default grep used with source/GNUmakfile. Changed for SUN-CC. # GREP := grep # Include architecture dependent setups... # include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk # If compiler recognises implicit C++ type bool... # ifdef G4_HAVE_BOOL CPPFLAGS += -DG4_HAVE_BOOL endif # If there is no cbrt() function... # ifdef G4_NO_CBRT CPPFLAGS += -DG4_NO_CBRT endif # Verbosity code can be left out (for better performance) # by defining G4_NO_VERBOSE. # ifndef G4_NO_VERBOSE CPPFLAGS += -DG4VERBOSE endif # Trajectory related classes can be left out (for better performance) # by defining G4_NO_STORE_TRAJECTORY. # ifndef G4_NO_STORE_TRAJECTORY CPPFLAGS += -DG4_STORE_TRAJECTORY endif # Template setup - repositories, special options etc # ifdef CFRONT_G4TEMPLATE_REPOSITORY ifeq ($(findstring DEC,$(G4SYSTEM)),DEC) ifdef G4EXEC_BUILD CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP) else CXXTEMPLATE_FLAGS := -ptr $(G4TREP) endif else ifdef G4EXEC_BUILD CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP) else CXXTEMPLATE_FLAGS := -ptr$(G4TREP) endif endif CXXFLAGS += $(CXXTEMPLATE_FLAGS) CFRONT := true endif ifdef CFRONT G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' ) G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) ) G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) ) G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec ) endif