Skip to content
Snippets Groups Projects
Commit b012a9f7 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

CMake: Remove local dependency searching from examples

parent 153592f7
No related branches found
No related tags found
1 merge request!237Consolidate cmake deps
Showing
with 26 additions and 91 deletions
...@@ -7,7 +7,6 @@ add_executable(globalArray_write globalArray_write.cpp) ...@@ -7,7 +7,6 @@ add_executable(globalArray_write globalArray_write.cpp)
target_link_libraries(globalArray_write adios2) target_link_libraries(globalArray_write adios2)
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
target_include_directories(globalArray_write PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(globalArray_write PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(globalArray_write ${MPI_C_LIBRARIES}) target_link_libraries(globalArray_write ${MPI_C_LIBRARIES})
endif() endif()
...@@ -7,7 +7,6 @@ add_executable(joinedArray_write joinedArray_write.cpp) ...@@ -7,7 +7,6 @@ add_executable(joinedArray_write joinedArray_write.cpp)
target_link_libraries(joinedArray_write adios2) target_link_libraries(joinedArray_write adios2)
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
target_include_directories(joinedArray_write PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(joinedArray_write PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(joinedArray_write ${MPI_C_LIBRARIES}) target_link_libraries(joinedArray_write ${MPI_C_LIBRARIES})
endif() endif()
...@@ -7,7 +7,6 @@ add_executable(localArray_write localArray_write.cpp) ...@@ -7,7 +7,6 @@ add_executable(localArray_write localArray_write.cpp)
target_link_libraries(localArray_write adios2) target_link_libraries(localArray_write adios2)
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
target_include_directories(localArray_write PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(localArray_write PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(localArray_write ${MPI_C_LIBRARIES}) target_link_libraries(localArray_write ${MPI_C_LIBRARIES})
endif() endif()
...@@ -7,7 +7,6 @@ add_executable(values_write values_write.cpp) ...@@ -7,7 +7,6 @@ add_executable(values_write values_write.cpp)
target_link_libraries(values_write adios2) target_link_libraries(values_write adios2)
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
target_include_directories(values_write PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(values_write PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(values_write ${MPI_C_LIBRARIES}) target_link_libraries(values_write ${MPI_C_LIBRARIES})
endif() endif()
...@@ -6,19 +6,12 @@ ...@@ -6,19 +6,12 @@
add_executable(writer_multistep writer_multistep.cpp) add_executable(writer_multistep writer_multistep.cpp)
add_executable(reader_stepping reader_stepping.cpp) add_executable(reader_stepping reader_stepping.cpp)
add_executable(reader_allsteps reader_allsteps.cpp) add_executable(reader_allsteps reader_allsteps.cpp)
target_link_libraries(writer_multistep adios2)
target_link_libraries(reader_stepping adios2)
target_link_libraries(reader_allsteps adios2)
if(ADIOS2_HAVE_MPI) foreach(tgt IN ITEMS writer_multistep reader_stepping reader_allsteps)
find_package(MPI COMPONENTS C REQUIRED) target_link_libraries(${tgt} adios2)
target_include_directories(writer_multistep PRIVATE ${MPI_C_INCLUDE_PATH}) if(ADIOS2_HAVE_MPI)
target_link_libraries(writer_multistep ${MPI_C_LIBRARIES}) target_include_directories(${tgt} PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(${tgt} ${MPI_C_LIBRARIES})
target_include_directories(reader_stepping PRIVATE ${MPI_C_INCLUDE_PATH}) endif()
target_link_libraries(reader_stepping ${MPI_C_LIBRARIES}) endforeach()
target_include_directories(reader_allsteps PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(reader_allsteps ${MPI_C_LIBRARIES})
endif()
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(helloBPWriterXML helloBPWriterXML.cpp) add_executable(helloBPWriterXML helloBPWriterXML.cpp)
target_include_directories(helloBPWriterXML PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(helloBPWriterXML PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(helloBPWriterXML ${MPI_C_LIBRARIES}) target_link_libraries(helloBPWriterXML ${MPI_C_LIBRARIES})
......
...@@ -4,20 +4,13 @@ ...@@ -4,20 +4,13 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
add_executable(heatTransfer_read_adios2 heatRead_adios2.cpp PrintData.h)
target_include_directories(heatTransfer_read_adios2
PRIVATE ${MPI_C_INCLUDE_PATH}
)
target_link_libraries(heatTransfer_read_adios2 adios2 ${MPI_C_LIBRARIES})
if(ADIOS2_HAVE_ADIOS1) if(ADIOS2_HAVE_ADIOS1)
find_package(MPI COMPONENTS C REQUIRED)
find_package(ADIOS1 REQUIRED)
add_executable(heatTransfer_read_adios2 heatRead_adios2.cpp PrintData.h)
target_include_directories(heatTransfer_read_adios2
PRIVATE ${MPI_C_INCLUDE_PATH}
)
target_link_libraries(heatTransfer_read_adios2
adios2 ${MPI_C_LIBRARIES}
)
add_executable(heatTransfer_read_adios1 heatRead_adios1.cpp PrintData.h) add_executable(heatTransfer_read_adios1 heatRead_adios1.cpp PrintData.h)
target_include_directories(heatTransfer_read_adios1 target_include_directories(heatTransfer_read_adios1
PRIVATE ${MPI_C_INCLUDE_PATH} PRIVATE ${MPI_C_INCLUDE_PATH}
...@@ -26,5 +19,4 @@ if(ADIOS2_HAVE_MPI) ...@@ -26,5 +19,4 @@ if(ADIOS2_HAVE_MPI)
adios1::adios ${MPI_C_LIBRARIES} adios1::adios ${MPI_C_LIBRARIES}
) )
endif() endif()
endif()
endif()
\ No newline at end of file
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
find_package(Threads REQUIRED)
add_executable(heatTransfer_write_adios2 add_executable(heatTransfer_write_adios2
main.cpp main.cpp
HeatTransfer.cpp HeatTransfer.cpp
...@@ -16,15 +13,14 @@ if(ADIOS2_HAVE_MPI) ...@@ -16,15 +13,14 @@ if(ADIOS2_HAVE_MPI)
target_include_directories(heatTransfer_write_adios2 target_include_directories(heatTransfer_write_adios2
PRIVATE ${MPI_C_INCLUDE_PATH} PRIVATE ${MPI_C_INCLUDE_PATH}
) )
target_link_libraries(heatTransfer_write_adios2 adios2 ${MPI_C_LIBRARIES} target_link_libraries(heatTransfer_write_adios2
${CMAKE_THREAD_LIBS_INIT}) adios2 ${MPI_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
)
target_compile_definitions(heatTransfer_write_adios2 PRIVATE target_compile_definitions(heatTransfer_write_adios2 PRIVATE
-DDEFAULT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/config.xml) -DDEFAULT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/config.xml
)
if(ADIOS2_HAVE_ADIOS1) if(ADIOS2_HAVE_ADIOS1)
find_package(ADIOS1 REQUIRED)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(heatTransfer_write_adios1 add_executable(heatTransfer_write_adios1
main.cpp main.cpp
HeatTransfer.cpp HeatTransfer.cpp
...@@ -40,9 +36,6 @@ if(ADIOS2_HAVE_MPI) ...@@ -40,9 +36,6 @@ if(ADIOS2_HAVE_MPI)
endif() endif()
if(ADIOS2_HAVE_HDF5) if(ADIOS2_HAVE_HDF5)
find_package(HDF5 REQUIRED)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(heatTransfer_write_hdf5 add_executable(heatTransfer_write_hdf5
main.cpp main.cpp
HeatTransfer.cpp HeatTransfer.cpp
...@@ -53,14 +46,8 @@ if(ADIOS2_HAVE_MPI) ...@@ -53,14 +46,8 @@ if(ADIOS2_HAVE_MPI)
PRIVATE ${MPI_C_INCLUDE_PATH} ${HDF5_C_INCLUDE_DIRS} PRIVATE ${MPI_C_INCLUDE_PATH} ${HDF5_C_INCLUDE_DIRS}
) )
target_link_libraries(heatTransfer_write_hdf5 target_link_libraries(heatTransfer_write_hdf5
${MPI_C_LIBRARIES} ${HDF5_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${HDF5_C_LIBRARIES} ${MPI_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
) )
endif()
if(ADIOS2_HAVE_HDF5)
find_package(HDF5 REQUIRED)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(heatTransfer_write_ph5 add_executable(heatTransfer_write_ph5
main.cpp main.cpp
...@@ -72,15 +59,10 @@ if(ADIOS2_HAVE_MPI) ...@@ -72,15 +59,10 @@ if(ADIOS2_HAVE_MPI)
PRIVATE ${MPI_C_INCLUDE_PATH} ${HDF5_C_INCLUDE_DIRS} PRIVATE ${MPI_C_INCLUDE_PATH} ${HDF5_C_INCLUDE_DIRS}
) )
target_link_libraries(heatTransfer_write_ph5 target_link_libraries(heatTransfer_write_ph5
${MPI_C_LIBRARIES} ${HDF5_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${HDF5_C_LIBRARIES} ${MPI_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
) )
endif()
if(ADIOS2_HAVE_HDF5)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(heatTransfer_write_a2h5 add_executable(heatTransfer_write_a2h5
main.cpp main.cpp
HeatTransfer.cpp HeatTransfer.cpp
Settings.cpp Settings.cpp
...@@ -90,12 +72,8 @@ if(ADIOS2_HAVE_MPI) ...@@ -90,12 +72,8 @@ if(ADIOS2_HAVE_MPI)
target_include_directories(heatTransfer_write_a2h5 target_include_directories(heatTransfer_write_a2h5
PRIVATE ${MPI_C_INCLUDE_PATH} PRIVATE ${MPI_C_INCLUDE_PATH}
) )
#target_link_libraries(heatTransfer_write_a2h5 target_link_libraries(heatTransfer_write_a2h5
# ${MPI_C_LIBRARIES} adios2 ${MPI_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
#) )
target_link_libraries(heatTransfer_write_a2h5 PUBLIC adios2
${CMAKE_THREAD_LIBS_INIT})
endif() endif()
endif() endif()
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_adios1Writer helloADIOS1Writer.cpp) add_executable(hello_adios1Writer helloADIOS1Writer.cpp)
target_include_directories(hello_adios1Writer PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_adios1Writer PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_adios1Writer ${MPI_C_LIBRARIES}) target_link_libraries(hello_adios1Writer ${MPI_C_LIBRARIES})
......
...@@ -4,15 +4,11 @@ ...@@ -4,15 +4,11 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_bpBZip2Wrapper helloBPBZip2Wrapper.cpp) add_executable(hello_bpBZip2Wrapper helloBPBZip2Wrapper.cpp)
target_include_directories(hello_bpBZip2Wrapper PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_bpBZip2Wrapper PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_bpBZip2Wrapper ${MPI_C_LIBRARIES}) target_link_libraries(hello_bpBZip2Wrapper ${MPI_C_LIBRARIES})
else() else()
add_executable(hello_bpBZip2Wrapper helloBPBZip2Wrapper_nompi.cpp) add_executable(hello_bpBZip2Wrapper helloBPBZip2Wrapper_nompi.cpp)
endif() endif()
target_link_libraries(hello_bpBZip2Wrapper adios2) target_link_libraries(hello_bpBZip2Wrapper adios2)
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_bpFlushWriter helloBPFlushWriter.cpp) add_executable(hello_bpFlushWriter helloBPFlushWriter.cpp)
target_include_directories(hello_bpFlushWriter PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_bpFlushWriter PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_bpFlushWriter ${MPI_C_LIBRARIES}) target_link_libraries(hello_bpFlushWriter ${MPI_C_LIBRARIES})
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_bpTimeWriter helloBPTimeWriter.cpp) add_executable(hello_bpTimeWriter helloBPTimeWriter.cpp)
target_include_directories(hello_bpTimeWriter PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_bpTimeWriter PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_bpTimeWriter ${MPI_C_LIBRARIES}) target_link_libraries(hello_bpTimeWriter ${MPI_C_LIBRARIES})
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_bpWriter helloBPWriter.cpp) add_executable(hello_bpWriter helloBPWriter.cpp)
target_include_directories(hello_bpWriter PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_bpWriter PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_bpWriter ${MPI_C_LIBRARIES}) target_link_libraries(hello_bpWriter ${MPI_C_LIBRARIES})
...@@ -18,15 +16,14 @@ if(ADIOS2_HAVE_MPI) ...@@ -18,15 +16,14 @@ if(ADIOS2_HAVE_MPI)
else() else()
add_executable(hello_bpWriter helloBPWriter_nompi.cpp) add_executable(hello_bpWriter helloBPWriter_nompi.cpp)
if(ADIOS2_HAVE_C) if(ADIOS2_HAVE_C)
add_executable(hello_bpWriter_c helloBPWriter_nompi.c) add_executable(hello_bpWriter_c helloBPWriter_nompi.c)
endif() endif()
endif() endif()
target_link_libraries(hello_bpWriter adios2) target_link_libraries(hello_bpWriter adios2)
if(ADIOS2_HAVE_C) if(ADIOS2_HAVE_C)
target_link_libraries(hello_bpWriter_c adios2_c adios2) target_link_libraries(hello_bpWriter_c adios2_c adios2)
endif() endif()
\ No newline at end of file
...@@ -4,15 +4,12 @@ ...@@ -4,15 +4,12 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_bpZfpWrapper helloBPZfpWrapper.cpp) add_executable(hello_bpZfpWrapper helloBPZfpWrapper.cpp)
target_include_directories(hello_bpZfpWrapper PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_bpZfpWrapper PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_bpZfpWrapper ${MPI_C_LIBRARIES}) target_link_libraries(hello_bpZfpWrapper ${MPI_C_LIBRARIES})
else() else()
add_executable(hello_bpZfpWrapper helloBPZfpWrapper_nompi.cpp) add_executable(hello_bpZfpWrapper helloBPZfpWrapper_nompi.cpp)
endif() endif()
target_link_libraries(hello_bpZfpWrapper adios2) target_link_libraries(hello_bpZfpWrapper adios2)
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_datamanReader helloDataManReader.cpp) add_executable(hello_datamanReader helloDataManReader.cpp)
target_include_directories(hello_datamanReader PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_datamanReader PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_datamanReader ${MPI_C_LIBRARIES}) target_link_libraries(hello_datamanReader ${MPI_C_LIBRARIES})
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_datamanWriter helloDataManWriter.cpp) add_executable(hello_datamanWriter helloDataManWriter.cpp)
target_include_directories(hello_datamanWriter PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_datamanWriter PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_datamanWriter ${MPI_C_LIBRARIES}) target_link_libraries(hello_datamanWriter ${MPI_C_LIBRARIES})
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
add_executable(hello_hdf5Writer helloHDF5Writer.cpp) add_executable(hello_hdf5Writer helloHDF5Writer.cpp)
target_include_directories(hello_hdf5Writer PRIVATE ${MPI_C_INCLUDE_PATH}) target_include_directories(hello_hdf5Writer PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(hello_hdf5Writer ${MPI_C_LIBRARIES}) target_link_libraries(hello_hdf5Writer ${MPI_C_LIBRARIES})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment