core icon indicating copy to clipboard operation
core copied to clipboard

gnu compiler on KNL thinks gmi has issues

Open KennethEJansen opened this issue 6 years ago • 5 comments

[ 13%] Building C object gmi/CMakeFiles/gmi.dir/gmi_mesh.c.o /home/kjansen/SCOREC-core/core/gmi/gmi_analytic.c: In function 'reparam': /home/kjansen/SCOREC-core/core/gmi/gmi_analytic.c:127:3: error: array subscript 7 is above array bounds of 'struct agm_use[4]' [-Werror=array-bounds] reparam_path(m, path + 1, pathlen - 1, tmp, to_p);

KennethEJansen avatar Jan 03 '20 18:01 KennethEJansen

I got it to compile by commenting out the line which will probably be ok for the cases I am running right now but obviously this is not the real solution to the problem

KennethEJansen avatar Jan 03 '20 19:01 KennethEJansen

@KennethEJansen I was able to compile this with gcc without any problems. Can you tell me your gcc version?

mortezah avatar Jan 03 '20 22:01 mortezah

@KennethEJansen is using

$ gcc --version
gcc (GCC) 8.3.0 20190222 (Cray Inc.)

and the core branch addNFath https://github.com/cwsmith/core/blob/7afeab7305e6ce47b50c8bab37db8e517dd5be13/gmi/gmi_analytic.c

cwsmith avatar Jan 07 '20 16:01 cwsmith

I get the same error.

The error can be reproduced with the following Dockerfile:

FROM debian:stable-slim

RUN apt-get update \
    && apt-get install -y wget bzip2 gcc g++ gfortran cmake  libopenmpi-dev git

RUN cd /tmp \
    && git clone https://github.com/SCOREC/core.git

RUN cd /tmp \
    && cd core \
    && mkdir build && cd build \
    && cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release \
    && make -j4 && make install 

WORKDIR /home

uphoffc avatar Oct 08 '20 14:10 uphoffc

@uphoffc Thank you. I was able to reproduce the error. For the record, docker used GCC 8.3.0.

cwsmith avatar Nov 03 '20 00:11 cwsmith