Skip to content

Commit

Permalink
fix schroedinger-splitting example
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Apr 28, 2022
1 parent fa4f1f2 commit 74d6d73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
5 changes: 2 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ set(EXAMPLES_LIST
par-ilu-convergence
performance-debugging
preconditioner-export
schroedinger-splitting
simple-solver-logging)

if(GINKGO_BUILD_CUDA AND GINKGO_BUILD_OMP)
Expand All @@ -41,9 +40,9 @@ endif()

find_package(OpenCV QUIET)
if(OpenCV_FOUND)
list(APPEND EXAMPLES_LIST heat-equation)
list(APPEND EXAMPLES_LIST heat-equation schroedinger-splitting)
else()
message(STATUS "No OpenCV found, disabling heat-equation example")
message(STATUS "No OpenCV found, disabling examples with video output")
endif()

if(GINKGO_HAVE_PAPI_SDE)
Expand Down
23 changes: 13 additions & 10 deletions examples/schroedinger-splitting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
set(target_name "schroedinger-splitting")
find_package(OpenCV)
cmake_minimum_required(VERSION 3.9)
project(schroedinger-splitting)

if (OpenCV_FOUND)
add_executable(${target_name} ${target_name}.cpp)
target_link_libraries(${target_name} Ginkgo::ginkgo ${OpenCV_LIBS})
target_include_directories(${target_name} PRIVATE ${PROJECT_SOURCE_DIR})
configure_file(../../matrices/examples/gko_logo_2d.mtx data/gko_logo_2d.mtx COPYONLY)
configure_file(../../matrices/examples/gko_text_2d.mtx data/gko_text_2d.mtx COPYONLY)
else()
message("OpenCV not found, skipping schroedinger-splitting example")
# We only need to find Ginkgo if we build this example stand-alone
if (NOT GINKGO_BUILD_EXAMPLES)
find_package(Ginkgo 1.5.0 REQUIRED)
endif()
find_package(OpenCV REQUIRED)

add_executable(schroedinger-splitting schroedinger-splitting.cpp)
target_link_libraries(schroedinger-splitting Ginkgo::ginkgo ${OpenCV_LIBS})

# Copy the data files to the execution directory
configure_file(../../matrices/examples/gko_logo_2d.mtx data/gko_logo_2d.mtx COPYONLY)
configure_file(../../matrices/examples/gko_text_2d.mtx data/gko_text_2d.mtx COPYONLY)

0 comments on commit 74d6d73

Please sign in to comment.