Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Error while building the code #266

Closed
xXSnehalXx opened this issue Feb 16, 2022 · 2 comments
Closed

CMake Error while building the code #266

xXSnehalXx opened this issue Feb 16, 2022 · 2 comments

Comments

@xXSnehalXx
Copy link

Please assist

Hardware & Śoftware

  1. building the code on a google Colab notebook
  2. installed cmake-3.14.4-Linux-x86_64
  3. boost 1.67
  4. swig 3.0

Used the below code


!set GIT_LFS_SKIP_SMUDGE=1
!git clone https://github.com/microsoft/SPTAG

!sudo apt-get install swig
!pip install cmake==3.14.4

!wget "https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.tar.gz" -q -O - \
        | tar -xz --strip-components=1 -C /usr/local

!wget "https://netix.dl.sourceforge.net/project/boost/boost/1.67.0/boost_1_67_0.tar.gz" -q -O - \
        | tar -xz && \
        cd boost_1_67_0 && \
        ./bootstrap.sh && \
        ./b2 install && \
        ldconfig && \
        cd .. && rm -rf boost_1_67_0

%cd /content/SPTAG-2
!mkdir build && cd build && cmake .. && make && cd ..

Below are the things recognised immediately after calling the above

/content/SPTAG
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: Release
-- Platform type: x64
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found openmp.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   system
--   thread
--   serialization
--   wserialization
--   regex
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found Boost.
-- Include Path: /usr/local/include
-- Library Path: /usr/local/lib
-- Library: /usr/local/lib/libboost_system.so;/usr/local/lib/libboost_thread.so;/usr/local/lib/libboost_serialization.so;/usr/local/lib/libboost_wserialization.so;/usr/local/lib/libboost_regex.so;/usr/local/lib/libboost_filesystem.so;/usr/local/lib/libboost_chrono.so;/usr/local/lib/libboost_date_time.so;/usr/local/lib/libboost_atomic.so
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found MPI.
-- MPI Include Path: /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include;/usr/lib/x86_64-linux-gnu/openmpi/include
-- MPI Libraries: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so
-- BOOST_TEST_DYN_LINK
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   system
--   thread
--   serialization
--   wserialization
--   regex
--   filesystem
--   unit_test_framework
--   chrono
--   date_time
--   atomic
-- Found Boost.
-- Include Path: /usr/local/include
-- Library Path: /usr/local/lib
-- Library: /usr/local/lib/libboost_system.so;/usr/local/lib/libboost_thread.so;/usr/local/lib/libboost_serialization.so;/usr/local/lib/libboost_wserialization.so;/usr/local/lib/libboost_regex.so;/usr/local/lib/libboost_filesystem.so;/usr/local/lib/libboost_unit_test_framework.so;/usr/local/lib/libboost_chrono.so;/usr/local/lib/libboost_date_time.so;/usr/local/lib/libboost_atomic.so
-- Found CUDA: /usr/local/cuda (found version "11.1") 
-- Found cuda.
-- Include Path:/usr/local/cuda/include
-- Library Path:/usr/local/cuda/lib64/libcudart_static.adl/usr/lib/x86_64-linux-gnu/librt.so
-- CUDA_NVCC_FLAGS: -Xcompiler -fPIC -Xcompiler -fopenmp -std=c++14 -Xptxas -O3 --use_fast_math --disable-warnings
        -gencode arch=compute_70,code=sm_70
        -gencode arch=compute_61,code=sm_61
        -gencode arch=compute_60,code=sm_60
-- Found Python2: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so (found version "2.7.17") found components:  Development 
-- Found cuda.
-- Found Python3: /usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.so (found version "3.7.12") found components:  Development 
-- Found Python.
-- Include Path: /usr/include/python3.7m
-- Library Path: /usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.so
-- Could NOT find JNI (missing: JAVA_AWT_INCLUDE_PATH) 
-- Could not find JNI.
-- Could not find C#.
-- Configuring done
-- Generating done
-- Build files have been written to: /content/SPTAG/build

It then begins building
It usually build until 100% but this time stops at 92%

Below is the error log

Scanning dependencies of target gpussdserving
[ 92%] Building CXX object GPUSupport/CMakeFiles/gpussdserving.dir/__/AnnService/src/SSDServing/main.cpp.o
In file included from /content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:29:0,
                 from /content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h:183,
                 from /content/SPTAG/AnnService/inc/Core/SPANN/Index.h:13,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:8:
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:42:22: error: ‘__host__’ does not name a type; did you mean ‘CUhostFn’?
 template<typename T> __host__ __device__ T INFTY() {}
                      ^~~~~~~~
                      CUhostFn
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:43:12: error: ‘__forceinline__’ does not name a type
 template<> __forceinline__ __host__ __device__ int INFTY<int>() {return INT_MAX;}
            ^~~~~~~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:44:12: error: ‘__forceinline__’ does not name a type
 template<> __forceinline__ __host__ __device__ long long int INFTY<long long int>() {return LLONG_MAX;}
            ^~~~~~~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:45:12: error: ‘__forceinline__’ does not name a type
 template<> __forceinline__ __host__ __device__ float INFTY<float>() {return FLT_MAX;}
            ^~~~~~~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:47:12: error: ‘__forceinline__’ does not name a type
 template<> __forceinline__ __host__ __device__ uint8_t INFTY<uint8_t>() {return 255;}
            ^~~~~~~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:60:3: error: ‘__host__’ does not name a type; did you mean ‘CUhostFn’?
   __host__ void load(vector<T> data) {
   ^~~~~~~~
   CUhostFn
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:66:3: error: ‘__host__’ does not name a type; did you mean ‘CUhostFn’?
   __host__ __device__ void loadChunk(T* data, int exact_dim) {
   ^~~~~~~~
   CUhostFn
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:75:3: error: ‘__host__’ does not name a type; did you mean ‘CUhostFn’?
   __host__ __device__ Point& operator=( const Point& other ) {
   ^~~~~~~~
   CUhostFn
/content/SPTAG/AnnService/inc/Core/Common/cuda/Distance.hxx:84:3: error: ‘__device__’ does not name a type; did you mean ‘CUdevice’?
   __device__ __host__ SUMTYPE l2(Point<T,SUMTYPE,Dim>* other) {
   ^~~~~~~~~~
   CUdevice

.
.
.           [SAme error repeats for a while]
 .
.
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:210:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_weightedCounts));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: error: ‘cudaSuccess’ was not declared in this scope
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:210:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_weightedCounts));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: note: suggested alternative: ‘euidaccess’
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:210:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_weightedCounts));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:43:5: error: ‘cudaError_t’ was not declared in this scope
     cudaError_t rt = (func);                                                   \
     ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:211:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_newCenters));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:43:5: note: suggested alternative: ‘cudaError_enum’
     cudaError_t rt = (func);                                                   \
     ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:211:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_newCenters));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:9: error: ‘rt’ was not declared in this scope
     if (rt != cudaSuccess) {                                                   \
         ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:211:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_newCenters));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: error: ‘cudaSuccess’ was not declared in this scope
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:211:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_newCenters));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: note: suggested alternative: ‘euidaccess’
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:211:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_newCenters));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:43:5: error: ‘cudaError_t’ was not declared in this scope
     cudaError_t rt = (func);                                                   \
     ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:212:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_currDist));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:43:5: note: suggested alternative: ‘cudaError_enum’
     cudaError_t rt = (func);                                                   \
     ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:212:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_currDist));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:9: error: ‘rt’ was not declared in this scope
     if (rt != cudaSuccess) {                                                   \
         ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:212:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_currDist));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: error: ‘cudaSuccess’ was not declared in this scope
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:212:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_currDist));
     ^~~~~~~~~~
/content/SPTAG/AnnService/inc/Core/Common/cuda/params.h:44:15: note: suggested alternative: ‘euidaccess’
     if (rt != cudaSuccess) {                                                   \
               ^
/content/SPTAG/AnnService/inc/Core/Common/cuda/Kmeans.hxx:212:5: note: in expansion of macro ‘CUDA_CHECK’
     CUDA_CHECK(cudaFree(d_currDist));
     ^~~~~~~~~~
In file included from /content/SPTAG/AnnService/inc/Core/SPANN/Index.h:13:0,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:8:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h: In function ‘float SPTAG::COMMON::KmeansAssign(const SPTAG::COMMON::Dataset<T>&, std::vector<int>&, SPTAG::SizeType, SPTAG::SizeType, SPTAG::COMMON::KmeansArgs<T>&, bool, float)’:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h:197:9: warning: no return statement in function returning non-void [-Wreturn-type]
         }
         ^
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h: In function ‘float SPTAG::COMMON::InitCenters(const SPTAG::COMMON::Dataset<T>&, std::vector<int>&, SPTAG::SizeType, SPTAG::SizeType, SPTAG::COMMON::KmeansArgs<T>&, int, int)’:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h:292:58: error: call of overloaded ‘min(int, const SizeType&)’ is ambiguous
             SizeType batchEnd = min(first + samples, last);
                                                          ^
In file included from /content/SPTAG/AnnService/src/SSDServing/main.cpp:6:0:
/content/SPTAG/AnnService/inc/Core/Common.h:44:10: note: candidate: T min(T, T) [with T = int]
 inline T min(T a, T b) {
          ^~~
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:4:
/usr/include/c++/7/bits/stl_algobase.h:195:5: note: candidate: constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]
     min(const _Tp& __a, const _Tp& __b)
     ^~~
In file included from /content/SPTAG/AnnService/inc/Core/SPANN/Index.h:13:0,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:8:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h: In function ‘float SPTAG::COMMON::TryClustering(const SPTAG::COMMON::Dataset<T>&, std::vector<int>&, SPTAG::SizeType, SPTAG::SizeType, SPTAG::COMMON::KmeansArgs<T>&, int, float, bool, SPTAG::IAbortOperation*)’:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h:321:58: error: call of overloaded ‘min(int, const SizeType&)’ is ambiguous
             SizeType batchEnd = min(first + samples, last);
                                                          ^
In file included from /content/SPTAG/AnnService/src/SSDServing/main.cpp:6:0:
/content/SPTAG/AnnService/inc/Core/Common.h:44:10: note: candidate: T min(T, T) [with T = int]
 inline T min(T a, T b) {
          ^~~
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:4:
/usr/include/c++/7/bits/stl_algobase.h:195:5: note: candidate: constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]
     min(const _Tp& __a, const _Tp& __b)
     ^~~
In file included from /content/SPTAG/AnnService/inc/Core/SPANN/Index.h:13:0,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:8:
/content/SPTAG/AnnService/inc/Core/SPANN/../Common/BKTree.h:332:119: error: call of overloaded ‘min(float&, float&)’ is ambiguous
                 currDist = KmeansAssign(data, indices, first, batchEnd, args, true, min(adjustedLambda, originalLambda));
                                                                                                                       ^
In file included from /content/SPTAG/AnnService/src/SSDServing/main.cpp:6:0:
/content/SPTAG/AnnService/inc/Core/Common.h:44:10: note: candidate: T min(T, T) [with T = float]
 inline T min(T a, T b) {
          ^~~
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /content/SPTAG/AnnService/src/SSDServing/main.cpp:4:
/usr/include/c++/7/bits/stl_algobase.h:195:5: note: candidate: constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = float]
     min(const _Tp& __a, const _Tp& __b)
     ^~~
GPUSupport/CMakeFiles/gpussdserving.dir/build.make:62: recipe for target 'GPUSupport/CMakeFiles/gpussdserving.dir/__/AnnService/src/SSDServing/main.cpp.o' failed
make[2]: *** [GPUSupport/CMakeFiles/gpussdserving.dir/__/AnnService/src/SSDServing/main.cpp.o] Error 1
CMakeFiles/Makefile2:720: recipe for target 'GPUSupport/CMakeFiles/gpussdserving.dir/all' failed
make[1]: *** [GPUSupport/CMakeFiles/gpussdserving.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@xXSnehalXx
Copy link
Author

Solved this by uninstalling cuda from Google Colab notebook

@phgn0
Copy link
Contributor

phgn0 commented Jul 27, 2022

Thank you for posting your solution, this helped!

In my case I had to uninstall nvidia-cuda-toolkit which seems to avoid building the broken code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants