bidesh23

Error in compilation with make file

Nov 7th, 2021 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 5.42 KB | None | 0 0
  1.  
  2. I am trying to compile a code by Makefile. I received the code from github. I tried to implement the solution from links: [https://github.com/LLNL/scr/issues/130][1] [https://stackoverflow.com/questions/62461718/mpi-complile-error-undefined-reference-to-mpiwinfree][2], etc.
  3.  
  4. These solutions are not working for me or they are too technical. I am sorry to say as I am not from a programming background, it is difficult for me to understand.
  5.  
  6. The make file are as follows:
  7.  
  8. Makefile.include
  9.  
  10. .SUFFIXES: .cxx .cu .f90 .o
  11. .PHONY: docs
  12.  
  13. CUDA_INSTALL_PATH = /usr/local/cuda
  14.  
  15. DEVICE  = cpu
  16. #~ DEVICE  = gpu
  17.  
  18. CXX     = mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include
  19. NVCC    = nvcc -Xcompiler "-fopenmp -O3" -std=c++11 -use_fast_math -I../include
  20. FC      = mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include
  21. LFLAGS  = -D$(DEVICE) -lstdc++ -ldl -lm
  22. #~ LFLAGS   += -lmpi_cxx
  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 Makefile:
  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. clean:
  50.     make -C .. clean
  51.  
  52. When I am trying to compile it. It gives me the following errors:
  53.  
  54. mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include -c test_parallel_ij.f90 -o test_parallel_ij.o
  55. make lib_parallel_ij
  56. make[1]: Entering directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
  57. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c parallel_wrapper_ij.cxx -o parallel_wrapper_ij.o -Dcpu -lstdc++ -ldl -lm
  58. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuLaplace.cxx -o ../kernel/cpuLaplace.o -Dcpu -lstdc++ -ldl -lm
  59. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuBiotSavart.cxx -o ../kernel/cpuBiotSavart.o -Dcpu -lstdc++ -ldl -lm
  60. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuStretching.cxx -o ../kernel/cpuStretching.o -Dcpu -lstdc++ -ldl -lm
  61. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuGaussian.cxx -o ../kernel/cpuGaussian.o -Dcpu -lstdc++ -ldl -lm
  62. mpicxx -g -O3 -std=c++11 -fPIC -fopenmp -ffast-math -funroll-loops -rdynamic -Wfatal-errors -I../include -c ../kernel/cpuCoulombVdW.cxx -o ../kernel/cpuCoulombVdW.o -Dcpu -lstdc++ -ldl -lm
  63. ar -cr libfmm.a parallel_wrapper_ij.o ../kernel/cpuLaplace.o ../kernel/cpuBiotSavart.o ../kernel/cpuStretching.o ../kernel/cpuGaussian.o ../kernel/cpuCoulombVdW.o
  64. ranlib libfmm.a
  65. make[1]: Leaving directory '/home/bidesh/panelCode/UVLM/NVLM_FMM/solver_single_rotor_try/exafmm-alpha-vortex/wrapper'
  66. mpif90 -g -O3 -fPIC -fopenmp -funroll-loops -rdynamic -I../include test_parallel_ij.o -L. -lfmm -Dcpu -lstdc++ -ldl -lm
  67. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
  68. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/op_inln.h:121: undefined reference to `ompi_mpi_cxx_op_intercept'
  69. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Intracomm::Clone() const':
  70. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()'
  71. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Graphcomm::Clone() const':
  72. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
  73. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Cartcomm::Sub(bool const*) const':
  74. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
  75. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const':
  76. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
  77. ./libfmm.a(parallel_wrapper_ij.o): In function `MPI::Cartcomm::Clone() const':
  78. /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
  79. ./libfmm.a(parallel_wrapper_ij.o):/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: more undefined references to `MPI::Comm::Comm()' follow
  80. ./libfmm.a(parallel_wrapper_ij.o):(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
  81. ./libfmm.a(parallel_wrapper_ij.o):(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
  82. collect2: error: ld returned 1 exit status
  83. Makefile:48: recipe for target 'test_parallel_ij' failed
  84. make: *** [test_parallel_ij] Error 1
  85.  
  86. I am unable to solve the error. I couldn't compile the code. I will be greatly helped if I can get some clue to compile it.
Add Comment
Please, Sign In to add comment