Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] define _POSIX_C_SOURCE for metis build only #7571

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,17 @@ else(EXTERNAL_METIS_PATH)
target_include_directories(dgl PRIVATE "third_party/METIS/include")
# Compile METIS
if(NOT MSVC)
# When building on ubi7, it fails with the following error:
# /usr/include/signal.h:156:29: error: unknown type name 'siginfo_t'.
# So I(Rui) added the following 2 lines to fix the issue.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=200809L")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_POSIX_C_SOURCE=200809L")

set(GKLIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/GKlib")
include(${GKLIB_PATH}/GKlibSystem.cmake)
include_directories(${GKLIB_PATH})
add_library(GKlib ${GKlib_sources})
include_directories("third_party/METIS/include/")
add_subdirectory("third_party/METIS/libmetis/")
# When building on ubi7, it fails with the following error:
# /usr/include/signal.h:156:29: error: unknown type name 'siginfo_t'.
# So I(Rui) define _POSIX_C_SOURCE to 200809L for GKlib and metis to avoid the error.
target_compile_definitions(GKlib PRIVATE _POSIX_C_SOURCE=200809L)
target_compile_definitions(metis PRIVATE _POSIX_C_SOURCE=200809L)
Rhett-Ying marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND DGL_LINKER_LIBS metis GKlib)
endif(NOT MSVC)
endif(EXTERNAL_METIS_PATH)
Expand Down
Loading