cd build
rm hc_* -f
export CPLUS_INCLUDE_PATH=${ROCM_PATH}/include:${ROCM_PATH}:/opencl/include
export CPLUS_INCLUDE_PATH=${ROCM_PATH}/hiprand/include/:${ROCM_PATH}/rocrand/include:$CPLUS_INCLUDE_PATH
export LD_LIBRARY_PATH=${ROCM_PATH}/hipblas/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${ROCM_PATH}/llvm/lib:$LD_LIBRARY_PATH

CXX=hipcc CC=hipcc  cmake -DFAISS_ENABLE_GPU=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MODULE_PATH="${ROCM_PATH}/hip/cmake/" -DMKL_LIBRARIES=/public/software/compiler/intel-compiler-2017.5.239/mkl/lib/intel64_lin/ ..

make -j faiss VERBOSE=1 > hc_faiss.log 2>&1 
make -j swigfaiss VERBOSE=1 > hc_swigfaiss.log 2>&1 

export LD_LIBRARY_PATH=/public/home/huchen/faiss/faiss_hc/build/faiss/gpu/test/:/public/home/huchen/faiss/faiss_hc/build/faiss/:/public/home/huchen/faiss/faiss_hc/build/lib/:$LD_LIBRARY_PATH
make install VERBOSE=1 > hc_install.log 2>&1 
#make test VERBOSE=1 > hc_test.log 2>&1
cd -

./test_gpu.sh

