]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updating for gfortran
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2008 08:19:45 +0000 (08:19 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2008 08:19:45 +0000 (08:19 +0000)
build/Makefile.linuxx8664gcc

index f9a5d064a7717ce1f92cdf5d5fc814a98b7e76e8..bd5ac51df0a1bdcea342335d616b72bdca42d670 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile for AliRoot for Itanium/Linux with gcc
+# Makefile to build AliRoot for Linux
 
 # System dependent commands
 
@@ -6,13 +6,22 @@ XARGS = xargs -r
 
 # The compilers
 CXX           = g++ 
-F77          = g77
 CC           = gcc
 CCMAJORV      = $(shell $(CC) -dumpversion | cut -d. -f1)
 CCMINORV      = $(shell $(CC) -dumpversion | cut -d. -f2)
 
+ifneq (,$(findstring g95,$(ROOTBUILD)))
+F77      = g95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+F77      = gfortran
+else
+F77      = g77
+endif
+endif
+
 # Global optimisation
-OPT           = -g -O
+OPT           = -O0 -g
 NOOPT         = -g
 
 CXXOPT        = $(OPT)
@@ -27,41 +36,75 @@ CLIBCOPT      =
 CLIBFOPT      = $(CLIBDEFS)
 
 # Compiler flags
+ifeq ($(CCMAJORV),2)
+CXXFLAGS       = $(OPT) -W -Wall -fPIC -pipe -m64
+CXXFLAGSNO     = $(NOOPT) -W -Wall -fPIC -pipe -m64
+else
+ifeq ($(CCMAJORV),3)
+CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
+CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
+else
 ifeq ($(CCMAJORV),4)
-CXXFLAGS       = $(CXXOPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
-CXXFLAGSNO     = $(CXXNOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
+CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
+CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
 else
-CXXFLAGS      = $(CXXOPT)  -Wall -fPIC -pipe
-CXXFLAGSNO    = $(CXXNOOPT)  -Wall -fPIC -pipe
+CXXFLAGS       = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux -m64
+CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -m64
+endif
 endif
-CFLAGS       = -Wall -fPIC -pipe
-FFLAGS        = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC
+endif
+CFLAGS        = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi -m64 
+FFLAGS         = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC -fno-f2c -m64
+
+ifneq (,$(findstring g95,$(ROOTBUILD)))
+FFLAGS       +=-DFORTRAN_G95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+FFLAGS       +=-DFORTRAN_GFORTRAN
+else
+FFLAGS       +=
+endif
+endif
+
 # rmkdepend flags for building dependencies of FORTRAN files
-DEPENDFFLAGS = $(FFLAGS)
+DEPENDFFLAGS   = $(FFLAGS)
 
 # rootcint flags
 CINTFLAGS     = 
 
 LD            = g++
-LDFLAGS       = $(OPT) -Wl,-Map -Wl,$@.map
+LDFLAGS       = $(OPT) 
 
-SHLD         = $(LD)
-SOFLAGS       = -shared -Wl -O2
+SHLD         = $(LD) 
+SOFLAGS       = $(OPT) -shared -Wl 
 SOEXT        = so
 
+#System libraries
+LIBNOVER      = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib64/ -l/'`
+
+SYSLIBS      := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11  $(LIBNOVER)
+
+ifneq (,$(findstring g95,$(ROOTBUILD)))
+SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
+SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
+else
+SHLIB         = -lg2c
+SYSLIBS +=  -lg2c
+endif
+endif
+
 ALLD         = ar
 ALFLAGS       = cr
 ALLIB         = 
 AEXT         = a
 
-# additional ROOT libraries
 
-LIBNOVER      = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib64/ -l/'`
 
-#System libraries
-SYSLIBS      := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11  $(LIBNOVER)
 
-EXEFLAGS     := -lg2c
+