Merge pull request #630 from davydden/metis_parmetis
Metis parmetis cleanup
This commit is contained in:
commit
680563cc4c
5 changed files with 95 additions and 22 deletions
|
@ -0,0 +1,22 @@
|
|||
# HG changeset patch
|
||||
# User Sean Farley <sean@mcs.anl.gov>
|
||||
# Date 1332269671 18000
|
||||
# Tue Mar 20 13:54:31 2012 -0500
|
||||
# Node ID b95c0c2e1d8bf8e3273f7d45e856f0c0127d998e
|
||||
# Parent 88049269953c67c3fdcc4309bf901508a875f0dc
|
||||
cmake: add gklib headers to install into include
|
||||
|
||||
diff -r 88049269953c -r b95c0c2e1d8b libmetis/CMakeLists.txt
|
||||
Index: libmetis/CMakeLists.txt
|
||||
===================================================================
|
||||
--- a/libmetis/CMakeLists.txt Tue Mar 20 13:54:29 2012 -0500
|
||||
+++ b/libmetis/CMakeLists.txt Tue Mar 20 13:54:31 2012 -0500
|
||||
@@ -12,6 +12,8 @@ endif()
|
||||
if(METIS_INSTALL)
|
||||
install(TARGETS metis
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
+ install(FILES gklib_defs.h DESTINATION include)
|
||||
+ install(FILES gklib_rename.h DESTINATION include)
|
||||
endif()
|
|
@ -24,7 +24,7 @@
|
|||
##############################################################################
|
||||
|
||||
from spack import *
|
||||
|
||||
import glob
|
||||
|
||||
class Metis(Package):
|
||||
"""
|
||||
|
@ -49,6 +49,8 @@ class Metis(Package):
|
|||
|
||||
depends_on('gdb', when='+gdb')
|
||||
|
||||
patch('install_gklib_defs_rename.patch')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
||||
options = []
|
||||
|
@ -81,3 +83,10 @@ def install(self, spec, prefix):
|
|||
cmake(source_directory, *options)
|
||||
make()
|
||||
make("install")
|
||||
|
||||
# install GKlib headers, which will be needed for ParMETIS
|
||||
GKlib_dist = join_path(prefix.include,'GKlib')
|
||||
mkdirp(GKlib_dist)
|
||||
fs = glob.glob(join_path(source_directory,'GKlib',"*.h"))
|
||||
for f in fs:
|
||||
install(f, GKlib_dist)
|
||||
|
|
|
@ -1,13 +1,71 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ca945dd..1bf94e9 100644
|
||||
index ca945dd..aff8b5f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -23,7 +23,7 @@ else()
|
||||
set(ParMETIS_LIBRARY_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
-include(${GKLIB_PATH}/GKlibSystem.cmake)
|
||||
+include_directories(${GKLIB_PATH})
|
||||
|
||||
# List of paths that the compiler will search for header files.
|
||||
# i.e., the -I equivalent
|
||||
@@ -33,7 +33,7 @@ include_directories(${GKLIB_PATH})
|
||||
include_directories(${METIS_PATH}/include)
|
||||
|
||||
# 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)
|
||||
+find_library(METIS_LIBRARY metis PATHS ${METIS_PATH}/lib)
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(libparmetis)
|
||||
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
|
||||
index c1daeeb..07511f6 100644
|
||||
--- a/libparmetis/parmetislib.h
|
||||
+++ b/libparmetis/parmetislib.h
|
||||
@@ -20,13 +20,12 @@
|
||||
|
||||
#include <parmetis.h>
|
||||
|
||||
-#include "../metis/libmetis/gklib_defs.h"
|
||||
+#include <gklib_defs.h>
|
||||
|
||||
-#include <mpi.h>
|
||||
+#include <mpi.h>
|
||||
|
||||
#include <rename.h>
|
||||
#include <defs.h>
|
||||
#include <struct.h>
|
||||
#include <macros.h>
|
||||
#include <proto.h>
|
||||
-
|
||||
diff --git a/programs/parmetisbin.h b/programs/parmetisbin.h
|
||||
index e26cd2d..d156480 100644
|
||||
--- a/programs/parmetisbin.h
|
||||
+++ b/programs/parmetisbin.h
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <GKlib.h>
|
||||
#include <parmetis.h>
|
||||
|
||||
-#include "../metis/libmetis/gklib_defs.h"
|
||||
+#include <gklib_defs.h>
|
||||
#include "../libparmetis/rename.h"
|
||||
#include "../libparmetis/defs.h"
|
||||
#include "../libparmetis/struct.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/
|
||||
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
|
||||
|
||||
patch('link-to-lm.patch')
|
||||
|
||||
depends_on('gdb', when='+gdb')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
@ -66,7 +64,7 @@ def install(self, spec, prefix):
|
|||
|
||||
# FIXME : Once a contract is defined, MPI compilers should be retrieved indirectly via spec['mpi'] in case
|
||||
# FIXME : they use a non-standard name
|
||||
options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=metis_source), # still need headers from METIS source, and they are not installed with METIS. shame...
|
||||
options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=spec['metis'].prefix.include),
|
||||
'-DMETIS_PATH:PATH={metis_source}'.format(metis_source=spec['metis'].prefix),
|
||||
'-DCMAKE_C_COMPILER:STRING=mpicc',
|
||||
'-DCMAKE_CXX_COMPILER:STRING=mpicxx'])
|
||||
|
|
Loading…
Reference in a new issue