Fix build with USE_NUMA=ON

This commit is contained in:
Matthias Hochsteger 2020-03-25 10:40:12 +01:00
parent b1d65912ec
commit a52ccd7ce5
4 changed files with 15 additions and 0 deletions

View File

@ -18,6 +18,7 @@ option( USE_OCC "(not supported) compile with OpenCascade geometry kernel" O
option( USE_JPEG "enable snapshots using library libjpeg" OFF ) option( USE_JPEG "enable snapshots using library libjpeg" OFF )
option( USE_MPEG "enable video recording with FFmpeg, uses libavcodec" OFF ) option( USE_MPEG "enable video recording with FFmpeg, uses libavcodec" OFF )
option( USE_CGNS "enable CGNS file read/write support" OFF ) option( USE_CGNS "enable CGNS file read/write support" OFF )
option( USE_NUMA "compile with NUMA-aware code")
option( INTEL_MIC "cross compile for intel xeon phi") option( INTEL_MIC "cross compile for intel xeon phi")
option( INSTALL_PROFILES "install environment variable settings to /etc/profile.d" OFF ) option( INSTALL_PROFILES "install environment variable settings to /etc/profile.d" OFF )
option( USE_CCACHE "use ccache") option( USE_CCACHE "use ccache")

View File

@ -27,6 +27,7 @@ set(NETGEN_METIS_LIBRARY "@METIS_LIBRARY@")
set(NETGEN_MKL_LIBRARIES "@MKL_LIBRARIES@") set(NETGEN_MKL_LIBRARIES "@MKL_LIBRARIES@")
set(NETGEN_MPI_CXX_INCLUDE_PATH "@MPI_CXX_INCLUDE_PATH@") set(NETGEN_MPI_CXX_INCLUDE_PATH "@MPI_CXX_INCLUDE_PATH@")
set(NETGEN_MPI_CXX_LIBRARIES "@MPI_CXX_LIBRARIES@") set(NETGEN_MPI_CXX_LIBRARIES "@MPI_CXX_LIBRARIES@")
set(NETGEN_NUMA_LIBRARY "@NUMA_LIBRARY@")
set(NETGEN_OCC_INCLUDE_DIR "@OCC_INCLUDE_DIR@") set(NETGEN_OCC_INCLUDE_DIR "@OCC_INCLUDE_DIR@")
set(NETGEN_OCC_LIBRARIES_BIN "@OCC_LIBRARIES_BIN@") set(NETGEN_OCC_LIBRARIES_BIN "@OCC_LIBRARIES_BIN@")
set(NETGEN_OCC_LIBRARIES "@OCC_LIBRARIES@") set(NETGEN_OCC_LIBRARIES "@OCC_LIBRARIES@")
@ -56,6 +57,7 @@ set(NETGEN_INTEL_MIC @INTEL_MIC@)
set(NETGEN_INSTALL_PROFILES @INSTALL_PROFILES@) set(NETGEN_INSTALL_PROFILES @INSTALL_PROFILES@)
set(NETGEN_USE_CCACHE @USE_CCACHE@) set(NETGEN_USE_CCACHE @USE_CCACHE@)
set(NETGEN_USE_NATIVE_ARCH @USE_NATIVE_ARCH@) set(NETGEN_USE_NATIVE_ARCH @USE_NATIVE_ARCH@)
set(NETGEN_USE_NUMA @USE_NUMA@)
set(NETGEN_PYTHON_RPATH "@NETGEN_PYTHON_RPATH@") set(NETGEN_PYTHON_RPATH "@NETGEN_PYTHON_RPATH@")
set(NETGEN_RPATH_TOKEN "@NG_RPATH_TOKEN@") set(NETGEN_RPATH_TOKEN "@NG_RPATH_TOKEN@")

View File

@ -51,6 +51,12 @@ if(USE_SPDLOG)
endif(DEBUG_LOG) endif(DEBUG_LOG)
endif(USE_SPDLOG) endif(USE_SPDLOG)
if(USE_NUMA)
find_library(NUMA_LIBRARY libnuma.so)
target_compile_definitions(ngcore PUBLIC USE_NUMA)
target_link_libraries(ngcore PRIVATE ${NUMA_LIBRARY})
endif(USE_NUMA)
install(TARGETS ngcore DESTINATION ${NG_INSTALL_DIR} COMPONENT netgen) install(TARGETS ngcore DESTINATION ${NG_INSTALL_DIR} COMPONENT netgen)
target_link_libraries(ngcore PUBLIC netgen_mpi PRIVATE netgen_python ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(ngcore PUBLIC netgen_mpi PRIVATE netgen_python ${CMAKE_THREAD_LIBS_INIT})

View File

@ -17,6 +17,12 @@
#include "paje_trace.hpp" #include "paje_trace.hpp"
#include "profiler.hpp" #include "profiler.hpp"
#ifdef USE_NUMA
#include <numa.h>
#include <sched.h>
#endif
namespace ngcore namespace ngcore
{ {
using std::atomic; using std::atomic;