From e3a29acac734798f539db30296152ed30908c2c2 Mon Sep 17 00:00:00 2001 From: Dax Pryce Date: Fri, 25 Feb 2022 02:55:50 +0000 Subject: [PATCH] This commit adds a Github actions workflow to continuously test that building is successful on Ubuntu 20.04 and Ubuntu 18.04 on every push. Changes made to CMakeList.txt now support Intel MKL's header file location installation from apt (on Ubuntu 20.04 and, presumably, later versions), as well as manual installs using today's current Intel MKL download and installation through their installer. However, today's Intel MKL library may not be what you want, and it may be that the path will change if we use an older version of the library, but I didn't want to dig that up while I was working on this. --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ .gitignore | 3 ++- CMakeLists.txt | 21 ++++++++++++++------- 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..d311d016c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: DiskANN Build +on: + push: +jobs: + build-ubuntu-latest: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - run: | + sudo apt install cmake g++ libaio-dev libgoogle-perftools-dev clang-format-12 libboost-dev libmkl-full-dev + mkdir build && cd build && cmake .. && make -j + build-ubuntu-18: + runs-on: 'ubuntu-18.04' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - run: | + sudo apt install cmake g++ libaio-dev libgoogle-perftools-dev clang-format-4.0 libboost-dev + wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18487/l_BaseKit_p_2022.1.2.146.sh + sudo sh l_BaseKit_p_2022.1.2.146.sh -a --components intel.oneapi.lin.mkl.devel --action install --install-dir /opt/intel/compilers_and_libraries --eula accept -s + ls -R /opt/intel + mkdir build && cd build && cmake .. && make -j + diff --git a/.gitignore b/.gitignore index 2bfdb8025..f19925a60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -<<<<<<< HEAD ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## @@ -356,3 +355,5 @@ MigrationBackup/ /.vs /out/build/x64-Debug cscope* + +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd3886f5..f2bd34cf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ function(checkEnvAndSetLocalVar env_var msg local_var) endfunction() - +include_directories(include) #MKL Config if (MSVC) checkEnvAndSetLocalVar("INTEL_ROOT" "Please install Intel MKL libraries and set the env variable INTEL_ROOT to the intel software directory. Should be similar to: C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries\\windows\\. " "INTEL_ROOT") @@ -52,18 +52,25 @@ if (MSVC) add_compile_options(/arch:AVX2 /Qpar) link_libraries("${INTEL_ROOT}/mkl/lib/intel64/mkl_core_dll.lib" "${INTEL_ROOT}/mkl/lib/intel64/mkl_rt.lib" "${INTEL_ROOT}/mkl/lib/intel64/mkl_intel_thread_dll.lib" "${INTEL_ROOT}/compiler/lib/intel64/libiomp5md.lib" "${INTEL_ROOT}/mkl/lib/intel64/mkl_intel_ilp64_dll.lib" "${INTEL_ROOT}/mkl/lib/intel64/mkl_sequential_dll.lib") checkEnvAndSetLocalVar("BOOST_ROOT" "Please install Boost (1.71 or greater) from www.boost.org and set the env var BOOST_ROOT to the boost directory." "BOOST_ROOT") - + include_directories(${INTEL_ROOT}/include) + include_directories(${MKL_ROOT}/include) else() - set(INTEL_ROOT /opt/intel/compilers_and_libraries/linux) - set(MKL_ROOT ${INTEL_ROOT}/mkl) + # expected path for manual intel mkl installs + set(MKL_ROOT /opt/intel/compilers_and_libraries/mkl/latest CACHE PATH "Intel mkl libraries and includes root path") + link_directories(${MKL_ROOT}/lib/intel64) + include_directories(${MKL_ROOT}/include) + + # expected path for apt packaged intel mkl installs + link_directories(/usr/lib/x86_64-linux-gnu/mkl) + include_directories(/usr/include/mkl) + + # compile flags and link libraries add_compile_options(-m64 -Wl,--no-as-needed) link_libraries(mkl_intel_ilp64 mkl_intel_thread mkl_core iomp5 pthread m dl) - link_directories(${INTEL_ROOT}/lib/intel64 ${MKL_ROOT}/lib/intel64) endif() +include_directories(${BOOST_ROOT}) add_definitions(-DMKL_ILP64) -include_directories(include ${INTEL_ROOT}/include ${MKL_ROOT}/include ${BOOST_ROOT}) - #Main compiler/linker settings if(MSVC)