From 5275aa57159eaed269c63020a8b12defff875cb0 Mon Sep 17 00:00:00 2001 From: Pedram Alizadeh Date: Fri, 24 Feb 2023 21:39:04 -0500 Subject: [PATCH] Adding -pthread flag for linking issues into src/Makefile (#30) * Adding -pthread flag for linking issues into src/Makefile * Adding -pthread flag for linking issues into CMakeLists.txt --- CMakeLists.txt | 2 ++ src/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f440060946..bae921038b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ # ######################################################################## # Copyright 2022 Advanced Micro Devices, Inc. # ######################################################################## +#Adding pthread flag for linking +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") macro(check_mpi mpi_compiler mpi_lib_a mpi_lib_so) find_program(MPI_MPICXX ${mpi_compiler}) if (MPI_MPICXX) diff --git a/src/Makefile b/src/Makefile index ea925ad3fc..500549d2da 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,7 +26,7 @@ endif HIPCUFLAGS += -I$(ROCM_PATH)/include HIPCUFLAGS += -I$(ROCM_PATH)/include/hip LDFLAGS += -L$(ROCM_PATH)/lib -lhsa-runtime64 -lrt -HIPLDFLAGS += $(CUSTOM_RCCL_LIB) -L$(ROCM_PATH)/lib -lhsa-runtime64 -lrt +HIPLDFLAGS += $(CUSTOM_RCCL_LIB) -L$(ROCM_PATH)/lib -lhsa-runtime64 -lrt -pthread ifeq ($(DEBUG), 0) HIPCUFLAGS += -O3