Warning, /geant4/config/sys/Darwin-clang.gmk is written in an unsupported language. File is not indexed.
0001 #
0002 # ------ macOS ------
0003 # macOS, Apple clang-12 and higher
0004 #
0005 # Original author: Gabriele Cosmo - CERN
0006 #
0007 ifeq ($(G4SYSTEM),Darwin-clang)
0008 CXX := clang++
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 += -DGL_SILENCE_DEPRECATION
0014 CPPFLAGS += -std=c++17
0015 CXXFLAGS += -std=c++17
0016 G4USE_STD17 := 1
0017 ifdef G4MULTITHREADED
0018 CXXFLAGS += -ftls-model=initial-exec -pthread
0019 endif
0020 ifdef G4OPTIMISE
0021 CXXFLAGS += -O3
0022 FCFLAGS := -O3
0023 CCFLAGS := -O3
0024 else
0025 ifdef G4DEBUG
0026 CXXFLAGS += -g
0027 FCFLAGS := -g
0028 CCFLAGS := -g
0029 endif
0030 endif
0031 ifdef G4PROFILE
0032 CXXFLAGS += -pg
0033 FCFLAGS += -pg
0034 CCFLAGS += -pg
0035 endif
0036 ifdef G4OPTDEBUG
0037 CXXFLAGS += -O2 -g
0038 FCFLAGS += -O2 -g
0039 CCFLAGS += -O2 -g
0040 endif
0041 G4RUNPATHOPTION := -Wl,-rpath,
0042 # G4STATIC_MODE += -Wl,-force_load
0043 FC := gfortran
0044 FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
0045 LDFLAGS += -bind_at_load
0046 FCLIBS := -lg2c -lnsl
0047 SHEXT := dylib
0048 LOADLIBS += -lm
0049 ifndef X11FLAGS
0050 X11FLAGS := -I/usr/X11/include
0051 endif
0052 ifndef X11LIBS
0053 X11LIBS := -L/usr/X11/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
0054 endif
0055 ifndef XMFLAGS
0056 XMFLAGS := -I/usr/local/include
0057 # XMFLAGS := -I/usr/X11/include ##### some installations.
0058 endif
0059 ifndef XMLIBS
0060 XMLIBS := -L/usr/local/lib -lXm -lXpm
0061 # XMLIBS := -L/usr/X11/lib -lXm -lXpm ##### some installations.
0062 endif
0063 ifndef XAWFLAGS
0064 XAWFLAGS := -I/usr/local/include
0065 # XAWFLAGS := -I/usr/X11/include ##### some installations.
0066 endif
0067 ifndef XAWLIBS
0068 XAWLIBS := -lXaw
0069 endif
0070 DLDLIBS := -ldl
0071 ifndef OGLHOME
0072 OGLHOME := /usr/X11
0073 endif
0074 ifndef OGLFLAGS
0075 OGLFLAGS := -I$(OGLHOME)/include
0076 endif
0077 ifndef OGLLIBS
0078 OGLPATH := $(shell test -f /Library/Frameworks/OpenGL.framework/OpenGL && echo "/Library/Frameworks/OpenGL.framework")
0079 ifneq ($(OGLPATH),/Library/Frameworks/OpenGL.framework)
0080 OGLPATH := $(shell test -f /System/Library/Frameworks/OpenGL.framework/OpenGL && echo "/System/Library/Frameworks/OpenGL.framework")
0081 endif
0082 ifneq ($(OGLPATH),)
0083 OGLLIBS := -F$(OGLPATH)/.. -framework OpenGL -framework AGL
0084 else
0085 OGLLIBS := -L$(OGLHOME)/lib -lGL
0086 endif
0087 endif
0088
0089 # ---- Qt Setup block -------------------------------------------------------
0090
0091 ifndef QTHOME
0092 QTHOME := /Library/Frameworks
0093 endif
0094 ifndef QT_VERSION
0095 QT_VERSION := 5
0096 endif
0097 ifeq ($(QTHOME),/Library/Frameworks)
0098 ifndef QTMOC
0099 QTMOC := /usr/bin/moc
0100 endif
0101 ifndef QTFLAGS
0102 QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers
0103 QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers
0104 QTFLAGS += -I $(QTHOME)/QtWidgets.framework/Headers
0105 QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers
0106 QTFLAGS += -I $(QTHOME)/Qt3DCore.framework/Headers
0107 QTFLAGS += -I $(QTHOME)/Qt3DExtras.framework/Headers
0108 QTFLAGS += -I $(QTHOME)/Qt3DRender.framework/Headers
0109 ifeq ($(QT_VERSION),6)
0110 QTFLAGS += -I $(QTHOME)/QtOpenGLWidgets.framework/Headers
0111 endif
0112 QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
0113 endif
0114 ifndef QTLIBPATH
0115 QTLPATH := $(QTHOME)
0116 endif
0117 QTLIBPATH := -F$(QTLPATH)
0118 QT_AS_FRAMEWORK := $(shell test -d $(QTLPATH)/QtCore.framework && echo yes)
0119 ifndef QTLIBS
0120 ifdef QT_AS_FRAMEWORK
0121 QTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
0122 else
0123 QTLIBS := -L$(QTLPATH) -lQtCore -lQtGui
0124 endif
0125 endif
0126 ifndef QT3DLIBS
0127 ifdef QT_AS_FRAMEWORK
0128 QT3DLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
0129 QT3DLIBS += -framework QtWidgets -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender
0130 else
0131 QT3DLIBS := -L$(QTLPATH) -lQtCore -lQtGui
0132 QT3DLIBS += -lQtWidgets -lQt3DCore -lQt3DExtras -lQt3DRender
0133 endif
0134 endif
0135 ifndef GLQTLIBS
0136 ifdef QT_AS_FRAMEWORK
0137 GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui -framework QtOpenGL
0138 ifeq ($(QT_VERSION),6)
0139 GLQTLIBS += -framework QtOpenGLWidgets
0140 endif
0141 else
0142 GLQTLIBS := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL
0143 ifeq ($(QT_VERSION),6)
0144 GLQTLIBS += -lQtOpenGLWidgets
0145 endif
0146 endif
0147 endif
0148 else
0149 ifndef QTMOC
0150 QTMOC := $(QTHOME)/bin/moc
0151 endif
0152 QTLPATH := $(QTHOME)/lib
0153 ifndef QTFLAGS
0154 QTFLAGS := -I $(QTLPATH)/QtCore.framework/Headers
0155 QTFLAGS += -I $(QTLPATH)/QtGui.framework/Headers
0156 QTFLAGS += -I $(QTLPATH)/QtWidgets.framework/Headers
0157 QTFLAGS += -I $(QTLPATH)/QtOpenGL.framework/Headers
0158 QTFLAGS += -I $(QTLPATH)/Qt3DCore.framework/Headers
0159 QTFLAGS += -I $(QTLPATH)/Qt3DExtras.framework/Headers
0160 QTFLAGS += -I $(QTLPATH)/Qt3DRender.framework/Headers
0161 QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
0162 ifeq ($(QT_VERSION),6)
0163 QTFLAGS += -I $(QTHOME)/QtOpenGLWidgets.framework/Headers
0164 endif
0165 endif
0166 ifndef QTLIBS
0167 QTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui
0168 QTLIBS += -framework QtWidgets
0169 endif
0170 ifndef QT3DLIBS
0171 QT3DLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui
0172 QT3DLIBS += -framework QtWidgets
0173 QT3DLIBS += -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender
0174 endif
0175 ifndef GLQTLIBS
0176 GLQTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui
0177 GLQTLIBS += -framework QtWidgets
0178 GLQTLIBS += -framework QtOpenGL
0179 ifeq ($(QT_VERSION),6)
0180 GLQTLIBS += -framework QtOpenGLWidgets
0181 endif
0182 endif
0183 endif
0184
0185 #------ Wt Setup block ------------------------------------------------------
0186
0187 ifndef WTHOME
0188 WTHOME := /usr
0189 endif
0190 WTFLAGS := -I$(WTHOME)/include/boost -I$(WTHOME)/include -DQT_NO_KEYWORDS
0191 WTLIBS := -L$(WTHOME)/lib -lwt -lwtext -lwthttp -lboost_signals -L/usr/lib -lz -lssl -lcrypto
0192
0193 #----------------------------------------------------------------------------
0194
0195 define build-granular-shared-lib
0196 @libdir=`(cd $(@D);/bin/pwd)`; \
0197 cd $(G4TMPDIR); \
0198 $(CXX) -Wl,-w -dynamiclib -single_module -undefined dynamic_lookup \
0199 -o $$libdir/$(@F) $(INTYLIBS) *.o
0200 endef
0201 define build-global-shared-lib
0202 @libdir=`(cd $(@D);/bin/pwd)`; \
0203 cd $(G4TMP)/$(G4SYSTEM); \
0204 $(CXX) -Wl,-w -dynamiclib -single_module -undefined dynamic_lookup \
0205 -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
0206 endef
0207
0208 endif