Repository: erikbern/ann-benchmarks
Issue: Docker build failed for opendistroknn and sptag
Root cause: External Dependency Breakage

The errors occur when building all images with `python install.py` command.
Opendistroknn build log:
```
Step 9/15 : RUN apt-get update     && apt install opendistroforelasticsearch=1.12.0-1 -y
 ---> Running in 0e6ae5ecc196
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:3 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu bionic InRelease
Get:4 https://d3g5vo6xdbdb9a.cloudfront.net/apt stable InRelease [10.8 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:7 https://d3g5vo6xdbdb9a.cloudfront.net/apt stable/main amd64 Packages [35.2 kB]
Fetched 298 kB in 1s (415 kB/s)
Reading package lists...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 opendistroforelasticsearch : Depends: opendistro-sql (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-sql (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-alerting (>= 1.12.0.2) but it is not going to be installed
                              Depends: opendistro-alerting (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-job-scheduler (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-job-scheduler (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-security (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-security (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-performance-analyzer (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-performance-analyzer (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-index-management (>= 1.12.0.1) but it is not going to be installed
                              Depends: opendistro-index-management (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-knn (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-knn (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-anomaly-detection (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-anomaly-detection (< 1.12.1.0) but it is not going to be installed
                              Depends: opendistro-reports-scheduler (>= 1.12.0.0) but it is not going to be installed
                              Depends: opendistro-reports-scheduler (< 1.12.1.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get update     && apt install opendistroforelasticsearch=1.12.0-1 -y' returned a non-zero code: 100
```

sptag build log:
```
Step 7/9 : RUN cd SPTAG && mkdir build && cd build && cmake .. && make && cd ..
 ---> Running in 64f5c142d706
-- 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
--   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_chrono.so;/usr/local/lib/libboost_date_time.so;/usr/local/lib/libboost_atomic.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
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
-- Could not find cuda.
-- Could NOT find Python2 (missing: Python2_LIBRARY Python2_INCLUDE_DIR Development)
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
-- Found Python3: /usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so (found version "3.6.9") found components:  Development
-- Found Python.
-- Include Path: /usr/include/python3.6m
-- Library Path: /usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- Could not find JNI.
-- Could not find C#.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/app/SPTAG/build
Scanning dependencies of target DistanceUtils
[  0%] Building CXX object AnnService/CMakeFiles/DistanceUtils.dir/src/Core/Common/DistanceUtils.cpp.o
[  1%] Building CXX object AnnService/CMakeFiles/DistanceUtils.dir/src/Core/Common/InstructionUtils.cpp.o
[  2%] Linking CXX static library ../../Release/libDistanceUtils.a
[  2%] Built target DistanceUtils
Scanning dependencies of target SPTAGLibStatic
[  3%] Building CXX object AnnService/CMakeFiles/SPTAGLibStatic.dir/src/Core/BKT/BKTIndex.cpp.o
[  4%] Building CXX object AnnService/CMakeFiles/SPTAGLibStatic.dir/src/Core/Common/NeighborhoodGraph.cpp.o
In file included from /home/app/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp:6:0:
/home/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h: In member function 'virtual void SPTAG::COMMON::RelativeNeighborhoodGraph::InsertNeighbors(SPTAG::VectorIndex*, SPTAG::SizeType, SPTAG::SizeType, float)':
/home/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);
                                                  ^~~~~~~~~~~
/home/app/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h:45:50: note: suggested alternative: '_WINT_T'
                 _mm_prefetch((const char*)nodes, _MM_HINT_T0);
                                                  ^~~~~~~~~~~
                                                  _WINT_T
/home/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);
                 ^~~~~~~~~~~~
/home/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
AnnService/CMakeFiles/SPTAGLibStatic.dir/build.make:75: recipe for target 'AnnService/CMakeFiles/SPTAGLibStatic.dir/src/Core/Common/NeighborhoodGraph.cpp.o' failed
make[2]: *** [AnnService/CMakeFiles/SPTAGLibStatic.dir/src/Core/Common/NeighborhoodGraph.cpp.o] Error 1
make[1]: *** [AnnService/CMakeFiles/SPTAGLibStatic.dir/all] Error 2
CMakeFiles/Makefile2:179: recipe for target 'AnnService/CMakeFiles/SPTAGLibStatic.dir/all' failed
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c cd SPTAG && mkdir build && cd build && cmake .. && make && cd ..' returned a non-zero code: 2
```

The errors occur when building SPTAG images, I found that they fixed this issue with PR https://github.com/microsoft/SPTAG/pull/188. you can fork your branch and apply this commit.

ok, i'll see if i can fix master