0

I am working on a project where I have to optimise the performance of a Computational Fluid Dynamic solver. We aim to use OpenACC to do so. The solver was written using fortran90 and run via terminal in linux systems. There are many directories like build,bin,cmake,src etc. in it. I started out by adding OPENACC directives to each of the source files and tried to compile using the make command in the build directory but I was getting some errors with it.

I have attached a screenshot of a section of the compiler output. SS of compiler output showing errors

1 Answers1

0

With GCC, you'll get errors such as:

test.o: In function `main':
test.c:(.text.startup+0x3c): undefined reference to `GOACC_parallel_keyed'
/tmp/cc8C7CVO.crtoffloadtable.o:(.rodata+0x0): undefined reference to `__offload_func_table'
/tmp/cc8C7CVO.crtoffloadtable.o:(.rodata+0x8): undefined reference to `__offload_funcs_end'
/tmp/cc8C7CVO.crtoffloadtable.o:(.rodata+0x10): undefined reference to `__offload_var_table'
/tmp/cc8C7CVO.crtoffloadtable.o:(.rodata+0x18): undefined reference to `__offload_vars_end'
/tmp/cc0n3gC3.target.o: In function `init':
cc89TnMy.c:(.text+0x19): undefined reference to `GOMP_offload_register_ver'
/tmp/cc0n3gC3.target.o: In function `fini':
cc89TnMy.c:(.text+0x39): undefined reference to `GOMP_offload_unregister_ver'
collect2: error: ld returned 1 exit status

... if you do compile with -fopenacc, but don't specify the latter flag when GCC is invoked for linking. (I suppose the build system isn't directly invoking ld, but instead does link via GCC.) Thus, make sure that -fopenacc also is active at link time.

tschwinge
  • 346
  • 1
  • 5