Error while complie spmm.cu

126 views
Skip to first unread message

newHand

unread,
Jun 27, 2016, 3:06:42 PM6/27/16
to cusp-users
Hi, I meet errors while compling spmm.cu:

[~/cjl/cusplibrary-develop/performance/spmm] $>ls

SConstruct  spmm.cu

[~/cjl/cusplibrary-develop/performance/spmm] $>nvcc  spmm.cu -o spmm -I ../../

/tmp/tmpxft_0000cca5_00000000-17_spmm.o: In function `cusparse_init()':
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x1f): undefined reference to `cusparseCreate'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x58): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x73): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x8e): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0xa9): undefined reference to `cusparseDestroy'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0xd1): undefined reference to `cusparseCreateMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x10a): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x125): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x140): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x15b): undefined reference to `cusparseDestroy'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x18d): undefined reference to `cusparseSetMatType'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x1a1): undefined reference to `cusparseSetMatIndexBase'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x1ab): undefined reference to `cusparseCreateMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x1e4): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x1ff): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x21a): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x235): undefined reference to `cusparseDestroy'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x267): undefined reference to `cusparseSetMatType'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x27b): undefined reference to `cusparseSetMatIndexBase'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x285): undefined reference to `cusparseCreateMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x2be): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x2d9): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x2f4): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x30f): undefined reference to `cusparseDestroy'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x33e): undefined reference to `cusparseSetMatType'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text+0x352): undefined reference to `cusparseSetMatIndexBase'
/tmp/tmpxft_0000cca5_00000000-17_spmm.o: In function `float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)':
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x37f): undefined reference to `cusparseXcsrgemmNnz'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x3b8): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x3d3): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x3ee): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x409): undefined reference to `cusparseDestroy'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x597): undefined reference to `cusparseScsrgemm'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x5d0): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x5eb): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x606): undefined reference to `cusparseDestroyMatDescr'
tmpxft_0000cca5_00000000-4_spmm.cudafe1.cpp:(.text._Z13time_cusparseIN4cusp10csr_matrixIifNS0_6system4cuda6detail5par_tEEENS1_IifNS2_3cpp6detail5par_tEEEEfRKT0_SD_[float time_cusparse<cusp::csr_matrix<int, float, cusp::system::cuda::detail::par_t>, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> >(cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&, cusp::csr_matrix<int, float, cusp::system::cpp::detail::par_t> const&)]+0x621): undefined reference to `cusparseDestroy'
collect2: ld returned 1 exit status

what's wrong with it? how can I fix it?

Steven Dalton

unread,
Jun 27, 2016, 3:10:14 PM6/27/16
to cusp-...@googlegroups.com
Hello,

  This error means the libcusparse.so library was not added correctly to the compile command. Try something like:
nvcc  spmm.cu -o spmm -I ../../ -L /usr/local/cuda/lib64 -lcusparse

Steve



--
You received this message because you are subscribed to the Google Groups "cusp-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cusp-users+...@googlegroups.com.
To post to this group, send email to cusp-...@googlegroups.com.
Visit this group at https://groups.google.com/group/cusp-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages