
# Definition de l'environnement, AVANT d'appeler Makefile:
# module purge
# module load intel/17.0.4
#
# NOTE - Utiliser les versions les plus recentes !
#
# Utilisation du compilo Intel
FC = ifort

# Commenter pour ne pas avoir openmp
###OMP= -qopenmp

# Decommenter une des deux lignes pour activer la vectorisation ou pas
AVX=-xAVX
#AVX=-no-vec

# Commenter si pas besoin de vtune
# ... vouspouvez aussi le laisser cela ne fait pas de mal !
VTUNE_INCLUDE=$(VTUNE_AMPLIFIER_XE_DIR)/include/intel64
VTUNE_LIB=-L$(VTUNE_AMPLIFIER_XE_DIR)/lib64 -littnotify
INCLUDE = -I$(VTUNE_INCLUDE)
LIB     = $(VTUNE_LIB)

FCFLAGS = -g -fpp $(OMP) -O0 $(AVX) -align array64byte -qopt-report=5  
LDFLAGS = $(OMP)

EXEC = vect

all: $(EXEC)

vect: vect.o
	$(FC) -o vect vect.o $(LDFLAGS) $(LIB)

vect.o: vect.f90
	$(FC) -o vect.o -c vect.f90 $(FCFLAGS) $(INCLUDE)

# Jeter un oeil dans le code assembleur !
vect.cod: vect.f90
	$(FC) -S -fverbose-asm -fsource-asm -fcode-asm $(FCFLAGS) vect.f90

vect.s: vect.f90
	$(FC) -S -fverbose-asm $(FCFLAGS) vect.f90

clean:
	rm -rf $(EXEC) *.o *.mod *~ *.optrpt *.out *.txt

