#pragma acc routine sec & makefile

Hi there,

I divided my code in 5 files , one .h and the others .c ,

I placed #pragma acc routine sec, before the prototypes in .h file, and above the call site in .c files, only in the ones that I call the functions.

But it doesn’t works.

I get these errors.


pgcc -acc -ta=multicore,tesla:cc35 -Minfo=accel -Msafeptr -c99 -c main.c
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 41)
PGC-S-0035-Syntax error: Recovery attempted by replacing keyword double by (./md.h: 42)
PGC-W-0156-Type not specified, ‘int’ assumed (./md.h: 42)
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 44)
PGC-S-0035-Syntax error: Recovery attempted by replacing keyword double by (./md.h: 45)
PGC-W-0156-Type not specified, ‘int’ assumed (./md.h: 45)
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 47)
PGC-S-0035-Syntax error: Recovery attempted by replacing keyword double by (./md.h: 48)
PGC-W-0156-Type not specified, ‘int’ assumed (./md.h: 48)
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 50)
PGC-S-0035-Syntax error: Recovery attempted by replacing keyword double by (./md.h: 51)
PGC-W-0156-Type not specified, ‘int’ assumed (./md.h: 51)
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 53)
PGC-S-0035-Syntax error: Recovery attempted by replacing keyword double by (./md.h: 54)
PGC-W-0156-Type not specified, ‘int’ assumed (./md.h: 54)
PGC-S-0037-Syntax error: Recovery attempted by deleting identifier sec (./md.h: 56)
PGC-S-0036-Syntax error: Recovery attempted by inserting before keyword void (./md.h: 57)
PGC/x86-64 Linux 17.10-0: compilation completed with severe errors

makefile

#makefile for mdgacc
NAME = mdacc
CC = pgcc
CCFLAGS = -c99
ACCFLAGS = -acc -ta=multicore,tesla:cc35 -Minfo=accel -Msafeptr
OBJECTS = scalar.o coordinate.o inout.o


mdacc : main.o $(OBJECTS)
$(CC) $(ACCFLAGS) $(CCFLAGS) -o mdacc main.o $(OBJECTS)
main.o: main.c md.h
$(CC) $(ACCFLAGS) $(CCFLAGS) -c main.c
coordinate.o: coordinate.c md.h
$(CC) $(ACCFLAGS) $(CCFLAGS) -c coordinate.c
scalar.o: scalar.c md.h
$(CC) $(ACCFLAGS) $(CCFLAGS) -c scalar.c
inout.o: inout.c md.h
$(CC) $(ACCFLAGS) $(CCFLAGS) -c inout.c


clean:
rm -f *.o $(NAME)

======
md.h file


double ccE(double upot, double ukin);

#pragma acc routine sec
double ccupot(double r, double eps0);

#pragma acc routine sec
double ccr(double dx, double dy, double dz);

#pragma acc routine sec
double ccgradient(double r, double eps0);

#pragma acc routine sec
double cctemperature(double ukin,double n);

#pragma acc routine sec
double ccscale(double t1, double t2,double deltat);

#pragma acc routine sec
void fixdistance(double *d, double dbox);

Any help?


Thanks in advance for your help.

Hi azzulrd,

The directive is “acc routine seq” not “sec”. “seq” is short for sequential.

Hope this helps,
Mat