Advertisement
bidesh23

code compilation with cuda

Nov 24th, 2021
1,515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 4.17 KB | None | 0 0
  1.  
  2.  
  3. I am trying to compile a cuda code that I have received from Github (https://github.com/exafmm/exafmm-alpha).
  4.  
  5. The Makefile.include contains:
  6.  
  7. .SUFFIXES: .cxx .cu .f90 .o
  8. .PHONY: docs
  9.  
  10. CUDA_INSTALL_PATH = /usr/local/cuda
  11.  
  12. #DEVICE  = cpu
  13. DEVICE  = gpu
  14.  
  15. CXX     = mpicxx -g -O3 -lstdc++ -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include
  16. NVCC    = nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include
  17. FC      = mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
  18. FCC      = mpif90 -c -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
  19. LFLAGS  = -D$(DEVICE) -lstdc++ -ldl -lm
  20. LFLAGS  += -lmpi_cxx
  21. LFLAGS  += -lpthread
  22.  
  23. ifeq ($(DEVICE),gpu)
  24. LFLAGS  += -lcudart
  25. endif
  26. OBJECT  = ../kernel/$(DEVICE)Laplace.o ../kernel/$(DEVICE)BiotSavart.o\
  27.         ../kernel/$(DEVICE)Stretching.o ../kernel/$(DEVICE)Gaussian.o\
  28.         ../kernel/$(DEVICE)CoulombVdW.o
  29.  
  30. .cxx.o:
  31.         $(CXX) -c $? -o $@ $(LFLAGS)
  32. .cu.o:
  33.         $(NVCC) -c $? -o $@ $(LFLAGS)
  34. .f90.o:
  35.         $(FC) -c $? -o $@
  36.  
  37. And the Makefile is:
  38.  
  39. include ../Makefile.include
  40. lib_parallel_ij: parallel_wrapper_ij.o $(OBJECT)
  41.         ar -cr libfmm.a parallel_wrapper_ij.o $(OBJECT)
  42.         ranlib libfmm.a
  43.  
  44. test_parallel_ij: test_parallel_ij.o
  45.         make lib_parallel_ij
  46.         $(FC) $? -L. -lfmm $(LFLAGS)
  47.         mpirun -np 2 ./a.out
  48.  
  49. When I tried to compile the code, I get the following errors.
  50.  
  51. mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include -c test_parallel_ij.f90 -o test_parallel_ij.o
  52. make lib_parallel_ij
  53. make[1]: Entering directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
  54. mpicxx -g -O3 -lstdc++ -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c parallel_wrapper_ij.cxx -o parallel_wrapper_ij.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  55. nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuLaplace.cu -o ../kernel/gpuLaplace.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  56. nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuBiotSavart.cu -o ../kernel/gpuBiotSavart.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  57. ../kernel/gpuBiotSavart.cu(542): warning #177-D: variable "SQRT4PI" was declared but never referenced
  58.  
  59. ../kernel/gpuBiotSavart.cu(548): warning #550-D: variable "r" was set but never used
  60.  
  61. nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuStretching.cu -o ../kernel/gpuStretching.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  62. nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuGaussian.cu -o ../kernel/gpuGaussian.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  63. nvcc -Xcompiler "-fopenmp -O3" -lstdc++ -use_fast_math -I../include -c ../kernel/gpuCoulombVdW.cu -o ../kernel/gpuCoulombVdW.o -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  64. ar -cr libfmm.a parallel_wrapper_ij.o ../kernel/gpuLaplace.o ../kernel/gpuBiotSavart.o ../kernel/gpuStretching.o ../kernel/gpuGaussian.o ../kernel/gpuCoulombVdW.o
  65. ranlib libfmm.a
  66. make[1]: Leaving directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
  67. mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include test_parallel_ij.o -L. -lfmm -Dgpu -lstdc++ -ldl -lm -lmpi_cxx -lpthread -lcudart
  68. ./libfmm.a(gpuLaplace.o): In function `LaplaceL2P_GPU(int*, int*, double*, double*)':
  69. tmpxft_0000397c_00000000-6_gpuLaplace.cudafe1.cpp:(.text+0xc2): undefined reference to `__cudaPopCallConfiguration'
  70. ....
  71. ./libfmm.a(gpuLaplace.o): In function `Kernel::LaplaceL2P()':
  72. tmpxft_0000397c_00000000-6_gpuLaplace.cudafe1.cpp:(.text+0x3e06): undefined reference to `__cudaPushCallConfiguration'
  73. ....
  74. ./libfmm.a(gpuCoulombVdW.o): In function `__sti____cudaRegisterAll()':
  75. tmpxft_00003a87_00000000-6_gpuCoulombVdW.cudafe1.cpp:(.text.startup+0x189): undefined reference to `__cudaRegisterFatBinaryEnd'
  76. ....
  77.  
  78. I tried to find the installation of cuda:
  79.  
  80. whereis cuda
  81. cuda: /usr/lib/cuda /usr/include/cuda.h /usr/local/cuda
  82.  
  83. I could not fix the error, can anyone give any hint to fix it? Thank you.
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement