microsoft / microsoft/SPTAG

‘_MM_HINT_T0’ was not declared in this scope

Open
#185 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
5k
Forks
622
Avg merge
8h 37m
Merged PRs (30d)
5

Description

Describe the bug

I am building a docker image with Python and SPTAG

I am doing the following:

...

# build sptag
WORKDIR /app
RUN apt-get update && \
    apt-get -y install wget python3-dev python3-pip git swig libboost1.67 libboost1.67-dev

RUN wget https://cmake.org/files/v3.15/cmake-3.15.5.tar.gz && \
    tar zvxf cmake-3.15.5.tar.gz && \
    cd cmake-3.15.5 && \
    ./bootstrap && \
    make -j2 && \
    make install

RUN git clone https://github.com/microsoft/SPTAG.git
RUN cd SPTAG && \
    mkdir build && \
    cd build && \
    cmake .. && \
    grep -rl python2.7 CMakeCache.txt | xargs sed -i 's/python2.7/python3.7/g' && \
    make -j2 && \
    mv ../Release /app
...

This fails with this error:

In file included from /app/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp:6:
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h: In member function ‘virtual void SPTAG::COMMON::RelativeNeighborhoodGraph::InsertNeighbors(SPTAG::VectorIndex*, SPTAG::SizeType, SPTAG::SizeType, float)’:
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:50: error: ‘_MM_HINT_T0’ was not declared in this scope
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                                                  ^~~~~~~~~~~
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:50: note: suggested alternative: ‘_SC_UINT_MAX’
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                                                  ^~~~~~~~~~~
                                                  _SC_UINT_MAX
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:17: error: ‘_mm_prefetch’ was not declared in this scope
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                 ^~~~~~~~~~~~
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:17: note: suggested alternative: ‘_mm_free’
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                 ^~~~~~~~~~~~
                 _mm_free
make[2]: *** [AnnService/CMakeFiles/SPTAGLibStatic.dir/build.make:76: AnnService/CMakeFiles/SPTAGLibStatic.dir/src/Core/Common/NeighborhoodGraph.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:176: AnnService/CMakeFiles/SPTAGLibStatic.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  7%] Building CXX object AnnService/CMakeFiles/SPTAGLib.dir/src/Core/Common/WorkSpacePool.cpp.o
In file included from /app/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp:6:
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h: In member function ‘virtual void SPTAG::COMMON::RelativeNeighborhoodGraph::InsertNeighbors(SPTAG::VectorIndex*, SPTAG::SizeType, SPTAG::SizeType, float)’:
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:50: error: ‘_MM_HINT_T0’ was not declared in this scope
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                                                  ^~~~~~~~~~~
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:50: note: suggested alternative: ‘_SC_UINT_MAX’
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                                                  ^~~~~~~~~~~
                                                  _SC_UINT_MAX
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:17: error: ‘_mm_prefetch’ was not declared in this scope
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                 ^~~~~~~~~~~~
/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:17: note: suggested alternative: ‘_mm_free’
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                 ^~~~~~~~~~~~
                 _mm_free
make[2]: *** [AnnService/CMakeFiles/SPTAGLib.dir/build.make:76: AnnService/CMakeFiles/SPTAGLib.dir/src/Core/Common/NeighborhoodGraph.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:208: AnnService/CMakeFiles/SPTAGLib.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Searching by ‘_MM_HINT_T0’ was not declared in this scope lead me to https://stackoverflow.com/questions/40352891/error-mm-prefetch-was-not-declared-in-this-scope

Desktop (please complete the following information):

  • OS: Linux Ubuntu 20.04

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h at the _mm_prefetch call and reproduce the failure using the Docker build commands in the issue. Check how the C++ build exposes the declarations used there, then verify that the SPTAG CMake build completes successfully on the reported Ubuntu environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, docker
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.