Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/config/sys/Linux-clang.gmk is written in an unsupported language. File is not indexed.

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