Skip to content

Commit e07c5f3

Browse files
committed
Check that normaliz binary runs (cmake)
Workaround for when the normaliz binary is broken (e.g., right now, the brew package is broken because of the nauty 2.9.0 -> 2.9.1 transition). If we can't find it, then we'll just build it ourselves.
1 parent 43ca7a5 commit e07c5f3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

M2/cmake/FindNormaliz.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ if(NOT NORMALIZ_FOUND)
7171
# find the Normaliz executable
7272
find_program(NORMALIZ_EXECUTABLE NAMES normaliz)
7373

74+
# ensure that it runs
75+
if(NORMALIZ_EXECUTABLE)
76+
execute_process(
77+
COMMAND ${NORMALIZ_EXECUTABLE} --version
78+
RESULT_VARIABLE NORMALIZ_RESULT
79+
OUTPUT_QUIET ERROR_QUIET)
80+
if(NOT NORMALIZ_RESULT EQUAL "0")
81+
unset(NORMALIZ_EXECUTABLE CACHE)
82+
endif()
83+
endif()
84+
7485
if(NOT NORMALIZ_INCLUDE_DIR)
7586
find_path(NORMALIZ_INCLUDE_DIR NAMES libnormaliz/version.h
7687
HINTS ENV NORMALIZDIR

0 commit comments

Comments
 (0)