Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xdmf
Xdmf
Commits
caf2954c
Commit
caf2954c
authored
Jun 06, 2014
by
Andrew J. Burns (Cont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving the auto detection for MPI4PY and HDF5
parent
09136d04
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
7 deletions
+63
-7
CMake/FindMPI4PY.cmake
CMake/FindMPI4PY.cmake
+34
-0
CMakeLists.txt
CMakeLists.txt
+7
-0
core/CMakeLists.txt
core/CMakeLists.txt
+22
-7
No files found.
CMake/FindMPI4PY.cmake
0 → 100644
View file @
caf2954c
# - FindMPI4PY
# Find mpi4py includes and library
# This module defines:
# MPI4PY_INCLUDE_DIR, where to find mpi4py.h, etc.
# MPI4PY_FOUND
# https://compacc.fnal.gov/projects/repositories/entry/synergia2/CMake/FindMPI4PY.cmake?rev=c147eafb60728606af4fe7b1b161a660df142e9a
if
(
NOT MPI4PY_INCLUDE_DIR
)
execute_process
(
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
"-c"
"import mpi4py; print mpi4py.get_include()"
OUTPUT_VARIABLE MPI4PY_INCLUDE_DIR
RESULT_VARIABLE MPI4PY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
MPI4PY_COMMAND_RESULT
)
message
(
"jfa: mpi4py not found"
)
set
(
MPI4PY_FOUND FALSE
)
else
(
MPI4PY_COMMAND_RESULT
)
if
(
MPI4PY_INCLUDE_DIR MATCHES
"Traceback"
)
message
(
"jfa: mpi4py matches traceback"
)
## Did not successfully include MPI4PY
set
(
MPI4PY_FOUND FALSE
)
else
(
MPI4PY_INCLUDE_DIR MATCHES
"Traceback"
)
## successful
set
(
MPI4PY_FOUND TRUE
)
set
(
MPI4PY_INCLUDE_DIR
${
MPI4PY_INCLUDE_DIR
}
CACHE STRING
"mpi4py include path"
)
endif
(
MPI4PY_INCLUDE_DIR MATCHES
"Traceback"
)
endif
(
MPI4PY_COMMAND_RESULT
)
else
(
NOT MPI4PY_INCLUDE_DIR
)
set
(
MPI4PY_FOUND TRUE
)
endif
(
NOT MPI4PY_INCLUDE_DIR
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
MPI4PY DEFAULT_MSG MPI4PY_INCLUDE_DIR
)
CMakeLists.txt
View file @
caf2954c
...
...
@@ -53,6 +53,13 @@ option(XDMF_WRAP_JAVA OFF)
option
(
XDMF_BUILD_DSM OFF
)
if
(
XDMF_BUILD_DSM
)
find_package
(
MPI REQUIRED
)
if
(
MPI_FOUND
)
include_directories
(
${
MPI_INCLUDE_PATH
}
)
set
(
XDMF_LIBRARIES
${
XDMF_LIBRARIES
}
${
MPI_LIBRARY
}
${
MPI_EXTRA_LIBRARY
}
)
get_filename_component
(
MPI_LIBRARY_DIR
${
MPI_LIBRARY
}
PATH
)
set
(
XDMF_LIBRARY_DIRS
${
XDMF_LIBRARY_DIRS
}
${
MPI_LIBRARY_DIR
}
)
endif
(
MPI_FOUND
)
option
(
XDMF_BUILD_DSM_THREADS ON
)
if
(
XDMF_WRAP_PYTHON
)
mark_as_advanced
(
FORCE PYTHON_INCLUDE_MPI4PY_DIR
)
...
...
core/CMakeLists.txt
View file @
caf2954c
...
...
@@ -35,6 +35,16 @@ if(Boost_FOUND)
mark_as_advanced
(
FORCE Boost_INCLUDE_DIR
)
endif
(
Boost_FOUND
)
# Find HDF5_ROOT if not set
if
(
"$ENV{HDF5_ROOT}"
STREQUAL
""
)
find_file
(
HDF5_LIB libhdf5.so HINTS ENV LD_LIBRARY_PATH
)
if
(
NOT
"
${
HDF5_LIB
}
"
STREQUAL
""
)
get_filename_component
(
HDF5_LIBRARY_DIR
"
${
HDF5_LIB
}
"
PATH
)
get_filename_component
(
HDF5_ROOT
"
${
HDF5_LIBRARY_DIR
}
/../"
ABSOLUTE
)
set
(
ENV{HDF5_ROOT}
${
HDF5_ROOT
}
)
endif
(
NOT
"
${
HDF5_LIB
}
"
STREQUAL
""
)
endif
(
"$ENV{HDF5_ROOT}"
STREQUAL
""
)
mark_as_advanced
(
CLEAR HDF5_C_INCLUDE_DIR
)
mark_as_advanced
(
CLEAR HDF5_hdf5_LIBRARY_DEBUG
)
mark_as_advanced
(
CLEAR HDF5_hdf5_LIBRARY_RELEASE
)
...
...
@@ -51,16 +61,21 @@ if(HDF5_FOUND)
# FIXME: Would like to get this info from HDF5 so we don't have conflicting
# MPI versions
if
(
HDF5_IS_PARALLEL
)
find_package
(
MPI REQUIRED
)
if
(
MPI_FOUND
)
include_directories
(
${
MPI_INCLUDE_PATH
}
)
set
(
XDMF_LIBRARIES
${
XDMF_LIBRARIES
}
${
MPI_LIBRARY
}
${
MPI_EXTRA_LIBRARY
}
)
get_filename_component
(
MPI_LIBRARY_DIR
${
MPI_LIBRARY
}
PATH
)
set
(
XDMF_LIBRARY_DIRS
${
XDMF_LIBRARY_DIRS
}
${
MPI_LIBRARY_DIR
}
)
endif
(
MPI_FOUND
)
if
(
NOT MPI_FOUND
)
find_package
(
MPI REQUIRED
)
if
(
MPI_FOUND
)
include_directories
(
${
MPI_INCLUDE_PATH
}
)
set
(
XDMF_LIBRARIES
${
XDMF_LIBRARIES
}
${
MPI_LIBRARY
}
${
MPI_EXTRA_LIBRARY
}
)
get_filename_component
(
MPI_LIBRARY_DIR
${
MPI_LIBRARY
}
PATH
)
set
(
XDMF_LIBRARY_DIRS
${
XDMF_LIBRARY_DIRS
}
${
MPI_LIBRARY_DIR
}
)
endif
(
MPI_FOUND
)
endif
(
NOT MPI_FOUND
)
endif
(
HDF5_IS_PARALLEL
)
get_filename_component
(
HDF5_ROOT
"
${
HDF5_INCLUDE_DIR
}
/../"
REALPATH
)
set
(
HDF5_BINARY_DIRS
${
HDF5_ROOT
}
/bin
${
HDF5_ROOT
}
/dll
)
if
(
NOT HDF5_LIBRARIES
)
find_library
(
HDF5_LIBRARIES hdf5 HINTS
${
HDF5_ROOT
}
ENV LD_LIBRARY_PATH
)
endif
(
NOT HDF5_LIBRARIES
)
set
(
XDMF_LIBRARIES
${
XDMF_LIBRARIES
}
${
HDF5_LIBRARIES
}
)
set
(
XDMF_HDF5_BINARY_DIRS
${
HDF5_BINARY_DIRS
}
PARENT_SCOPE
)
set
(
XDMF_BINARIES
${
XDMF_BINARIES
}
${
HDF5_BINARY_DIRS
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment