Skip to content

Commit

Permalink
This commit adds a Github actions workflow to continuously test that
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daxpryce authored and harsha-simhadri committed Feb 25, 2022
1 parent d6dc5db commit e3a29ac
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down Expand Up @@ -356,3 +355,5 @@ MigrationBackup/
/.vs
/out/build/x64-Debug
cscope*

build/
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,33 @@ 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")
set(MKL_ROOT ${INTEL_ROOT}/mkl)
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)
Expand Down

0 comments on commit e3a29ac

Please sign in to comment.