Skip to content

Commit

Permalink
fix building metis on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaCabiddu committed Nov 30, 2024
1 parent d0f79a7 commit b1f2a70
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,22 @@ if (USE_METIS)
set (METIS_LIB ${METIS_INSTALL}/lib/libmetis.so)
set (GKLIB_LIB ${GKLIB_INSTALL}/lib/libGKlib.a)

set (CC gcc)

elseif(APPLE)
set (METIS_LIB ${METIS_INSTALL}/lib/libMETIS.a)

set (METIS_LIB ${METIS_INSTALL}/lib/libmetis.dylib)
set (GKLIB_LIB ${GKLIB_INSTALL}/lib/libGKlib.a)

endif()

set (CC ${CMAKE_C_COMPILER})
message(${CC})

add_custom_command(
OUTPUT ${METIS_LIB}
COMMAND unset MFLAGS && unset MAKEFLAGS && unset MAKELEVEL && cd ${GKLIB_DIR} && make config prefix=${GKLIB_INSTALL} && make && make install &&
cd ${METIS_DIR} && make config shared=1 prefix=${METIS_INSTALL} gklib_path=${GKLIB_INSTALL} i64=1 r64=1 VERBOSE=1 && make install
cd ${METIS_DIR} && make config shared=1 cc=${CC} prefix=${METIS_INSTALL} gklib_path=${GKLIB_INSTALL} i64=1 r64=1 VERBOSE=1 && make install
WORKING_DIRECTORY ${METIS_DIR}
)

Expand Down

0 comments on commit b1f2a70

Please sign in to comment.