Skip to content

Commit

Permalink
Fix build with USE_NUMA=ON
Browse files Browse the repository at this point in the history
  • Loading branch information
mhochsteger committed Mar 25, 2020
1 parent b1d6591 commit a52ccd7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_MPEG "enable video recording with FFmpeg, uses libavcodec" 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( INSTALL_PROFILES "install environment variable settings to /etc/profile.d" OFF )
option( USE_CCACHE "use ccache")
Expand Down
2 changes: 2 additions & 0 deletions cmake/NetgenConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set(NETGEN_METIS_LIBRARY "@METIS_LIBRARY@")
set(NETGEN_MKL_LIBRARIES "@MKL_LIBRARIES@")
set(NETGEN_MPI_CXX_INCLUDE_PATH "@MPI_CXX_INCLUDE_PATH@")
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_LIBRARIES_BIN "@OCC_LIBRARIES_BIN@")
set(NETGEN_OCC_LIBRARIES "@OCC_LIBRARIES@")
Expand Down Expand Up @@ -56,6 +57,7 @@ set(NETGEN_INTEL_MIC @INTEL_MIC@)
set(NETGEN_INSTALL_PROFILES @INSTALL_PROFILES@)
set(NETGEN_USE_CCACHE @USE_CCACHE@)
set(NETGEN_USE_NATIVE_ARCH @USE_NATIVE_ARCH@)
set(NETGEN_USE_NUMA @USE_NUMA@)

set(NETGEN_PYTHON_RPATH "@NETGEN_PYTHON_RPATH@")
set(NETGEN_RPATH_TOKEN "@NG_RPATH_TOKEN@")
Expand Down
6 changes: 6 additions & 0 deletions libsrc/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ if(USE_SPDLOG)
endif(DEBUG_LOG)
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)

target_link_libraries(ngcore PUBLIC netgen_mpi PRIVATE netgen_python ${CMAKE_THREAD_LIBS_INIT})
Expand Down
6 changes: 6 additions & 0 deletions libsrc/core/taskmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#include "paje_trace.hpp"
#include "profiler.hpp"

#ifdef USE_NUMA
#include <numa.h>
#include <sched.h>
#endif


namespace ngcore
{
using std::atomic;
Expand Down

0 comments on commit a52ccd7

Please sign in to comment.