Skip to content

Commit cb3c634

Browse files
committed
Fixed linker errors.
1 parent 5f1606a commit cb3c634

File tree

1 file changed

+8
-4
lines changed
  • posts/cuda-aware-mpi-example/src

1 file changed

+8
-4
lines changed

posts/cuda-aware-mpi-example/src/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
# Compilers
2828
MPICC=$(PREP) mpicc
29+
MPILD=$(PREP) mpic++
2930
NVCC=$(PREP) nvcc
3031

3132
# Flags
@@ -36,8 +37,11 @@ CUDACFLAGS=-I${CUDA_INSTALL_PATH}/include
3637
GENCODE_SM13 := -gencode arch=compute_13,code=sm_13
3738
GENCODE_SM20 := -gencode arch=compute_20,code=sm_20
3839
GENCODE_SM30 := -gencode arch=compute_30,code=sm_30
39-
GENCODE_SM35 := -gencode arch=compute_35,code=\"sm_35,compute_35\"
40-
GENCODE_FLAGS := $(GENCODE_SM13) $(GENCODE_SM20) $(GENCODE_SM30) $(GENCODE_SM35)
40+
GENCODE_SM35 := -gencode arch=compute_35,code=sm_35
41+
GENCODE_SM35 := -gencode arch=compute_37,code=sm_37
42+
GENCODE_SM50 := -gencode arch=compute_50,code=sm_50
43+
GENCODE_SM52 := -gencode arch=compute_52,code=\"sm_52,compute_52\"
44+
GENCODE_FLAGS := $(GENCODE_SM20) $(GENCODE_SM30) $(GENCODE_SM35) $(GENCODE_SM37) $(GENCODE_SM50) $(GENCODE_SM52)
4145

4246
NVCCFLAGS=-O3 $(GENCODE_FLAGS) -Xcompiler -march=native
4347

@@ -72,11 +76,11 @@ cuda_aware_mpi.o: Jacobi.h CUDA_Aware_MPI.c Makefile
7276

7377
$(JACOBI_CUDA_NORMAL_MPI): jacobi.o input.o host.o device.o cuda_normal_mpi.o Makefile
7478
mkdir -p $(BINDIR)
75-
$(MPICC) $(CUDALDFLAGS) -o $(JACOBI_CUDA_NORMAL_MPI) jacobi.o input.o host.o device.o cuda_normal_mpi.o
79+
$(MPILD) $(CUDALDFLAGS) -o $(JACOBI_CUDA_NORMAL_MPI) jacobi.o input.o host.o device.o cuda_normal_mpi.o
7680

7781
$(JACOBI_CUDA_AWARE_MPI): jacobi.o input.o host.o device.o cuda_aware_mpi.o Makefile
7882
mkdir -p $(BINDIR)
79-
$(MPICC) $(CUDALDFLAGS) -o $(JACOBI_CUDA_AWARE_MPI) jacobi.o input.o host.o device.o cuda_aware_mpi.o
83+
$(MPILD) $(CUDALDFLAGS) -o $(JACOBI_CUDA_AWARE_MPI) jacobi.o input.o host.o device.o cuda_aware_mpi.o
8084

8185
doc: CUDA_Normal_MPI.c CUDA_Aware_MPI.c Device.cu Host.c Input.c Makefile Jacobi.c Jacobi.h Jacobi.doxygen
8286
doxygen Jacobi.doxygen

0 commit comments

Comments
 (0)