From fdac520597e90214e9f3572b116b135611092fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Klatt?= Date: Mon, 23 Jun 2014 08:39:09 +0200 Subject: [PATCH 1/3] examples: advec: some cmake tweaks and better names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Torbjörn Klatt --- examples/advection_diffusion/CMakeLists.txt | 48 ++++++------------- .../{ex2.cpp => serial_mlsdc.cpp} | 0 .../{ex3.cpp => serial_mlsdc_autobuild.cpp} | 0 .../{ex1.cpp => vanilla_sdc.cpp} | 0 4 files changed, 14 insertions(+), 34 deletions(-) rename examples/advection_diffusion/{ex2.cpp => serial_mlsdc.cpp} (100%) rename examples/advection_diffusion/{ex3.cpp => serial_mlsdc_autobuild.cpp} (100%) rename examples/advection_diffusion/{ex1.cpp => vanilla_sdc.cpp} (100%) diff --git a/examples/advection_diffusion/CMakeLists.txt b/examples/advection_diffusion/CMakeLists.txt index e6f16eeb..c66a50d8 100644 --- a/examples/advection_diffusion/CMakeLists.txt +++ b/examples/advection_diffusion/CMakeLists.txt @@ -5,39 +5,19 @@ include_directories( ${pfasst_INCLUDES} ) -set(ex1_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/ex1.cpp +set(advec_examples + vanilla_sdc + serial_mlsdc + serial_mlsdc_autobuild ) -add_executable(ex1 ${ex1_SOURCES}) -add_dependencies(ex1 fftw3) -target_link_libraries(ex1 - ${fftw3_LIBS} -) -set_target_properties(ex1 - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/examples -) - -set(ex2_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/ex2.cpp -) -add_executable(ex2 ${ex2_SOURCES}) -add_dependencies(ex2 fftw3) -target_link_libraries(ex2 - ${fftw3_LIBS} -) -set_target_properties(ex2 - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/examples -) - -set(ex3_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/ex3.cpp -) -add_executable(ex3 ${ex3_SOURCES}) -add_dependencies(ex3 fftw3) -target_link_libraries(ex3 - ${fftw3_LIBS} -) -set_target_properties(ex3 - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/examples -) +foreach(example ${advec_examples}) + add_executable(${example} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp) + add_dependencies(${example} fftw3) + target_link_libraries(${example} + ${fftw3_LIBS} + ) + set_target_properties(${example} + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/examples/advection_diffusion + ) +endforeach(example) diff --git a/examples/advection_diffusion/ex2.cpp b/examples/advection_diffusion/serial_mlsdc.cpp similarity index 100% rename from examples/advection_diffusion/ex2.cpp rename to examples/advection_diffusion/serial_mlsdc.cpp diff --git a/examples/advection_diffusion/ex3.cpp b/examples/advection_diffusion/serial_mlsdc_autobuild.cpp similarity index 100% rename from examples/advection_diffusion/ex3.cpp rename to examples/advection_diffusion/serial_mlsdc_autobuild.cpp diff --git a/examples/advection_diffusion/ex1.cpp b/examples/advection_diffusion/vanilla_sdc.cpp similarity index 100% rename from examples/advection_diffusion/ex1.cpp rename to examples/advection_diffusion/vanilla_sdc.cpp From 7ff6d14aab41e8e43a46b9f0a8d0b259afd2ce9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Klatt?= Date: Mon, 23 Jun 2014 10:09:56 +0200 Subject: [PATCH 2/3] cmake: moving compiled targets to ./dist directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... outside of build directory Signed-off-by: Torbjörn Klatt --- CMakeLists.txt | 7 ++++++- examples/advection_diffusion/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26b5df2d..f4dce4fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,15 @@ include(ExternalProject) # Set default ExternalProject root directory set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/3rdparty) -option(pfasst_DISABLE_LIBCXX "Disable use of LLVM's libstdc++ when compiling with Clang." ON) +option(pfasst_DISABLE_LIBCXX "Disable use of LLVM's libc++ when compiling with Clang." ON) option(pfasst_BUILD_EXAMPLES "Build example programs." ON) option(pfasst_BUILD_TESTS "Build test suite for PFASST." ON) +# output directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${pfasst_SOURCE_DIR}/dist/bin") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${pfasst_SOURCE_DIR}/dist/lib") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${pfasst_SOURCE_DIR}/dist/lib") + # check for C++11 support if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU) check_cxx_compiler_flag(-std=c++11 HAVE_STD11) diff --git a/examples/advection_diffusion/CMakeLists.txt b/examples/advection_diffusion/CMakeLists.txt index c66a50d8..ffa92cbc 100644 --- a/examples/advection_diffusion/CMakeLists.txt +++ b/examples/advection_diffusion/CMakeLists.txt @@ -18,6 +18,6 @@ foreach(example ${advec_examples}) ${fftw3_LIBS} ) set_target_properties(${example} - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/examples/advection_diffusion + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/examples/advection_diffusion ) endforeach(example) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 493c01ff..b1b250f1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,8 +16,10 @@ foreach(test ${TESTS}) ${3rdparty_DEPENDEND_LIBS} ${pfasst_DEPENDED_LIBS} ) - set_target_properties(${test} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${pfasst_BINARY_DIR}/tests) + set_target_properties(${test} + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests + ) add_test(NAME ${test} - COMMAND ${CMAKE_BINARY_DIR}/tests/${test} --gtest_output=xml:${test}_out.xml + COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests/${test} --gtest_output=xml:${test}_out.xml ) endforeach(test) From c22505f32e0ddbfb0a06b4cd4f8e760b3ee4f9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Klatt?= Date: Mon, 23 Jun 2014 10:14:19 +0200 Subject: [PATCH 3/3] git-ignoring /dist dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Torbjörn Klatt --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6221097a..9e4a6fe9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # other stuff /doc/build /build* +/dist # Created by http://www.gitignore.io