Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heat equation example #698

Merged
merged 2 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(EXAMPLES_LIST
custom-matrix-format
custom-stopping-criterion
ginkgo-overhead
heat-equation
minimal-cuda-solver
papi-logging
par-ilu-convergence
Expand Down
12 changes: 12 additions & 0 deletions examples/heat-equation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(target_name "heat-equation")
find_package(OpenCV)

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(data/initial.mtx data/initial.mtx COPYONLY)
configure_file(data/source.mtx data/source.mtx COPYONLY)
else()
message("OpenCV not found, skipping heat-equation example")
endif()
19 changes: 19 additions & 0 deletions examples/heat-equation/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# set up script
if [ $# -ne 1 ]; then
echo -e "Usage: $0 GINKGO_BUILD_DIRECTORY"
exit 1
fi
BUILD_DIR=$1
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &>/dev/null && pwd )

source ${THIS_DIR}/../build-setup.sh

# build
${CXX} -std=c++14 -o ${THIS_DIR}/heat-equation \
${THIS_DIR}/heat-equation.cpp \
-I${THIS_DIR}/../../include -I${BUILD_DIR}/include \
`pkg-config --cflags opencv4` \
-L${THIS_DIR} ${LINK_FLAGS} \
`pkg-config --libs opencv4`
Loading