diff --git a/CMakeLists.txt b/CMakeLists.txt index 01e2dd8..6eca51c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,16 +69,6 @@ add_subdirectory(slam) add_subdirectory(swage) add_subdirectory(io) -# Tests -if (BUILD_TESTS) - add_subdirectory(tests) -endif() - -# Examples -if (BUILD_EXAMPLES) - add_subdirectory(examples) -endif() - # Documentation if (WITH_DOCS) add_subdirectory(docs) @@ -96,12 +86,12 @@ add_subdirectory(mesh_tools) # subdirectories looking for anything that matches the pattern "*.h" is # indiscriminate, and the resulting include/ directory isn't affected by # distclean. If there's a better way to do this, please introduce it here.) -add_library(Elements SHARED src/elements_lib_dummy.cpp) +add_library(Elements INTERFACE) file(GLOB_RECURSE ALL_HEADERS elements/*.h geometry/*.h slam/*.h swage/*.h common/*.h swage2vtk/*.h) install(FILES ${ALL_HEADERS} DESTINATION include) -target_include_directories(Elements PUBLIC +target_include_directories(Elements INTERFACE $ $ ) @@ -137,16 +127,16 @@ set_target_properties(Elements install(EXPORT ElementsTargets DESTINATION lib/cmake/Elements) install(FILES "${PROJECT_BINARY_DIR}/ElementsConfigVersion.cmake" "${PROJECT_BINARY_DIR}/ElementsConfig.cmake" - DESTINATION lib/cmake/elements) + DESTINATION lib/cmake/Elements) # Install libraries in lib/ subdirectory of the specified install directory if (WITH_VTK AND VTK_FOUND) install(TARGETS swage2vtk EXPORT ElementsTargets DESTINATION lib) endif() -target_link_libraries(Elements elements geometry slam swage common) +target_link_libraries(Elements INTERFACE elements geometry slam swage common) if (WITH_VTK AND VTK_FOUND) - target_link_libraries(Elements PUBLIC swage2vtk) + target_link_libraries(Elements INTERFACE swage2vtk) endif() -target_link_libraries(Elements matar) +target_link_libraries(Elements INTERFACE matar) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9f6268e..47ed136 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,8 @@ +project(Examples) + +# CMake version > 3.8 required for C++17 standard +cmake_minimum_required(VERSION 3.8) + find_package(Elements) if(Matar_ENABLE_KOKKOS) find_package(Kokkos) diff --git a/examples/average/test/CMakeLists.txt b/examples/average/test/CMakeLists.txt index b5acd5a..60d7d01 100644 --- a/examples/average/test/CMakeLists.txt +++ b/examples/average/test/CMakeLists.txt @@ -4,7 +4,8 @@ set(Average_SRC_CXX average.cpp) add_executable(Average ${Average_SRC_CXX}) -target_link_libraries (Average swage) -target_link_libraries (Average elements) -target_link_libraries (Average geometry) -target_link_libraries (Average input) \ No newline at end of file +#target_link_libraries (Average swage) +#target_link_libraries (Average elements) +#target_link_libraries (Average geometry) +#target_link_libraries (Average input) +target_link_libraries (Average Elements input) diff --git a/matar b/matar index d9f7ed2..8ce87f4 160000 --- a/matar +++ b/matar @@ -1 +1 @@ -Subproject commit d9f7ed221c4fa0fa76f2a9afdd741eb8346a09d3 +Subproject commit 8ce87f4304f783a8d3995e191e07da489a7b5763 diff --git a/scripts/build-elements.sh b/scripts/build-elements.sh index 1f69c3c..8f33b21 100755 --- a/scripts/build-elements.sh +++ b/scripts/build-elements.sh @@ -154,13 +154,10 @@ source setup-env.sh ${machine} ${kokkos_build_type} ${build_cores} # Next, do action based on args if [ "$build_action" = "full-app" ]; then source kokkos-install.sh ${kokkos_build_type} - source matar-install.sh ${kokkos_build_type} source elements-install.sh ${kokkos_build_type} source cmake_build_${execution}.sh ${kokkos_build_type} elif [ "$build_action" = "install-kokkos" ]; then source kokkos-install.sh ${kokkos_build_type} -elif [ "$build_action" = "install-matar" ]; then - source matar-install.sh ${kokkos_build_type} elif [ "$build_action" = "install-elements" ]; then source elements-install.sh ${kokkos_build_type} elif [ "$build_action" = "elements" ]; then diff --git a/scripts/cmake_build_examples.sh b/scripts/cmake_build_examples.sh index 43d0038..61aed39 100644 --- a/scripts/cmake_build_examples.sh +++ b/scripts/cmake_build_examples.sh @@ -10,7 +10,6 @@ fi cmake_options=( -D CMAKE_PREFIX_PATH="${ELEMENTS_INSTALL_DIR};${KOKKOS_INSTALL_DIR}" - -D BUILD_EXAMPLES=ON ) if [ "$kokkos_build_type" = "none" ]; then diff --git a/scripts/cmake_build_test.sh b/scripts/cmake_build_test.sh index 4562ff3..7a4a15b 100644 --- a/scripts/cmake_build_test.sh +++ b/scripts/cmake_build_test.sh @@ -9,16 +9,16 @@ then fi cmake_options=( - -D CMAKE_PREFIX_PATH="${MATAR_INSTALL_DIR};${KOKKOS_INSTALL_DIR}" + -D CMAKE_PREFIX_PATH="${ELEMENTS_INSTALL_DIR};${KOKKOS_INSTALL_DIR}" ) if [ "$kokkos_build_type" = "none" ]; then cmake_options+=( - -D KOKKOS=OFF + -D Matar_ENABLE_KOKKOS=OFF ) else cmake_options+=( - -D KOKKOS=ON + -D Matar_ENABLE_KOKKOS=ON ) fi diff --git a/scripts/elements-install.sh b/scripts/elements-install.sh index 5c64523..37a937a 100644 --- a/scripts/elements-install.sh +++ b/scripts/elements-install.sh @@ -7,7 +7,7 @@ mkdir -p ${ELEMENTS_BUILD_DIR} cmake_options=( -D CMAKE_INSTALL_PREFIX="${ELEMENTS_INSTALL_DIR}" - -D CMAKE_PREFIX_PATH="${MATAR_INSTALL_DIR};${KOKKOS_INSTALL_DIR}" + -D CMAKE_PREFIX_PATH="${KOKKOS_INSTALL_DIR}" ) if [ "$kokkos_build_type" = "none" ]; then @@ -23,15 +23,15 @@ fi # Print CMake options for reference echo "CMake Options: ${cmake_options[@]}" -# Configure Matar +# Configure Elements cmake "${cmake_options[@]}" -B "${ELEMENTS_BUILD_DIR}" -S "${ELEMENTS_SOURCE_DIR}" -# Build Matar -echo "Building Matar..." +# Build Elements +echo "Building Elements..." make -C ${ELEMENTS_BUILD_DIR} -j${ELEMENTS_BUILD_CORES} -# Install Matar -echo "Installing Matar..." +# Install Elements +echo "Installing Elements..." make -C ${ELEMENTS_BUILD_DIR} install -echo "Matar installation complete" +echo "Elements installation complete" diff --git a/scripts/setup-env.sh b/scripts/setup-env.sh index ff42f68..3c4f6b9 100644 --- a/scripts/setup-env.sh +++ b/scripts/setup-env.sh @@ -5,7 +5,7 @@ machine="$1" kokkos_build_type="$2" build_cores="$3" -my_build="build-matar-${kokkos_build_type}" +my_build="build-elements-${kokkos_build_type}" export scriptdir=`pwd` @@ -20,7 +20,7 @@ export installdir=${basedir}/install export EXAMPLE_SOURCE_DIR=${basedir}/examples export EXAMPLE_BUILD_DIR=${builddir} -export TEST_SOURCE_DIR=${basedir}/test +export TEST_SOURCE_DIR=${basedir}/tests export TEST_BUILD_DIR=${builddir} export ELEMENTS_SOURCE_DIR=${basedir} diff --git a/src/elements_lib_dummy.cpp b/src/elements_lib_dummy.cpp deleted file mode 100644 index 33c14ce..0000000 --- a/src/elements_lib_dummy.cpp +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bedfa95..914fe2f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,13 @@ +project(Tests) + +# CMake version > 3.8 required for C++17 standard +cmake_minimum_required(VERSION 3.8) + +find_package(Elements) +if(Matar_ENABLE_KOKKOS) + find_package(Kokkos) +endif() + # Test SLAM add_executable( test_slam_math @@ -5,7 +15,9 @@ add_executable( ) target_link_libraries( - slam + test_slam_math + Elements +# slam ) # Test Lagrange polynomials @@ -16,7 +28,8 @@ add_executable( target_link_libraries( test_lagrange_polynomials - elements + Elements + #elements ) # Test Lagrange element @@ -26,7 +39,8 @@ add_executable( ) target_link_libraries( test_lagrange_element - elements + Elements + #elements ) # Test Legendre polynomials @@ -36,7 +50,8 @@ add_executable( ) target_link_libraries( test_legendre_polynomials - elements + Elements + #elements ) # Test Legendre element @@ -46,7 +61,8 @@ add_executable( ) target_link_libraries( test_legendre_element - elements + Elements + #elements ) @@ -57,7 +73,8 @@ add_executable( ) target_link_libraries( test_legendre_ref_integration - elements + Elements + #elements ) @@ -70,8 +87,9 @@ if (ENABLE_BLAS_LAPACK) ) target_link_libraries( test_gauss_jacobi_quadrature - common - elements + Elements + #common + #elements ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} )