Bonjour à tous,
J'essaie de compiler en f90 un programme qui compilait sans problème en gfortran.
Or ça ne compile pas, j'ai le message d'erreur suivant:
ERROR: Dummy argument "NOM" is longer than the actual argument
Voici le contenu (épuré au maximum de manière à reproduire l'erreur sans s'embarasser d'instructions inutiles) du programme.
fichier constantes.f90:
1 2 3 4 5 6
| MODULE Constantes
IMPLICIT NONE
INTEGER,PARAMETER :: LENMAXNOM = 10 ! Longueur max des noms de colonnes
END MODULE Constantes |
fichier module_1.f90:
1 2 3 4 5 6 7 8 9 10 11 12
| MODULE module_1
USE Constantes
IMPLICIT NONE
CONTAINS
SUBROUTINE routine_1(Nom)
IMPLICIT NONE
CHARACTER(LEN=LENMAXNOM) :: Nom
END SUBROUTINE routine_1
END MODULE module_1 |
fichier module_2.f90:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| MODULE module_2
USE module_1
IMPLICIT NONE
CONTAINS
SUBROUTINE routine_2()
IMPLICIT NONE
CALL routine_1('')
END SUBROUTINE routine_2
END MODULE module_2 |
à la compilation, j'ai:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| f90 -M./OBJ -aligncommon=8 -xtypemap=real:64 -c ./SRC/constantes.f90 -o ./OBJ/constantes.o
f90 -M./OBJ -aligncommon=8 -xtypemap=real:64 -c ./SRC/module_1.f90 -o ./OBJ/module_1.o
f90 -M./OBJ -aligncommon=8 -xtypemap=real:64 -c ./SRC/module_2.f90 -o ./OBJ/module_2.o
MODULE module_2
^
"./SRC/module_2.f90", Line = 1, Column = 8: ERROR: The compiler has detected errors in module "MODULE_2". No module information file will be created for this module.
CALL routine_1('')
^
"./SRC/module_2.f90", Line = 11, Column = 16: ERROR: Dummy argument "NOM" is longer than the actual argument.
f90comp: 14 SOURCE LINES
f90comp: 2 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI
make: *** [OBJ/module_2.o] Error 1 |
Je n'ai pas l'impression d'avoir fait d'erreur de codage.... s'agit-il d'un bug de f90 (sunstudio versioon 12) ?
merci pour votre aide
ps: mon makefile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| # Nom(s) des compilateur(s)
F90C=f90
# Noms des binaires
BIN=bipbipyaeah
# Noms des directories
DIRSRC=./SRC
DIROBJ=./OBJ
F90FLAGS=-M$(DIROBJ) -aligncommon=8 -xtypemap=real:64
# Liste des objet
OBJ=$(DIROBJ)/constantes.o\
$(DIROBJ)/module_1.o\
$(DIROBJ)/module_2.o
# Cible norm
norm: init $(BIN)
# Cible all
all: norm
# Cible init
init:
@if [ ! -d $(DIROBJ) ]; then \mkdir -p $(DIROBJ); fi;
@if [ ! -d $(DIRDBX) ]; then \mkdir -p $(DIRDBX); fi;
@if [ ! -d $(DIREXE) ]; then \mkdir -p $(DIREXE); fi;
# Construction du binaire
$(BIN): $(OBJ) $(LISTOBJ)
$(F90C) $(F90FLAGS) $(OBJ) $(LISTOBJ) -o $(BIN) $(LDFLAGS) -lc
@-\mv $(BIN) $(DIREXE)
# Construction des objets
$(DIROBJ)/constantes.o: $(DIRSRC)/constantes.f90
$(F90C) $(F90FLAGS) -c $(DIRSRC)/constantes.f90 -o $(DIROBJ)/constantes.o
-@ mv *.mod $(DIROBJ) 2>/dev/null|:
$(DIROBJ)/module_1.o: $(DIRSRC)/module_1.f90
$(F90C) $(F90FLAGS) -c $(DIRSRC)/module_1.f90 -o $(DIROBJ)/module_1.o
-@ mv *.mod $(DIROBJ) 2>/dev/null|:
$(DIROBJ)/module_2.o: $(DIRSRC)/module_2.f90
$(F90C) $(F90FLAGS) -c $(DIRSRC)/module_2.f90 -o $(DIROBJ)/module_2.o
-@ mv *.mod $(DIROBJ) 2>/dev/null|: |
Partager