-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
253 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
blt branch='develop' commit='68c98b7306e0b1f19cb383ac6af210d6f75627fc' | ||
blt branch='develop' commit='aea5fbf046e122bd72888dad0a7f97a07b9ff08d' |
Submodule blt
updated
7 files
+1 −1 | .gitlab-ci.yml | |
+2 −2 | .gitlab/build_lassen.yml | |
+0 −3 | RELEASE-NOTES.md | |
+0 −2 | cmake/BLTOptions.cmake | |
+7 −50 | cmake/thirdparty/SetupMPI.cmake | |
+1 −1 | docs/_static/style.css | |
+0 −7 | docs/tutorial/common_hpc_dependencies.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Copyright (c) Lawrence Livermore National Security, LLC and other Conduit | ||
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and | ||
# other details. No copyright assignment is required to contribute to Conduit. | ||
############################################################################### | ||
# | ||
# Example that shows how to use an installed instance of Conduit in another | ||
# CMake-based build system. | ||
# | ||
# To build: | ||
# mkdir build | ||
# cd build | ||
# cmake -DCONDUIT_DIR={conduit install path} ../ | ||
# make | ||
# ./conduit_example | ||
# | ||
# | ||
# If run in sub directory of a conduit install, | ||
# CONDUIT_DIR will default to ../../.. | ||
# | ||
# mkdir build | ||
# cd build | ||
# cmake .. | ||
# make | ||
# ./conduit_example | ||
# | ||
############################################################################### | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(using_with_cmake) | ||
|
||
|
||
################################################################ | ||
# Option 1: import conduit using an explicit path (recommended) | ||
################################################################ | ||
|
||
# | ||
# Provide default CONDUIT_DIR that works in a conduit install | ||
# | ||
if(NOT CONDUIT_DIR) | ||
set(CONDUIT_DIR "../../..") | ||
endif() | ||
|
||
# | ||
# Check for valid conduit install | ||
# | ||
|
||
# if given relative path, resolve | ||
get_filename_component(CONDUIT_DIR ${CONDUIT_DIR} ABSOLUTE) | ||
# check for expected cmake exported target files | ||
if(NOT EXISTS ${CONDUIT_DIR}/lib/cmake/conduit/ConduitConfig.cmake) | ||
# also allow old style, but if neither case is found display error msg | ||
if(NOT EXISTS ${CONDUIT_DIR}/lib/cmake/ConduitConfig.cmake) | ||
MESSAGE(FATAL_ERROR "Could not find Conduit CMake include file (${CONDUIT_DIR}/lib/cmake/conduit/ConduitConfig.cmake)") | ||
endif() | ||
endif() | ||
|
||
# | ||
# Use CMake's find_package to import conduit's targets | ||
# using explicit path | ||
# | ||
find_package(Conduit REQUIRED | ||
NO_DEFAULT_PATH | ||
PATHS ${CONDUIT_DIR}/lib/cmake/conduit) | ||
|
||
# make sure we have mpi, since we are going to use | ||
# conduits mpi features | ||
if(NOT MPI_FOUND) | ||
find_package(MPI COMPONENTS CXX) | ||
endif() | ||
|
||
|
||
################################################################ | ||
# Option 2: import conduit using find_package search | ||
################################################################ | ||
## | ||
## Add Conduit's install path to CMAKE_PREFIX_PATH | ||
## and use following find_package call to import conduit's targets | ||
## | ||
# | ||
# find_package(Conduit REQUIRED) | ||
# | ||
|
||
|
||
###### | ||
# If Conduit was built with c++11 support, make sure we enable it | ||
###### | ||
if(CONDUIT_USE_CXX11) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
endif() | ||
|
||
####################################################### | ||
# create our example | ||
####################################################### | ||
add_executable(conduit_mpi_example conduit_mpi_example.cpp) | ||
|
||
# link to conduit targets | ||
target_link_libraries(conduit_mpi_example conduit::conduit | ||
conduit::conduit_mpi | ||
MPI::MPI_CXX) | ||
|
||
# if you are using conduit's python CAPI capsule interface | ||
# target_link_libraries(conduit_example conduit::conduit_python) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Lawrence Livermore National Security, LLC and other Conduit | ||
// Project developers. See top-level LICENSE AND COPYRIGHT files for dates and | ||
// other details. No copyright assignment is required to contribute to Conduit. | ||
|
||
//----------------------------------------------------------------------------- | ||
/// | ||
/// file: conduit_mpi_example.cpp | ||
/// | ||
//----------------------------------------------------------------------------- | ||
|
||
#include <iostream> | ||
|
||
#include "conduit.hpp" | ||
#include "conduit_relay.hpp" | ||
#include "conduit_relay_mpi.hpp" | ||
#include "conduit_relay_mpi_io.hpp" | ||
#include "conduit_blueprint.hpp" | ||
#include "conduit_blueprint_mpi.hpp" | ||
|
||
|
||
int main(int argc, char **argv) | ||
{ | ||
MPI_Init(&argc, &argv); | ||
|
||
//much ado about `about` | ||
|
||
conduit::Node about; | ||
conduit::about(about["conduit"]); | ||
conduit::relay::about(about["conduit/relay"]); | ||
conduit::relay::io::about(about["conduit/relay/io"]); | ||
conduit::blueprint::about(about["conduit/blueprint"]); | ||
|
||
conduit::Node about_mpi; | ||
conduit::relay::mpi::about(about_mpi["conduit/relay/mpi"]); | ||
conduit::relay::mpi::io::about(about_mpi["conduit/relay/mpi/io"],MPI_COMM_WORLD); | ||
conduit::blueprint::mpi::about(about_mpi["conduit/blueprint/mpi"]); | ||
|
||
std::cout << about.to_yaml() << std::endl; | ||
std::cout << about_mpi.to_yaml() << std::endl; | ||
|
||
MPI_Finalize(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters