From 1dcf1da5ca86d61ec68dc444c4a1cbc421707d47 Mon Sep 17 00:00:00 2001 From: Cosmic Fusion <83735213+CosmicFusion@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:25:06 +0300 Subject: [PATCH] fix error: use of undeclared identifier 'free' include stdlib.h to fix compilation error in rccl : [39/58] Building CXX object CMakeFiles/rccl.dir/src/misc/signals.cc.o FAILED: CMakeFiles/rccl.dir/src/misc/signals.cc.o /opt/rocm/bin/hipcc -DENABLE_COLLTRACE -DHAVE_BFD -DHAVE_CPLUS_DEMANGLE -DUSE_ROCM_SMI64CONFIG -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -Drccl_EXPORTS -I/home/cosmo/build/flgrwqa/build/include -I/home/cosmo/build/flgrwqa/build/include/rccl -I/home/cosmo/build/flgrwqa/rccl/src -I/home/cosmo/build/flgrwqa/rccl/src/include -I/home/cosmo/build/flgrwqa/rccl/src/collectives -I/home/cosmo/build/flgrwqa/rccl/src/collectives/device -I/opt/hsa/include -fPIC -fvisibility=hidden -fgpu-rdc -parallel-jobs=8 -Wno-format-nonliteral -x hip --offload-arch=gfx803 --offload-arch=gfx900:xnack- --offload-arch=gfx906:xnack- --offload-arch=gfx908:xnack- --offload-arch=gfx90a:xnack- --offload-arch=gfx90a:xnack+ --offload-arch=gfx1030 -std=c++14 -MD -MT CMakeFiles/rccl.dir/src/misc/signals.cc.o -MF CMakeFiles/rccl.dir/src/misc/signals.cc.o.d -o CMakeFiles/rccl.dir/src/misc/signals.cc.o -c /home/cosmo/build/flgrwqa/rccl/src/misc/signals.cc In file included from /home/cosmo/build/flgrwqa/rccl/src/misc/signals.cc:8: /home/cosmo/build/flgrwqa/rccl/src/include/BfdBacktrace.hpp:138:9: error: use of undeclared identifier 'free' free(file->syms); ^ /home/cosmo/build/flgrwqa/rccl/src/include/BfdBacktrace.hpp:155:5: error: use of undeclared identifier 'free' free(file->syms); ^ [ROCm/rccl commit: 080fc2d9d6e955d972346af1b3e6d7153e644d9d] --- projects/rccl/src/include/BfdBacktrace.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/rccl/src/include/BfdBacktrace.hpp b/projects/rccl/src/include/BfdBacktrace.hpp index ef0cc42077..9e24acb3de 100644 --- a/projects/rccl/src/include/BfdBacktrace.hpp +++ b/projects/rccl/src/include/BfdBacktrace.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef HAVE_CPLUS_DEMANGLE #define HAVE_DECL_BASENAME 1