Warning, /geant4/config/sys/Linux-g++.gmk is written in an unsupported language. File is not indexed.
0001 #
0002 # ------ GNU/LINUX ------ gcc 9.3 and higher
0003 #
0004 ifeq ($(G4SYSTEM),Linux-g++)
0005 CXX := g++
0006 CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
0007 CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual
0008 CXXFLAGS += -Wno-variadic-macros -Wshadow -pipe
0009 CXXFLAGS += -fno-trapping-math -ftree-vectorize -fno-math-errno
0010 CPPFLAGS += -std=c++17
0011 CXXFLAGS += -std=c++17
0012 G4USE_STD17 := 1
0013 ifdef G4MULTITHREADED
0014 CXXFLAGS += -ftls-model=initial-exec -pthread
0015 endif
0016 ifdef G4OPTIMISE
0017 CXXFLAGS += -O3
0018 FCFLAGS := -O3
0019 CCFLAGS := -O3
0020 else
0021 ifdef G4DEBUG
0022 CXXFLAGS += -g
0023 FCFLAGS := -g
0024 CCFLAGS := -g
0025 endif
0026 endif
0027 ifdef G4PROFILE
0028 CXXFLAGS += -pg
0029 FCFLAGS += -pg
0030 CCFLAGS += -pg
0031 endif
0032 ifdef G4OPTDEBUG
0033 CXXFLAGS += -O2 -g
0034 FCFLAGS += -O2 -g
0035 CCFLAGS += -O2 -g
0036 endif
0037 ifdef G4LIB_BUILD_SHARED
0038 CPPFLAGS += -fPIC
0039 CXXFLAGS += -fPIC
0040 FCFLAGS += -fPIC
0041 CCFLAGS += -fPIC
0042 endif
0043 G4RUNPATHOPTION := -Wl,-rpath
0044 G4STATIC_MODE += -Wl,--whole-archive
0045 G4NOSTATIC_MODE += -Wl,--no-whole-archive
0046 CC := gcc
0047 FC := gfortran
0048 FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
0049 FCLIBS := -lg2c -lnsl
0050 ECHO := /bin/echo -e
0051 SHEXT := so
0052 ARCH := $(shell uname -m | cut -s -d "_" -f 2)
0053 LOADLIBS += -lm -lstdc++
0054 ifndef X11FLAGS
0055 X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
0056 endif
0057 ifndef X11LIBS
0058 X11LIBS := -L/usr/lib$(ARCH) -lXmu -lXt -lXext -lX11 -lSM -lICE
0059 endif
0060 ifndef XMFLAGS
0061 XMFLAGS := -I/usr/include
0062 endif
0063 ifndef XMLIBS
0064 XMLIBS := -lXm -lXpm
0065 endif
0066 ifndef XAWFLAGS
0067 XAWFLAGS := -I/usr/include
0068 endif
0069 ifndef XAWLIBS
0070 XAWLIBS := -lXaw
0071 endif
0072 DLDLIBS := -ldl
0073 ifndef OGLHOME
0074 OGLHOME := /usr
0075 endif
0076 ifndef OGLFLAGS
0077 OGLFLAGS := -I$(OGLHOME)/include
0078 endif
0079 ifndef OGLLIBS
0080 OGLLIBS := -L$(OGLHOME)/lib$(ARCH) -lGL
0081 endif
0082
0083 # ---- QT Setup block -------------------------------------------------------
0084
0085 ifndef QTHOME
0086 QTHOME := /usr
0087 endif
0088 ifndef QTMOC
0089 QTMOC := $(QTHOME)/bin/moc
0090 endif
0091
0092 ifndef QT_VERSION
0093 QT_VERSION := 5
0094 endif
0095
0096 ifndef QTFLAGS
0097 QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt
0098 QTFLAGS += -I $(QTHOME)/include/QtCore
0099 QTFLAGS += -I $(QTHOME)/include/QtGui
0100 QTFLAGS += -I $(QTHOME)/include/QtWidgets
0101 QTFLAGS += -I $(QTHOME)/include/QtOpenGL
0102 QTFLAGS += -I $(QTHOME)/include/Qt3DCore
0103 QTFLAGS += -I $(QTHOME)/include/Qt3DExtras
0104 QTFLAGS += -I $(QTHOME)/include/Qt3DRender
0105 ifeq ($(QT_VERSION),6)
0106 QTFLAGS += -I $(QTHOME)/include/QtOpenGLWidgets
0107 endif
0108 endif
0109 ifndef QTLIBPATH
0110 QTLIBPATH := $(QTHOME)/lib
0111 QT_SEARCH_LIB := $(shell ls $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
0112 ifneq ($(QT_SEARCH_LIB),0)
0113 QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION)
0114 endif
0115 endif
0116 ifeq ($(QT_VERSION),5) # Qt5
0117 ifndef QTLIBS
0118 QTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets
0119 endif
0120 ifndef QT3DLIBS
0121 QT3DLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt53DCore -lQt53DExtras -lQt53DRender
0122 endif
0123 ifndef GLQTLIBS
0124 GLQTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5OpenGL
0125 endif
0126 else # Qt6
0127 ifndef QTLIBS
0128 QTLIBS := -L$(QTLIBPATH) -lQt6Core -lQt6Gui -lQt6Widgets
0129 endif
0130 ifndef QT3DLIBS
0131 QT3DLIBS := -L$(QTLIBPATH) -lQt6Core -lQt6Gui -lQt6Widgets -lQt63DCore -lQt63DExtras -lQt63DRender
0132 endif
0133 ifndef GLQTLIBS
0134 GLQTLIBS := -L$(QTLIBPATH) -lQt6Core -lQt6Gui -lQt6Widgets -lQt6OpenGL -lQt6OpenGLWidgets
0135 endif
0136 endif
0137
0138 #----------------------------------------------------------------------------
0139
0140 define build-granular-shared-lib
0141 @libdir=`(cd $(@D);/bin/pwd)`; \
0142 cd $(G4TMPDIR); \
0143 $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
0144 endef
0145 define build-global-shared-lib
0146 @libdir=`(cd $(@D);/bin/pwd)`; \
0147 cd $(G4TMP)/$(G4SYSTEM); \
0148 $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
0149 $(foreach dir,$(SUBLIBS),$(dir)/*.o);
0150 endef
0151
0152 endif