From 88ea98f217293804a0df0ea8410c3e3363194ec6 Mon Sep 17 00:00:00 2001 From: Kazem Date: Sat, 4 Dec 2021 15:20:53 -0500 Subject: [PATCH] build issue --- CMakeLists.txt | 17 ++++++++++------- README.md | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 035685c..7439f2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,13 +42,6 @@ set(LBC_INC "${CMAKE_CURRENT_SOURCE_DIR}/include") set(LBC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src") AUX_SOURCE_DIRECTORY(${LBC_SRC} LBC_SRC_FILES) - -include(metis) -if(METIS_FOUND) - add_definitions(-DMETIS) - set(METIS_SOURCE_FILES "${SPARSE_UTIL_SRC}/metis_interface.cpp") -endif() - find_package(OpenMP) if(OpenMP_FOUND) if(APPLE) #TODO: there might be a better support @@ -57,10 +50,20 @@ if(OpenMP_FOUND) include_directories( ${OpenMP_CXX_INCLUDE_DIRS} ) + link_libraries( + OpenMP::OpenMP_CXX + ) add_definitions(-DENABLE_OPENMP) add_definitions(-D__OPENMP__) endif() +include(metis) +if(METIS_FOUND) + add_definitions(-DMETIS) + set(METIS_SOURCE_FILES "${SPARSE_UTIL_SRC}/metis_interface.cpp") +endif() + + file(GLOB_RECURSE EXT_SRC ${CMAKE_CURRENT_SOURCE_DIR}/utils/external/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/utils/external/*.c) add_library(sym_amd STATIC diff --git a/README.md b/README.md index fbd8876..3dffa94 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ It can be used within code generators or libraries. For more information see ### Prerequisites * CMake * C++ compiler (GCC, ICC, or CLang) -* METIS (optional) dependency for running the demo efficiently -and is handled by the cmake. +* METIS and OpenMP (optional) dependency for running the demo efficiently +and are handled by the cmake. ### Linux Then install LBC by following commands: