aws / aws-ofi-nccl

This is a plugin which lets EC2 developers use libfabric as network provider while running NCCL applications.
Apache License 2.0
133 stars 52 forks source link

aws branch does not build on centos 7 with gcc 4.8.5 #183

Closed wenduwan closed 1 year ago

wenduwan commented 1 year ago

Environment

Operating System: Centos 7 GCC version: 4.8.5 Host: EC2 g4dn.12xlarge

Commit

https://github.com/aws/aws-ofi-nccl/commit/bf57c29253560e21390098e83617ff6d664d5d2a

Issue

aws branch fails make with error

make[2]: Entering directory `aws_ofi_nccl/source/aws_ofi_nccl/tests'
  CC       nccl_message_transfer.o
  CC       ring.o
  CCLD     nccl_connection
ring.c: In function ‘main’:
ring.c:42:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int recv_n = 0; recv_n < nrecv; recv_n++) {
  ^
ring.c:42:2: note: use option -std=c99 or -std=gnu99 to compile your code
nccl_message_transfer.c: In function ‘main’:
nccl_message_transfer.c:41:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int recv_n = 0; recv_n < nrecv; recv_n++) {
  ^
nccl_message_transfer.c:41:2: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [ring.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [nccl_message_transfer.o] Error 1
make[2]: Leaving directory `aws_ofi_nccl/source/aws_ofi_nccl/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `aws_ofi_nccl/source/aws_ofi_nccl'
make: *** [all] Error 2

Reproducer

./autogen.sh
./configure --prefix=${PWD}/install --with-libfabric=/opt/amazon/efa --with-cuda=/usr/local/cuda --with-mpi=/opt/amazon/openmpi
make -j # <--- error
bwbarrett commented 1 year ago

Sorry for the slow reply. The super-simple work-around is to add CFLAGS=-std=c99 to the configure line, making it look like:

./configure CFLAGS="-std=c99" --prefix=${PWD}/install --with-libfabric=/opt/amazon/efa --with-cuda=/usr/local/cuda --with-mpi=/opt/amazon/openmpi

We will address this in a future release of the plugin.

wenduwan commented 1 year ago

Thank you!