Commit f9b9a84c authored by ulrich_y's avatar ulrich_y
Browse files

Added ifort

parent 3d3d01c3
...@@ -10,12 +10,11 @@ ifeq ($(HAVE_GINAC),1) ...@@ -10,12 +10,11 @@ ifeq ($(HAVE_GINAC),1)
LD=g++ LD=g++
LFLAGS=-lgfortran LFLAGS=-lgfortran
else else
LD=gfortran LD=$(FC)
endif endif
CFLAGS=-std=c99 ifeq ($(FC),gfortran)
FFLAGS=-fdefault-real-8 -cpp -pedantic-errors -std=f2008 -J build
FFLAGS=-fdefault-real-8 -cpp -pedantic-errors -std=f2008
FFLAGS+= -Werror -Wall -Wno-maybe-uninitialized -Wno-uninitialized FFLAGS+= -Werror -Wall -Wno-maybe-uninitialized -Wno-uninitialized
ifeq ($(MODE),RELEASE) ifeq ($(MODE),RELEASE)
...@@ -29,11 +28,19 @@ ifeq ($(HAVE_GINAC),1) ...@@ -29,11 +28,19 @@ ifeq ($(HAVE_GINAC),1)
FFLAGS += -DHAVE_GINAC FFLAGS += -DHAVE_GINAC
endif endif
else
FFLAGS=-autodouble -module build -fpp -stand f03 -O3 -xHost -fast
endif
CFLAGS=-std=c99
files=globals.o ieps.o utils.o shuffle.o maths_functions.o mpl_module.o gpl_module.o GPL.o files=globals.o ieps.o utils.o shuffle.o maths_functions.o mpl_module.o gpl_module.o GPL.o
objects = $(addprefix build/,$(files)) objects = $(addprefix build/,$(files))
ifeq ($(FC),gfortran)
all: libgpl.a gpl eval test all: libgpl.a gpl eval test
else
all: libgpl.a eval test
endif
libgpl.a:$(objects) libgpl.a:$(objects)
@echo "AR $@" @echo "AR $@"
...@@ -42,7 +49,7 @@ libgpl.a:$(objects) ...@@ -42,7 +49,7 @@ libgpl.a:$(objects)
# rules to make object files into /build # rules to make object files into /build
build/%.o: src/%.f90 build/%.o: src/%.f90
@echo "F90 $@" @echo "F90 $@"
@$(FC) $(FFLAGS) -c $< -J build -o $@ @$(FC) $(FFLAGS) -c $< -o $@
build/%.o: src/%.cpp build/%.o: src/%.cpp
@echo "C++ $@" @echo "C++ $@"
...@@ -50,6 +57,7 @@ build/%.o: src/%.cpp ...@@ -50,6 +57,7 @@ build/%.o: src/%.cpp
# Mathlink related # Mathlink related
ifeq ($(FC),gfortran)
build/mcc.internals.tmp: build/mcc.internals.tmp:
@echo "MCC --internals" @echo "MCC --internals"
@$(MCC) --internals > $@ @$(MCC) --internals > $@
......
...@@ -110,8 +110,11 @@ CONTAINS ...@@ -110,8 +110,11 @@ CONTAINS
RECURSIVE FUNCTION factorial(n) result(res) RECURSIVE FUNCTION factorial(n) result(res)
integer, intent(in) :: n integer, intent(in) :: n
integer :: res integer :: res, i
res = merge(1,n*factorial(n-1),n==0) res = 1
do i=n,1,-1
res = res*i
enddo
END FUNCTION factorial END FUNCTION factorial
FUNCTION shuffle_with_zero(a) result(res) FUNCTION shuffle_with_zero(a) result(res)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment