parmetis: avoid hardcoding -lm; use same approach as in METIS
This commit is contained in:
parent
0d4d201b70
commit
03c8a91f6a
@ -1,5 +1,5 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index ca945dd..5995e42 100644
|
index ca945dd..aff8b5f 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -23,7 +23,7 @@ else()
|
@@ -23,7 +23,7 @@ else()
|
||||||
@ -16,10 +16,26 @@ index ca945dd..5995e42 100644
|
|||||||
|
|
||||||
# List of directories that cmake will look for CMakeLists.txt
|
# List of directories that cmake will look for CMakeLists.txt
|
||||||
-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
|
-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
|
||||||
+# add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
|
+find_library(METIS_LIBRARY metis PATHS ${METIS_PATH}/lib)
|
||||||
add_subdirectory(include)
|
add_subdirectory(include)
|
||||||
add_subdirectory(libparmetis)
|
add_subdirectory(libparmetis)
|
||||||
add_subdirectory(programs)
|
add_subdirectory(programs)
|
||||||
|
diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt
|
||||||
|
index 9cfc8a7..e0c4de7 100644
|
||||||
|
--- a/libparmetis/CMakeLists.txt
|
||||||
|
+++ b/libparmetis/CMakeLists.txt
|
||||||
|
@@ -5,7 +5,10 @@ file(GLOB parmetis_sources *.c)
|
||||||
|
# Create libparmetis
|
||||||
|
add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
|
||||||
|
# Link with metis and MPI libraries.
|
||||||
|
-target_link_libraries(parmetis metis ${MPI_LIBRARIES})
|
||||||
|
+target_link_libraries(parmetis ${METIS_LIBRARY} ${MPI_LIBRARIES})
|
||||||
|
+if(UNIX)
|
||||||
|
+ target_link_libraries(parmetis m)
|
||||||
|
+endif()
|
||||||
|
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
|
||||||
|
|
||||||
|
install(TARGETS parmetis
|
||||||
diff --git a/libparmetis/parmetislib.h b/libparmetis/parmetislib.h
|
diff --git a/libparmetis/parmetislib.h b/libparmetis/parmetislib.h
|
||||||
index c1daeeb..07511f6 100644
|
index c1daeeb..07511f6 100644
|
||||||
--- a/libparmetis/parmetislib.h
|
--- a/libparmetis/parmetislib.h
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt
|
|
||||||
index 9cfc8a7..dfc0125 100644
|
|
||||||
--- a/libparmetis/CMakeLists.txt
|
|
||||||
+++ b/libparmetis/CMakeLists.txt
|
|
||||||
@@ -5,7 +5,7 @@ file(GLOB parmetis_sources *.c)
|
|
||||||
# Create libparmetis
|
|
||||||
add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
|
|
||||||
# Link with metis and MPI libraries.
|
|
||||||
-target_link_libraries(parmetis metis ${MPI_LIBRARIES})
|
|
||||||
+target_link_libraries(parmetis metis ${MPI_LIBRARIES} "-lm")
|
|
||||||
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
|
|
||||||
|
|
||||||
install(TARGETS parmetis
|
|
||||||
|
|
@ -52,8 +52,6 @@ class Parmetis(Package):
|
|||||||
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/
|
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/
|
||||||
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
|
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
|
||||||
|
|
||||||
patch('link-to-lm.patch')
|
|
||||||
|
|
||||||
depends_on('gdb', when='+gdb')
|
depends_on('gdb', when='+gdb')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
Loading…
Reference in New Issue
Block a user