From 8b5e2e577c5623715bbc4e464b1b24db56fce3dc Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:47:51 +0100 Subject: [PATCH 01/36] CMake BS working skeleton --- .gitignore | 1 + CMakeLists.txt | 23 ++++++++++ src/CMakeLists.txt | 95 ++++++++++++++++++++++++++++++++++++++++ src/t8.h | 2 + src/t8_version.h | 2 + test/CMakeLists.txt | 6 +++ tutorials/CMakeLists.txt | 37 ++++++++++++++++ 7 files changed, 166 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt create mode 100644 tutorials/CMakeLists.txt diff --git a/.gitignore b/.gitignore index e536e16531..51ae07299a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ sc/ p4est/ build-aux/ +build/ .deps/ .libs/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..1611e49643 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required( VERSION 3.16 ) +project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." LANGUAGES C CXX ) +include( CTest ) + +option( T8CODE_BUILD_TESTS "" ON ) +option( T8CODE_BUILD_TUTORIALS "" ON ) +# option( T8CODE_ENABLE_MPI "" OFF ) + +if( NOT CMAKE_CXX_STANDARD ) + set( CMAKE_CXX_STANDARD 17 ) +endif() + +add_subdirectory( sc ) +add_subdirectory( p4est ) +add_subdirectory( src ) + +if ( T8CODE_BUILD_TESTS ) + add_subdirectory( test ) +endif() + +if ( T8CODE_BUILD_TUTORIALS ) + add_subdirectory( tutorials ) +endif() \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..243d0ef23a --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,95 @@ +add_library( T8 ) +target_include_directories( T8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) +target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC ) +target_sources( T8 PRIVATE + t8.c + t8_eclass.c + t8_mesh.c + t8_element.c + t8_element_cxx.cxx + t8_element_c_interface.cxx + t8_refcount.c + t8_cmesh/t8_cmesh.c + t8_cmesh/t8_cmesh_occ.cxx + t8_cmesh/t8_cmesh_cxx.cxx + t8_cmesh/t8_cmesh_triangle.c + t8_cmesh/t8_cmesh_vtk_writer.c + t8_cmesh/t8_cmesh_stash.c + t8_cmesh/t8_cmesh_vtk_reader.cxx + t8_cmesh/t8_cmesh_save.c + t8_cmesh/t8_cmesh_netcdf.c + t8_cmesh/t8_cmesh_trees.c + t8_cmesh/t8_cmesh_commit.c + t8_cmesh/t8_cmesh_partition.c + t8_cmesh/t8_cmesh_copy.c + t8_data/t8_shmem.c + t8_cmesh/t8_cmesh_geometry.cxx + t8_cmesh/t8_cmesh_examples.c + t8_cmesh/t8_cmesh_helpers.c + t8_data/t8_containers.cxx + t8_cmesh/t8_cmesh_offset.c + t8_cmesh/t8_cmesh_readmshfile.cxx + t8_forest/t8_forest.c + t8_forest/t8_forest_adapt.cxx + t8_geometry/t8_geometry.cxx + t8_geometry/t8_geometry_helpers.c + t8_geometry/t8_geometry_base.cxx + t8_geometry/t8_geometry_with_vertices.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_occ.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_examples.cxx + t8_forest/t8_forest_partition.cxx + t8_forest/t8_forest_cxx.cxx + t8_forest/t8_forest_private.c + t8_forest/t8_forest_vtk.cxx + t8_forest/t8_forest_ghost.cxx + t8_forest/t8_forest_iterate.cxx + t8_version.c + t8_vtk.c + t8_forest/t8_forest_balance.cxx + t8_forest/t8_forest_netcdf.cxx + t8_element_shape.c + t8_netcdf.c + t8_cmesh/t8_cmesh_testcases.c + t8_vtk/t8_vtk_polydata.cxx + t8_vtk/t8_vtk_unstructured.cxx + t8_vtk/t8_vtk_parallel.cxx + t8_vtk/t8_vtk_reader.cxx + t8_schemes/t8_default/t8_default_cxx.cxx + t8_schemes/t8_default/t8_default_common/t8_default_common_cxx.cxx + t8_schemes/t8_default/t8_default_hex/t8_default_hex_cxx.cxx + t8_schemes/t8_default/t8_default_hex/t8_dhex_bits.c + t8_schemes/t8_default/t8_default_line/t8_default_line_cxx.cxx + t8_schemes/t8_default/t8_default_line/t8_dline_bits.c + t8_schemes/t8_default/t8_default_prism/t8_default_prism_cxx.cxx + t8_schemes/t8_default/t8_default_prism/t8_dprism_bits.c + t8_schemes/t8_default/t8_default_quad/t8_default_quad_cxx.cxx + t8_schemes/t8_default/t8_default_quad/t8_dquad_bits.c + t8_schemes/t8_default/t8_default_tet/t8_default_tet_cxx.cxx + t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.c + t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.c + t8_schemes/t8_default/t8_default_tri/t8_default_tri_cxx.cxx + t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.c + t8_schemes/t8_default/t8_default_tri/t8_dtri_connectivity.c + t8_schemes/t8_default/t8_default_vertex/t8_default_vertex_cxx.cxx + t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.c + t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.cxx + t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.c + t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_connectivity.c +) + +target_compile_definitions( T8 PUBLIC T8_CMAKE_BUILD ) +target_compile_definitions( T8 PUBLIC T8_CC="${CMAKE_C_COMPILER}" ) +target_compile_definitions( T8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) +target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) + +target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) +target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) \ No newline at end of file diff --git a/src/t8.h b/src/t8.h index 9979918006..e935804b86 100644 --- a/src/t8.h +++ b/src/t8.h @@ -30,7 +30,9 @@ #define T8_H /* include config headers */ +#ifndef T8_CMAKE_BUILD #include +#endif #include #if (defined(T8_ENABLE_MPI) && !defined(SC_ENABLE_MPI)) || (!defined(T8_ENABLE_MPI) && defined(SC_ENABLE_MPI)) #error "MPI configured differently in t8code and libsc" diff --git a/src/t8_version.h b/src/t8_version.h index 80b8c4b63e..fd9cea599f 100644 --- a/src/t8_version.h +++ b/src/t8_version.h @@ -47,7 +47,9 @@ #define T8_VERSION_H #include +#ifndef T8_CMAKE_BUILD #include +#endif /* In order to convert a macro to a string, we * need to pass it through these two helper macros. */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000000..a51416a3b6 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library( gtest ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi/gtest/gtest-all.cc ) +target_include_directories( gtest PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi ${CMAKE_CURRENT_LIST_DIR}/.. ) + +add_executable( t8_gtest_cmesh_bcast t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) +target_link_libraries( t8_gtest_cmesh_bcast PRIVATE T8 gtest ) +add_test( NAME t8_gtest_cmesh_bcast COMMAND ./t8_gtest_cmesh_bcast ) \ No newline at end of file diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt new file mode 100644 index 0000000000..2fa9dec85f --- /dev/null +++ b/tutorials/CMakeLists.txt @@ -0,0 +1,37 @@ +add_executable( t8_step0 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step0_helloworld.cxx ) +target_link_libraries( t8_step0 PRIVATE T8 ) + +add_executable( t8_step1 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step1_coarsemesh.cxx ) +target_link_libraries( t8_step1 PRIVATE T8 ) + +add_executable( t8_step2 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step2_uniform_forest.cxx ) +target_link_libraries( t8_step2 PRIVATE T8 ) + +add_executable( t8_step3 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_main.cxx ) +target_include_directories( t8_step3 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8_step3 PRIVATE T8 ) + +add_executable( t8_step4 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step4_partition_balance_ghost.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step4_main.cxx ) +target_include_directories( t8_step4 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8_step4 PRIVATE T8 ) + +add_executable( t8_step5 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx + # ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_element_data_c_interface.c + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_element_data.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_main.cxx ) +target_include_directories( t8_step5 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8_step5 PRIVATE T8 ) + +add_executable( t8_step6 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step6_stencil.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step6_main.cxx ) +target_include_directories( t8_step6 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8_step6 PRIVATE T8 ) + +add_executable( t8_step7 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step7_interpolation.cxx + ${CMAKE_CURRENT_LIST_DIR}/general/t8_step7_main.cxx ) +target_include_directories( t8_step7 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8_step7 PRIVATE T8 ) \ No newline at end of file From e13c6851c92855c982e94c4b6c26d78975ac9788 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:13:26 +0100 Subject: [PATCH 02/36] added T8CODE_ENABLE_MPI config flag --- CMakeLists.txt | 15 ++++++++++++++- src/CMakeLists.txt | 9 +++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1611e49643..9c268ff1a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,14 +2,27 @@ cmake_minimum_required( VERSION 3.16 ) project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." LANGUAGES C CXX ) include( CTest ) +option( T8CODE_ENABLE_MPI "" ON ) option( T8CODE_BUILD_TESTS "" ON ) option( T8CODE_BUILD_TUTORIALS "" ON ) -# option( T8CODE_ENABLE_MPI "" OFF ) if( NOT CMAKE_CXX_STANDARD ) set( CMAKE_CXX_STANDARD 17 ) endif() +if( NOT CMAKE_INSTALL_PREFIX ) + set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build ) +endif() + +if( T8CODE_ENABLE_MPI ) + find_package( MPI COMPONENTS C REQUIRED ) + if( NOT MPIEXEC_EXECUTABLE ) + message( FATAL_ERROR "MPIEXEC is missing, MPI will not work properly" ) + endif() + set( SC_ENABLE_MPI ON ) + set( mpi ON ) +endif() + add_subdirectory( sc ) add_subdirectory( p4est ) add_subdirectory( src ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 243d0ef23a..5cd7918de1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ add_library( T8 ) target_include_directories( T8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) -target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC ) +target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC $<$:MPI::MPI_C> ) target_sources( T8 PRIVATE t8.c t8_eclass.c @@ -92,4 +92,9 @@ target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) -target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) \ No newline at end of file +target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) + +if ( T8CODE_ENABLE_MPI ) + target_compile_definitions( T8 PUBLIC T8_ENABLE_MPI ) + target_compile_definitions( T8 PUBLIC T8_ENABLE_MPIIO ) +endif() \ No newline at end of file From ec48d40183de80cc278acf7d710f72804a7bebb8 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:55:04 +0100 Subject: [PATCH 03/36] ported all unit tests --- test/CMakeLists.txt | 73 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a51416a3b6..3155249760 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,73 @@ add_library( gtest ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi/gtest/gtest-all.cc ) target_include_directories( gtest PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi ${CMAKE_CURRENT_LIST_DIR}/.. ) -add_executable( t8_gtest_cmesh_bcast t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) -target_link_libraries( t8_gtest_cmesh_bcast PRIVATE T8 gtest ) -add_test( NAME t8_gtest_cmesh_bcast COMMAND ./t8_gtest_cmesh_bcast ) \ No newline at end of file +function(add_t8_test TEST_NAME TEST_SOURCES) + add_executable( ${TEST_NAME} ${TEST_SOURCES} ) + target_link_libraries( ${TEST_NAME} PRIVATE T8 gtest ) + if( T8CODE_ENABLE_MPI ) + target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPI ) + target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) + endif() + add_test( NAME ${TEST_NAME} COMMAND ./${TEST_NAME} ) +endfunction() + +add_t8_test( t8_gtest_cmesh_bcast t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) +add_t8_test( t8_gtest_eclass t8_gtest_main.cxx t8_gtest_eclass.cxx ) +add_t8_test( t8_gtest_vec t8_gtest_main.cxx t8_gtest_vec.cxx ) +add_t8_test( t8_gtest_mat t8_gtest_main.cxx t8_gtest_mat.cxx ) +add_t8_test( t8_gtest_refcount t8_gtest_main.cxx t8_gtest_refcount.cxx ) +add_t8_test( t8_gtest_occ_linkage t8_gtest_main.cxx t8_gtest_occ_linkage.cxx ) +add_t8_test( t8_gtest_version t8_gtest_main.cxx t8_gtest_version.cxx ) +add_t8_test( t8_gtest_basics t8_gtest_main.cxx t8_gtest_basics.cxx ) +add_t8_test( t8_gtest_netcdf_linkage t8_gtest_main.cxx t8_gtest_netcdf_linkage.cxx ) +add_t8_test( t8_gtest_vtk_linkage t8_gtest_main.cxx t8_gtest_vtk_linkage.cxx ) + +add_t8_test( t8_gtest_hypercube t8_gtest_main.cxx t8_cmesh/t8_gtest_hypercube.cxx ) +add_t8_test( t8_gtest_cmesh_copy t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_copy.cxx ) +add_t8_test( t8_gtest_cmesh_face_is_boundary t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_face_is_boundary.cxx ) +add_t8_test( t8_gtest_cmesh_partition t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_partition.cxx ) +add_t8_test( t8_gtest_cmesh_set_partition_offsets t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_partition_offsets.cxx ) +add_t8_test( t8_gtest_cmesh_set_join_by_vertices t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx ) +add_t8_test( t8_gtest_multiple_attributes t8_gtest_main.cxx t8_cmesh/t8_gtest_multiple_attributes.cxx ) +add_t8_test( t8_gtest_attribute_gloidx_array t8_gtest_main.cxx t8_cmesh/t8_gtest_attribute_gloidx_array.cxx ) + +add_t8_test( t8_gtest_shmem t8_gtest_main.cxx t8_data/t8_gtest_shmem.cxx ) + +add_t8_test( t8_gtest_element_volume t8_gtest_main.cxx t8_forest/t8_gtest_element_volume.cxx ) +add_t8_test( t8_gtest_search t8_gtest_main.cxx t8_forest/t8_gtest_search.cxx ) +add_t8_test( t8_gtest_element_general_function t8_gtest_main.cxx t8_forest/t8_gtest_element_general_function.cxx ) +add_t8_test( t8_gtest_half_neighbors t8_gtest_main.cxx t8_forest/t8_gtest_half_neighbors.cxx ) +add_t8_test( t8_gtest_find_owner t8_gtest_main.cxx t8_forest/t8_gtest_find_owner.cxx ) +add_t8_test( t8_gtest_user_data t8_gtest_main.cxx t8_forest/t8_gtest_user_data.cxx ) +add_t8_test( t8_gtest_transform t8_gtest_main.cxx t8_forest/t8_gtest_transform.cxx ) +add_t8_test( t8_gtest_ghost_exchange t8_gtest_main.cxx t8_forest/t8_gtest_ghost_exchange.cxx ) +add_t8_test( t8_gtest_ghost_delete t8_gtest_main.cxx t8_forest/t8_gtest_ghost_delete.cxx ) +add_t8_test( t8_gtest_ghost_and_owner t8_gtest_main.cxx t8_forest/t8_gtest_ghost_and_owner.cxx ) + +add_t8_test( t8_gtest_permute_hole t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_permute_hole.cxx ) +add_t8_test( t8_gtest_recursive t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_recursive.cxx ) +add_t8_test( t8_gtest_iterate_replace t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_iterate_replace.cxx ) +add_t8_test( t8_gtest_empty_local_tree t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_local_tree.cxx ) +add_t8_test( t8_gtest_empty_global_tree t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_global_tree.cxx ) + +add_t8_test( t8_gtest_geometry_occ t8_gtest_main.cxx t8_geometry/t8_geometry_implementations/t8_gtest_geometry_occ.cxx ) +add_t8_test( t8_gtest_geometry t8_gtest_main.cxx t8_geometry/t8_gtest_geometry.cxx ) +add_t8_test( t8_gtest_point_inside t8_gtest_main.cxx t8_geometry/t8_gtest_point_inside.cxx ) + +add_t8_test( t8_gtest_vtk_reader t8_gtest_main.cxx t8_IO/t8_gtest_vtk_reader.cxx ) + +add_t8_test( t8_gtest_nca t8_gtest_main.cxx t8_schemes/t8_gtest_nca.cxx ) +add_t8_test( t8_gtest_pyra_connectivity t8_gtest_main.cxx t8_schemes/t8_gtest_pyra_connectivity.cxx ) +add_t8_test( t8_gtest_face_neigh t8_gtest_main.cxx t8_schemes/t8_gtest_face_neigh.cxx ) +add_t8_test( t8_gtest_init_linear_id t8_gtest_main.cxx t8_schemes/t8_gtest_init_linear_id.cxx ) +add_t8_test( t8_gtest_ancestor t8_gtest_main.cxx t8_schemes/t8_gtest_ancestor.cxx ) +add_t8_test( t8_gtest_element_count_leafs t8_gtest_main.cxx t8_schemes/t8_gtest_element_count_leafs.cxx ) +add_t8_test( t8_gtest_element_ref_coords t8_gtest_main.cxx t8_schemes/t8_gtest_element_ref_coords.cxx ) +add_t8_test( t8_gtest_descendant t8_gtest_main.cxx t8_schemes/t8_gtest_descendant.cxx ) +add_t8_test( t8_gtest_find_parent t8_gtest_main.cxx t8_schemes/t8_gtest_find_parent.cxx ) +add_t8_test( t8_gtest_equal t8_gtest_main.cxx t8_schemes/t8_gtest_equal.cxx ) +add_t8_test( t8_gtest_successor t8_gtest_main.cxx t8_schemes/t8_gtest_successor.cxx ) +add_t8_test( t8_gtest_boundary_extrude t8_gtest_main.cxx t8_schemes/t8_gtest_boundary_extrude.cxx ) +add_t8_test( t8_gtest_face_descendant t8_gtest_main.cxx t8_schemes/t8_gtest_face_descendant.cxx ) +add_t8_test( t8_gtest_default t8_gtest_main.cxx t8_schemes/t8_gtest_default.cxx ) +add_t8_test( t8_gtest_child_parent_face t8_gtest_main.cxx t8_schemes/t8_gtest_child_parent_face.cxx ) \ No newline at end of file From db643f3e210f7f5c2d5cec6119c288caad74c709 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:02:30 +0100 Subject: [PATCH 04/36] mvp working --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3155249760..9e1c5709a6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,7 @@ add_library( gtest ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi/gtest/gtest-all.cc ) target_include_directories( gtest PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi ${CMAKE_CURRENT_LIST_DIR}/.. ) -function(add_t8_test TEST_NAME TEST_SOURCES) +function( add_t8_test TEST_NAME TEST_SOURCES ) add_executable( ${TEST_NAME} ${TEST_SOURCES} ) target_link_libraries( ${TEST_NAME} PRIVATE T8 gtest ) if( T8CODE_ENABLE_MPI ) From 3e965703ebdf0f37088459905e883d3578e070ba Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:12:27 +0100 Subject: [PATCH 05/36] typo fix --- CMakeLists.txt | 4 +++- test/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c268ff1a9..9337b09c4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,4 +33,6 @@ endif() if ( T8CODE_BUILD_TUTORIALS ) add_subdirectory( tutorials ) -endif() \ No newline at end of file +endif() + +install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9e1c5709a6..72762b03bf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -61,7 +61,7 @@ add_t8_test( t8_gtest_pyra_connectivity t8_gtest_main.cxx t8_schemes/t8_gtest_py add_t8_test( t8_gtest_face_neigh t8_gtest_main.cxx t8_schemes/t8_gtest_face_neigh.cxx ) add_t8_test( t8_gtest_init_linear_id t8_gtest_main.cxx t8_schemes/t8_gtest_init_linear_id.cxx ) add_t8_test( t8_gtest_ancestor t8_gtest_main.cxx t8_schemes/t8_gtest_ancestor.cxx ) -add_t8_test( t8_gtest_element_count_leafs t8_gtest_main.cxx t8_schemes/t8_gtest_element_count_leafs.cxx ) +add_t8_test( t8_gtest_element_count_leaves t8_gtest_main.cxx t8_schemes/t8_gtest_element_count_leaves.cxx ) add_t8_test( t8_gtest_element_ref_coords t8_gtest_main.cxx t8_schemes/t8_gtest_element_ref_coords.cxx ) add_t8_test( t8_gtest_descendant t8_gtest_main.cxx t8_schemes/t8_gtest_descendant.cxx ) add_t8_test( t8_gtest_find_parent t8_gtest_main.cxx t8_schemes/t8_gtest_find_parent.cxx ) From 81fb70d4b02e7fa603a177125196dabb93a6d2c9 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:38:23 +0100 Subject: [PATCH 06/36] initial examples support --- CMakeLists.txt | 17 +++++++++++------ example/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 example/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9337b09c4d..7a8b757774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ include( CTest ) option( T8CODE_ENABLE_MPI "" ON ) option( T8CODE_BUILD_TESTS "" ON ) option( T8CODE_BUILD_TUTORIALS "" ON ) +option( T8CODE_BUILD_EXAMPLES "" ON ) if( NOT CMAKE_CXX_STANDARD ) set( CMAKE_CXX_STANDARD 17 ) @@ -20,19 +21,23 @@ if( T8CODE_ENABLE_MPI ) message( FATAL_ERROR "MPIEXEC is missing, MPI will not work properly" ) endif() set( SC_ENABLE_MPI ON ) - set( mpi ON ) + set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo endif() -add_subdirectory( sc ) -add_subdirectory( p4est ) -add_subdirectory( src ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) if ( T8CODE_BUILD_TESTS ) - add_subdirectory( test ) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/test ) endif() if ( T8CODE_BUILD_TUTORIALS ) - add_subdirectory( tutorials ) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/tutorials ) +endif() + +if ( T8CODE_BUILD_EXAMPLES ) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/example ) endif() install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000000..277d31da66 --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,30 @@ +# Conditionally adding new sources to the main T8 target as in the original BS looked wrong... +add_library( T8ex ) +target_sources( T8ex PRIVATE common/t8_example_common.cxx common/t8_example_common_functions.cxx ) +target_include_directories( T8ex PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( T8ex PRIVATE T8 ) + +function( add_t8_example TEST_NAME TEST_SOURCES ) + add_executable( ${TEST_NAME} ${TEST_SOURCES} ) + target_link_libraries( ${TEST_NAME} PRIVATE T8 T8ex SC::SC ) + target_include_directories( ${TEST_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) + if( T8CODE_ENABLE_MPI ) + target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPI ) + target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) + endif() +endfunction() + +add_t8_example( t8_advection advect/t8_advection.cxx ) + +add_t8_example( t8_cmesh_partition cmesh/t8_cmesh_partition.cxx ) +add_t8_example( t8_cmesh_set_join_by_vertices cmesh/t8_cmesh_set_join_by_vertices.cxx ) +add_t8_example( t8_cmesh_geometry_examples cmesh/t8_cmesh_geometry_examples.cxx ) +add_t8_example( t8_cmesh_create_partitioned cmesh/t8_cmesh_create_partitioned.cxx ) +add_t8_example( t8_cmesh_hypercube_pad cmesh/t8_cmesh_hypercube_pad.cxx ) + +add_t8_example( t8_face_neighbor forest/t8_face_neighbor.cxx ) +add_t8_example( t8_test_ghost forest/t8_test_ghost.cxx ) +add_t8_example( t8_test_face_iterate forest/t8_test_face_iterate.cxx ) +add_t8_example( t8_test_ghost_large_level_diff forest/t8_test_ghost_large_level_diff.cxx ) + +add_t8_example( t8_example_geometries geometry/t8_example_geometries.cxx ) \ No newline at end of file From e19374a4a1b0b80985d1216ed894cbb4d1e661b9 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:30:40 +0100 Subject: [PATCH 07/36] helper fcn bug fix --- example/CMakeLists.txt | 39 +++++++------ test/CMakeLists.txt | 123 ++++++++++++++++++++------------------- tutorials/CMakeLists.txt | 56 +++++++----------- 3 files changed, 107 insertions(+), 111 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 277d31da66..626a732488 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -4,27 +4,32 @@ target_sources( T8ex PRIVATE common/t8_example_common.cxx common/t8_example_comm target_include_directories( T8ex PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) target_link_libraries( T8ex PRIVATE T8 ) -function( add_t8_example TEST_NAME TEST_SOURCES ) - add_executable( ${TEST_NAME} ${TEST_SOURCES} ) - target_link_libraries( ${TEST_NAME} PRIVATE T8 T8ex SC::SC ) - target_include_directories( ${TEST_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +function( add_t8_example ) + set( options "" ) + set( oneValueArgs "NAME" ) + set( multiValueArgs "SOURCES" ) + cmake_parse_arguments( ADD_T8_EXAMPLE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + + add_executable( ${ADD_T8_EXAMPLE_NAME} ${ADD_T8_EXAMPLE_SOURCES} ) + target_link_libraries( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8 T8ex SC::SC ) + target_include_directories( ${ADD_T8_EXAMPLE_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) if( T8CODE_ENABLE_MPI ) - target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPI ) - target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) + target_compile_definitions( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8_ENABLE_MPI ) + target_compile_definitions( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8_ENABLE_MPIIO ) endif() endfunction() -add_t8_example( t8_advection advect/t8_advection.cxx ) +add_t8_example( NAME t8_advection SOURCES advect/t8_advection.cxx ) -add_t8_example( t8_cmesh_partition cmesh/t8_cmesh_partition.cxx ) -add_t8_example( t8_cmesh_set_join_by_vertices cmesh/t8_cmesh_set_join_by_vertices.cxx ) -add_t8_example( t8_cmesh_geometry_examples cmesh/t8_cmesh_geometry_examples.cxx ) -add_t8_example( t8_cmesh_create_partitioned cmesh/t8_cmesh_create_partitioned.cxx ) -add_t8_example( t8_cmesh_hypercube_pad cmesh/t8_cmesh_hypercube_pad.cxx ) +add_t8_example( NAME t8_cmesh_partition SOURCES cmesh/t8_cmesh_partition.cxx ) +add_t8_example( NAME t8_cmesh_set_join_by_vertices SOURCES cmesh/t8_cmesh_set_join_by_vertices.cxx ) +add_t8_example( NAME t8_cmesh_geometry_examples SOURCES cmesh/t8_cmesh_geometry_examples.cxx ) +add_t8_example( NAME t8_cmesh_create_partitioned SOURCES cmesh/t8_cmesh_create_partitioned.cxx ) +add_t8_example( NAME t8_cmesh_hypercube_pad SOURCES cmesh/t8_cmesh_hypercube_pad.cxx ) -add_t8_example( t8_face_neighbor forest/t8_face_neighbor.cxx ) -add_t8_example( t8_test_ghost forest/t8_test_ghost.cxx ) -add_t8_example( t8_test_face_iterate forest/t8_test_face_iterate.cxx ) -add_t8_example( t8_test_ghost_large_level_diff forest/t8_test_ghost_large_level_diff.cxx ) +add_t8_example( NAME t8_face_neighbor SOURCES forest/t8_face_neighbor.cxx ) +add_t8_example( NAME t8_test_ghost SOURCES forest/t8_test_ghost.cxx ) +add_t8_example( NAME t8_test_face_iterate SOURCES forest/t8_test_face_iterate.cxx ) +add_t8_example( NAME t8_test_ghost_large_level_diff SOURCES forest/t8_test_ghost_large_level_diff.cxx ) -add_t8_example( t8_example_geometries geometry/t8_example_geometries.cxx ) \ No newline at end of file +add_t8_example( NAME t8_example_geometries SOURCES geometry/t8_example_geometries.cxx ) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 72762b03bf..f224a8fcbe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,73 +1,78 @@ add_library( gtest ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi/gtest/gtest-all.cc ) target_include_directories( gtest PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/googletest-mpi ${CMAKE_CURRENT_LIST_DIR}/.. ) -function( add_t8_test TEST_NAME TEST_SOURCES ) - add_executable( ${TEST_NAME} ${TEST_SOURCES} ) - target_link_libraries( ${TEST_NAME} PRIVATE T8 gtest ) +function( add_t8_test ) + set( options "" ) + set( oneValueArgs "NAME" ) + set( multiValueArgs "SOURCES" ) + cmake_parse_arguments( ADD_T8_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + + add_executable( ${ADD_T8_TEST_NAME} ${ADD_T8_TEST_SOURCES} ) + target_link_libraries( ${ADD_T8_TEST_NAME} PRIVATE T8 gtest ) if( T8CODE_ENABLE_MPI ) - target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPI ) - target_compile_definitions( ${TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) + target_compile_definitions( ${ADD_T8_TEST_NAME} PRIVATE T8_ENABLE_MPI ) + target_compile_definitions( ${ADD_T8_TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) endif() - add_test( NAME ${TEST_NAME} COMMAND ./${TEST_NAME} ) + add_test( NAME ${ADD_T8_TEST_NAME} COMMAND ./${ADD_T8_TEST_NAME} ) endfunction() -add_t8_test( t8_gtest_cmesh_bcast t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) -add_t8_test( t8_gtest_eclass t8_gtest_main.cxx t8_gtest_eclass.cxx ) -add_t8_test( t8_gtest_vec t8_gtest_main.cxx t8_gtest_vec.cxx ) -add_t8_test( t8_gtest_mat t8_gtest_main.cxx t8_gtest_mat.cxx ) -add_t8_test( t8_gtest_refcount t8_gtest_main.cxx t8_gtest_refcount.cxx ) -add_t8_test( t8_gtest_occ_linkage t8_gtest_main.cxx t8_gtest_occ_linkage.cxx ) -add_t8_test( t8_gtest_version t8_gtest_main.cxx t8_gtest_version.cxx ) -add_t8_test( t8_gtest_basics t8_gtest_main.cxx t8_gtest_basics.cxx ) -add_t8_test( t8_gtest_netcdf_linkage t8_gtest_main.cxx t8_gtest_netcdf_linkage.cxx ) -add_t8_test( t8_gtest_vtk_linkage t8_gtest_main.cxx t8_gtest_vtk_linkage.cxx ) +add_t8_test( NAME t8_gtest_cmesh_bcast SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) +add_t8_test( NAME t8_gtest_eclass SOURCES t8_gtest_main.cxx t8_gtest_eclass.cxx ) +add_t8_test( NAME t8_gtest_vec SOURCES t8_gtest_main.cxx t8_gtest_vec.cxx ) +add_t8_test( NAME t8_gtest_mat SOURCES t8_gtest_main.cxx t8_gtest_mat.cxx ) +add_t8_test( NAME t8_gtest_refcount SOURCES t8_gtest_main.cxx t8_gtest_refcount.cxx ) +add_t8_test( NAME t8_gtest_occ_linkage SOURCES t8_gtest_main.cxx t8_gtest_occ_linkage.cxx ) +add_t8_test( NAME t8_gtest_version SOURCES t8_gtest_main.cxx t8_gtest_version.cxx ) +add_t8_test( NAME t8_gtest_basics SOURCES t8_gtest_main.cxx t8_gtest_basics.cxx ) +add_t8_test( NAME t8_gtest_netcdf_linkage SOURCES t8_gtest_main.cxx t8_gtest_netcdf_linkage.cxx ) +add_t8_test( NAME t8_gtest_vtk_linkage SOURCES t8_gtest_main.cxx t8_gtest_vtk_linkage.cxx ) -add_t8_test( t8_gtest_hypercube t8_gtest_main.cxx t8_cmesh/t8_gtest_hypercube.cxx ) -add_t8_test( t8_gtest_cmesh_copy t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_copy.cxx ) -add_t8_test( t8_gtest_cmesh_face_is_boundary t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_face_is_boundary.cxx ) -add_t8_test( t8_gtest_cmesh_partition t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_partition.cxx ) -add_t8_test( t8_gtest_cmesh_set_partition_offsets t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_partition_offsets.cxx ) -add_t8_test( t8_gtest_cmesh_set_join_by_vertices t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx ) -add_t8_test( t8_gtest_multiple_attributes t8_gtest_main.cxx t8_cmesh/t8_gtest_multiple_attributes.cxx ) -add_t8_test( t8_gtest_attribute_gloidx_array t8_gtest_main.cxx t8_cmesh/t8_gtest_attribute_gloidx_array.cxx ) +add_t8_test( NAME t8_gtest_hypercube SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_hypercube.cxx ) +add_t8_test( NAME t8_gtest_cmesh_copy SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_copy.cxx ) +add_t8_test( NAME t8_gtest_cmesh_face_is_boundary SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_face_is_boundary.cxx ) +add_t8_test( NAME t8_gtest_cmesh_partition SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_partition.cxx ) +add_t8_test( NAME t8_gtest_cmesh_set_partition_offsets SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_partition_offsets.cxx ) +add_t8_test( NAME t8_gtest_cmesh_set_join_by_vertices SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx ) +add_t8_test( NAME t8_gtest_multiple_attributes SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_multiple_attributes.cxx ) +add_t8_test( NAME t8_gtest_attribute_gloidx_array SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_attribute_gloidx_array.cxx ) -add_t8_test( t8_gtest_shmem t8_gtest_main.cxx t8_data/t8_gtest_shmem.cxx ) +add_t8_test( NAME t8_gtest_shmem SOURCES t8_gtest_main.cxx t8_data/t8_gtest_shmem.cxx ) -add_t8_test( t8_gtest_element_volume t8_gtest_main.cxx t8_forest/t8_gtest_element_volume.cxx ) -add_t8_test( t8_gtest_search t8_gtest_main.cxx t8_forest/t8_gtest_search.cxx ) -add_t8_test( t8_gtest_element_general_function t8_gtest_main.cxx t8_forest/t8_gtest_element_general_function.cxx ) -add_t8_test( t8_gtest_half_neighbors t8_gtest_main.cxx t8_forest/t8_gtest_half_neighbors.cxx ) -add_t8_test( t8_gtest_find_owner t8_gtest_main.cxx t8_forest/t8_gtest_find_owner.cxx ) -add_t8_test( t8_gtest_user_data t8_gtest_main.cxx t8_forest/t8_gtest_user_data.cxx ) -add_t8_test( t8_gtest_transform t8_gtest_main.cxx t8_forest/t8_gtest_transform.cxx ) -add_t8_test( t8_gtest_ghost_exchange t8_gtest_main.cxx t8_forest/t8_gtest_ghost_exchange.cxx ) -add_t8_test( t8_gtest_ghost_delete t8_gtest_main.cxx t8_forest/t8_gtest_ghost_delete.cxx ) -add_t8_test( t8_gtest_ghost_and_owner t8_gtest_main.cxx t8_forest/t8_gtest_ghost_and_owner.cxx ) +add_t8_test( NAME t8_gtest_element_volume SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_element_volume.cxx ) +add_t8_test( NAME t8_gtest_search SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_search.cxx ) +add_t8_test( NAME t8_gtest_element_general_function SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_element_general_function.cxx ) +add_t8_test( NAME t8_gtest_half_neighbors SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_half_neighbors.cxx ) +add_t8_test( NAME t8_gtest_find_owner SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_find_owner.cxx ) +add_t8_test( NAME t8_gtest_user_data SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_user_data.cxx ) +add_t8_test( NAME t8_gtest_transform SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_transform.cxx ) +add_t8_test( NAME t8_gtest_ghost_exchange SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_ghost_exchange.cxx ) +add_t8_test( NAME t8_gtest_ghost_delete SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_ghost_delete.cxx ) +add_t8_test( NAME t8_gtest_ghost_and_owner SOURCES t8_gtest_main.cxx t8_forest/t8_gtest_ghost_and_owner.cxx ) -add_t8_test( t8_gtest_permute_hole t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_permute_hole.cxx ) -add_t8_test( t8_gtest_recursive t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_recursive.cxx ) -add_t8_test( t8_gtest_iterate_replace t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_iterate_replace.cxx ) -add_t8_test( t8_gtest_empty_local_tree t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_local_tree.cxx ) -add_t8_test( t8_gtest_empty_global_tree t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_global_tree.cxx ) +add_t8_test( NAME t8_gtest_permute_hole SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_permute_hole.cxx ) +add_t8_test( NAME t8_gtest_recursive SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_recursive.cxx ) +add_t8_test( NAME t8_gtest_iterate_replace SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_iterate_replace.cxx ) +add_t8_test( NAME t8_gtest_empty_local_tree SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_local_tree.cxx ) +add_t8_test( NAME t8_gtest_empty_global_tree SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_global_tree.cxx ) -add_t8_test( t8_gtest_geometry_occ t8_gtest_main.cxx t8_geometry/t8_geometry_implementations/t8_gtest_geometry_occ.cxx ) -add_t8_test( t8_gtest_geometry t8_gtest_main.cxx t8_geometry/t8_gtest_geometry.cxx ) -add_t8_test( t8_gtest_point_inside t8_gtest_main.cxx t8_geometry/t8_gtest_point_inside.cxx ) +add_t8_test( NAME t8_gtest_geometry_occ SOURCES t8_gtest_main.cxx t8_geometry/t8_geometry_implementations/t8_gtest_geometry_occ.cxx ) +add_t8_test( NAME t8_gtest_geometry SOURCES t8_gtest_main.cxx t8_geometry/t8_gtest_geometry.cxx ) +add_t8_test( NAME t8_gtest_point_inside SOURCES t8_gtest_main.cxx t8_geometry/t8_gtest_point_inside.cxx ) -add_t8_test( t8_gtest_vtk_reader t8_gtest_main.cxx t8_IO/t8_gtest_vtk_reader.cxx ) +add_t8_test( NAME t8_gtest_vtk_reader SOURCES t8_gtest_main.cxx t8_IO/t8_gtest_vtk_reader.cxx ) -add_t8_test( t8_gtest_nca t8_gtest_main.cxx t8_schemes/t8_gtest_nca.cxx ) -add_t8_test( t8_gtest_pyra_connectivity t8_gtest_main.cxx t8_schemes/t8_gtest_pyra_connectivity.cxx ) -add_t8_test( t8_gtest_face_neigh t8_gtest_main.cxx t8_schemes/t8_gtest_face_neigh.cxx ) -add_t8_test( t8_gtest_init_linear_id t8_gtest_main.cxx t8_schemes/t8_gtest_init_linear_id.cxx ) -add_t8_test( t8_gtest_ancestor t8_gtest_main.cxx t8_schemes/t8_gtest_ancestor.cxx ) -add_t8_test( t8_gtest_element_count_leaves t8_gtest_main.cxx t8_schemes/t8_gtest_element_count_leaves.cxx ) -add_t8_test( t8_gtest_element_ref_coords t8_gtest_main.cxx t8_schemes/t8_gtest_element_ref_coords.cxx ) -add_t8_test( t8_gtest_descendant t8_gtest_main.cxx t8_schemes/t8_gtest_descendant.cxx ) -add_t8_test( t8_gtest_find_parent t8_gtest_main.cxx t8_schemes/t8_gtest_find_parent.cxx ) -add_t8_test( t8_gtest_equal t8_gtest_main.cxx t8_schemes/t8_gtest_equal.cxx ) -add_t8_test( t8_gtest_successor t8_gtest_main.cxx t8_schemes/t8_gtest_successor.cxx ) -add_t8_test( t8_gtest_boundary_extrude t8_gtest_main.cxx t8_schemes/t8_gtest_boundary_extrude.cxx ) -add_t8_test( t8_gtest_face_descendant t8_gtest_main.cxx t8_schemes/t8_gtest_face_descendant.cxx ) -add_t8_test( t8_gtest_default t8_gtest_main.cxx t8_schemes/t8_gtest_default.cxx ) -add_t8_test( t8_gtest_child_parent_face t8_gtest_main.cxx t8_schemes/t8_gtest_child_parent_face.cxx ) \ No newline at end of file +add_t8_test( NAME t8_gtest_nca SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_nca.cxx ) +add_t8_test( NAME t8_gtest_pyra_connectivity SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_pyra_connectivity.cxx ) +add_t8_test( NAME t8_gtest_face_neigh SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_face_neigh.cxx ) +add_t8_test( NAME t8_gtest_init_linear_id SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_init_linear_id.cxx ) +add_t8_test( NAME t8_gtest_ancestor SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_ancestor.cxx ) +add_t8_test( NAME t8_gtest_element_count_leaves SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_element_count_leaves.cxx ) +add_t8_test( NAME t8_gtest_element_ref_coords SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_element_ref_coords.cxx ) +add_t8_test( NAME t8_gtest_descendant SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_descendant.cxx ) +add_t8_test( NAME t8_gtest_find_parent SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_find_parent.cxx ) +add_t8_test( NAME t8_gtest_equal SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_equal.cxx ) +add_t8_test( NAME t8_gtest_successor SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_successor.cxx ) +add_t8_test( NAME t8_gtest_boundary_extrude SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_boundary_extrude.cxx ) +add_t8_test( NAME t8_gtest_face_descendant SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_face_descendant.cxx ) +add_t8_test( NAME t8_gtest_default SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_default.cxx ) +add_t8_test( NAME t8_gtest_child_parent_face SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_child_parent_face.cxx ) \ No newline at end of file diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 2fa9dec85f..ca165aaa74 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -1,37 +1,23 @@ -add_executable( t8_step0 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step0_helloworld.cxx ) -target_link_libraries( t8_step0 PRIVATE T8 ) +function( add_t8_tutorial ) + set( options "" ) + set( oneValueArgs "NAME" ) + set( multiValueArgs "SOURCES" ) + cmake_parse_arguments( ADD_T8_TUTORIAL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) -add_executable( t8_step1 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step1_coarsemesh.cxx ) -target_link_libraries( t8_step1 PRIVATE T8 ) + add_executable( ${ADD_T8_TUTORIAL_NAME} ${ADD_T8_TUTORIAL_SOURCES} ) + target_link_libraries( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8 SC::SC ) + target_include_directories( ${ADD_T8_TUTORIAL_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) + if( T8CODE_ENABLE_MPI ) + target_compile_definitions( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8_ENABLE_MPI ) + target_compile_definitions( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8_ENABLE_MPIIO ) + endif() +endfunction() -add_executable( t8_step2 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step2_uniform_forest.cxx ) -target_link_libraries( t8_step2 PRIVATE T8 ) - -add_executable( t8_step3 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_main.cxx ) -target_include_directories( t8_step3 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( t8_step3 PRIVATE T8 ) - -add_executable( t8_step4 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step4_partition_balance_ghost.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step4_main.cxx ) -target_include_directories( t8_step4 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( t8_step4 PRIVATE T8 ) - -add_executable( t8_step5 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx - # ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_element_data_c_interface.c - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_element_data.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step5_main.cxx ) -target_include_directories( t8_step5 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( t8_step5 PRIVATE T8 ) - -add_executable( t8_step6 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step3_adapt_forest.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step6_stencil.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step6_main.cxx ) -target_include_directories( t8_step6 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( t8_step6 PRIVATE T8 ) - -add_executable( t8_step7 ${CMAKE_CURRENT_LIST_DIR}/general/t8_step7_interpolation.cxx - ${CMAKE_CURRENT_LIST_DIR}/general/t8_step7_main.cxx ) -target_include_directories( t8_step7 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( t8_step7 PRIVATE T8 ) \ No newline at end of file +add_t8_tutorial( NAME t8_step0_helloworld SOURCES general/t8_step0_helloworld.cxx ) +add_t8_tutorial( NAME t8_step1_coarsemesh SOURCES general/t8_step1_coarsemesh.cxx ) +add_t8_tutorial( NAME t8_step2_uniform_forest SOURCES general/t8_step2_uniform_forest.cxx ) +add_t8_tutorial( NAME t8_step3_adapt_forest SOURCES general/t8_step3_main.cxx general/t8_step3_adapt_forest.cxx ) +add_t8_tutorial( NAME t8_step4_partition_balance_ghost SOURCES general/t8_step4_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step4_partition_balance_ghost.cxx ) +add_t8_tutorial( NAME t8_step5_element_data SOURCES general/t8_step5_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step5_element_data.cxx ) +add_t8_tutorial( NAME t8_step6_stencil SOURCES general/t8_step6_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step6_stencil.cxx ) +add_t8_tutorial( NAME t8_step7_interpolation SOURCES general/t8_step7_main.cxx general/t8_step7_interpolation.cxx ) \ No newline at end of file From f863b2f3c2c58be6faa5e874dceebcc338b1863d Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:04:59 +0100 Subject: [PATCH 08/36] all tests exmaples and tutorials ported --- example/CMakeLists.txt | 40 +++++++++++++++++++++++++++++----------- tutorials/CMakeLists.txt | 19 +++++++++++-------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 626a732488..45775f13e8 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -19,17 +19,35 @@ function( add_t8_example ) endif() endfunction() -add_t8_example( NAME t8_advection SOURCES advect/t8_advection.cxx ) +add_t8_example( NAME t8_advection SOURCES advect/t8_advection.cxx ) -add_t8_example( NAME t8_cmesh_partition SOURCES cmesh/t8_cmesh_partition.cxx ) -add_t8_example( NAME t8_cmesh_set_join_by_vertices SOURCES cmesh/t8_cmesh_set_join_by_vertices.cxx ) -add_t8_example( NAME t8_cmesh_geometry_examples SOURCES cmesh/t8_cmesh_geometry_examples.cxx ) -add_t8_example( NAME t8_cmesh_create_partitioned SOURCES cmesh/t8_cmesh_create_partitioned.cxx ) -add_t8_example( NAME t8_cmesh_hypercube_pad SOURCES cmesh/t8_cmesh_hypercube_pad.cxx ) +add_t8_example( NAME t8_cmesh_partition SOURCES cmesh/t8_cmesh_partition.cxx ) +add_t8_example( NAME t8_cmesh_set_join_by_vertices SOURCES cmesh/t8_cmesh_set_join_by_vertices.cxx ) +add_t8_example( NAME t8_cmesh_geometry_examples SOURCES cmesh/t8_cmesh_geometry_examples.cxx ) +add_t8_example( NAME t8_cmesh_create_partitioned SOURCES cmesh/t8_cmesh_create_partitioned.cxx ) +add_t8_example( NAME t8_cmesh_hypercube_pad SOURCES cmesh/t8_cmesh_hypercube_pad.cxx ) -add_t8_example( NAME t8_face_neighbor SOURCES forest/t8_face_neighbor.cxx ) -add_t8_example( NAME t8_test_ghost SOURCES forest/t8_test_ghost.cxx ) -add_t8_example( NAME t8_test_face_iterate SOURCES forest/t8_test_face_iterate.cxx ) -add_t8_example( NAME t8_test_ghost_large_level_diff SOURCES forest/t8_test_ghost_large_level_diff.cxx ) +add_t8_example( NAME t8_face_neighbor SOURCES forest/t8_face_neighbor.cxx ) +add_t8_example( NAME t8_test_ghost SOURCES forest/t8_test_ghost.cxx ) +add_t8_example( NAME t8_test_face_iterate SOURCES forest/t8_test_face_iterate.cxx ) +add_t8_example( NAME t8_test_ghost_large_level_diff SOURCES forest/t8_test_ghost_large_level_diff.cxx ) -add_t8_example( NAME t8_example_geometries SOURCES geometry/t8_example_geometries.cxx ) \ No newline at end of file +add_t8_example( NAME t8_example_geometries SOURCES geometry/t8_example_geometries.cxx ) + +add_t8_example( NAME t8_cmesh_load_save SOURCES IO/cmesh/t8_cmesh_load_save.cxx ) +add_t8_example( NAME t8_read_msh_file SOURCES IO/cmesh/gmsh/t8_read_msh_file.cxx ) +add_t8_example( NAME t8_load_and_refine_square_w_hole SOURCES IO/cmesh/gmsh/t8_load_and_refine_square_w_hole.cxx ) +add_t8_example( NAME t8_write_cmesh_netcdf SOURCES IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx ) +add_t8_example( NAME t8_read_tetgen SOURCES IO/cmesh/tetgen/t8_read_tetgen_file.cxx ) +add_t8_example( NAME t8_time_tetgen SOURCES IO/cmesh/tetgen/t8_time_tetgen_file.cxx ) +add_t8_example( NAME t8_forest_tetgen SOURCES IO/cmesh/tetgen/t8_forest_from_tetgen.cxx ) +add_t8_example( NAME t8_read_triangle SOURCES IO/cmesh/triangle/t8_read_triangle_file.cxx ) +add_t8_example( NAME t8_cmesh_read_from_vtk SOURCES IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx ) +add_t8_example( NAME t8_netcdf_compilation_status SOURCES IO/forest/netcdf/t8_netcdf_status.c ) +add_t8_example( NAME t8_write_forest_netcdf SOURCES IO/forest/netcdf/t8_write_forest_netcdf.cxx ) + +add_t8_example( NAME t8_example_spheres SOURCES remove/t8_example_spheres.cxx ) +add_t8_example( NAME t8_example_gauss_blob SOURCES remove/t8_example_gauss_blob.cxx ) +add_t8_example( NAME t8_example_empty_trees SOURCES remove/t8_example_empty_trees.cxx ) + +add_t8_example( NAME t8_version SOURCES version/t8_version.cxx ) \ No newline at end of file diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index ca165aaa74..38834e84b6 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -13,11 +13,14 @@ function( add_t8_tutorial ) endif() endfunction() -add_t8_tutorial( NAME t8_step0_helloworld SOURCES general/t8_step0_helloworld.cxx ) -add_t8_tutorial( NAME t8_step1_coarsemesh SOURCES general/t8_step1_coarsemesh.cxx ) -add_t8_tutorial( NAME t8_step2_uniform_forest SOURCES general/t8_step2_uniform_forest.cxx ) -add_t8_tutorial( NAME t8_step3_adapt_forest SOURCES general/t8_step3_main.cxx general/t8_step3_adapt_forest.cxx ) -add_t8_tutorial( NAME t8_step4_partition_balance_ghost SOURCES general/t8_step4_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step4_partition_balance_ghost.cxx ) -add_t8_tutorial( NAME t8_step5_element_data SOURCES general/t8_step5_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step5_element_data.cxx ) -add_t8_tutorial( NAME t8_step6_stencil SOURCES general/t8_step6_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step6_stencil.cxx ) -add_t8_tutorial( NAME t8_step7_interpolation SOURCES general/t8_step7_main.cxx general/t8_step7_interpolation.cxx ) \ No newline at end of file +add_t8_tutorial( NAME t8_step0_helloworld SOURCES general/t8_step0_helloworld.cxx ) +add_t8_tutorial( NAME t8_step1_coarsemesh SOURCES general/t8_step1_coarsemesh.cxx ) +add_t8_tutorial( NAME t8_step2_uniform_forest SOURCES general/t8_step2_uniform_forest.cxx ) +add_t8_tutorial( NAME t8_step3_adapt_forest SOURCES general/t8_step3_main.cxx general/t8_step3_adapt_forest.cxx ) +add_t8_tutorial( NAME t8_step4_partition_balance_ghost SOURCES general/t8_step4_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step4_partition_balance_ghost.cxx ) +add_t8_tutorial( NAME t8_step5_element_data SOURCES general/t8_step5_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step5_element_data.cxx ) +add_t8_tutorial( NAME t8_step6_stencil SOURCES general/t8_step6_main.cxx general/t8_step3_adapt_forest.cxx general/t8_step6_stencil.cxx ) +add_t8_tutorial( NAME t8_step7_interpolation SOURCES general/t8_step7_main.cxx general/t8_step7_interpolation.cxx ) +add_t8_tutorial( NAME t8_tutorial_build_cmesh SOURCES general/t8_tutorial_build_cmesh.cxx general/t8_tutorial_build_cmesh_main.cxx) +add_t8_tutorial( NAME t8_tutorial_search SOURCES general/t8_tutorial_search.cxx general/t8_step3_adapt_forest.cxx ) +add_t8_tutorial( NAME t8_features_curved_meshes SOURCES features/t8_features_curved_meshes.cxx) \ No newline at end of file From 554adbe57cb126211ff4964f4548bef3bf3e9859 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:51:51 +0100 Subject: [PATCH 09/36] t8_gtest_version OK --- example/CMakeLists.txt | 4 ---- src/CMakeLists.txt | 1 + test/CMakeLists.txt | 4 ---- tutorials/CMakeLists.txt | 4 ---- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 45775f13e8..ff6c9c2e5f 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -13,10 +13,6 @@ function( add_t8_example ) add_executable( ${ADD_T8_EXAMPLE_NAME} ${ADD_T8_EXAMPLE_SOURCES} ) target_link_libraries( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8 T8ex SC::SC ) target_include_directories( ${ADD_T8_EXAMPLE_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) - if( T8CODE_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8_ENABLE_MPIIO ) - endif() endfunction() add_t8_example( NAME t8_advection SOURCES advect/t8_advection.cxx ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5cd7918de1..fcc153cd2c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,6 +93,7 @@ target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) +target_compile_definitions( T8 PUBLIC T8_VERSION_POINT=1.??? ) if ( T8CODE_ENABLE_MPI ) target_compile_definitions( T8 PUBLIC T8_ENABLE_MPI ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f224a8fcbe..e1058bece4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,10 +9,6 @@ function( add_t8_test ) add_executable( ${ADD_T8_TEST_NAME} ${ADD_T8_TEST_SOURCES} ) target_link_libraries( ${ADD_T8_TEST_NAME} PRIVATE T8 gtest ) - if( T8CODE_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_TEST_NAME} PRIVATE T8_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_TEST_NAME} PRIVATE T8_ENABLE_MPIIO ) - endif() add_test( NAME ${ADD_T8_TEST_NAME} COMMAND ./${ADD_T8_TEST_NAME} ) endfunction() diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 38834e84b6..e77d20e3e0 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -7,10 +7,6 @@ function( add_t8_tutorial ) add_executable( ${ADD_T8_TUTORIAL_NAME} ${ADD_T8_TUTORIAL_SOURCES} ) target_link_libraries( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8 SC::SC ) target_include_directories( ${ADD_T8_TUTORIAL_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) - if( T8CODE_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8_ENABLE_MPI ) - target_compile_definitions( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8_ENABLE_MPIIO ) - endif() endfunction() add_t8_tutorial( NAME t8_step0_helloworld SOURCES general/t8_step0_helloworld.cxx ) From a8fc0eaf2e4801376687c1be42485a1ee30e4328 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:15:07 +0100 Subject: [PATCH 10/36] libT8.* => libt8.* --- CMakeLists.txt | 9 ++++++--- src/CMakeLists.txt | 36 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a8b757774..ae6f4f804b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,11 @@ add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) +install( TARGETS t8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + +add_library( T8 INTERFACE IMPORTED GLOBAL ) +target_link_libraries( T8 INTERFACE t8 ) + if ( T8CODE_BUILD_TESTS ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/test ) endif() @@ -38,6 +43,4 @@ endif() if ( T8CODE_BUILD_EXAMPLES ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/example ) -endif() - -install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) \ No newline at end of file +endif() \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fcc153cd2c..3da5ddb93c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ -add_library( T8 ) -target_include_directories( T8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) -target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC $<$:MPI::MPI_C> ) -target_sources( T8 PRIVATE +add_library( t8 ) +target_include_directories( t8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) +target_link_libraries( t8 PUBLIC P4EST::P4EST SC::SC $<$:MPI::MPI_C> ) +target_sources( t8 PRIVATE t8.c t8_eclass.c t8_mesh.c @@ -81,21 +81,21 @@ target_sources( T8 PRIVATE t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_connectivity.c ) -target_compile_definitions( T8 PUBLIC T8_CMAKE_BUILD ) -target_compile_definitions( T8 PUBLIC T8_CC="${CMAKE_C_COMPILER}" ) -target_compile_definitions( T8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) -target_compile_definitions( T8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) -target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) -target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) -target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) +target_compile_definitions( t8 PUBLIC T8_CMAKE_BUILD ) +target_compile_definitions( t8 PUBLIC T8_CC="${CMAKE_C_COMPILER}" ) +target_compile_definitions( t8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) +target_compile_definitions( t8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) +target_compile_definitions( t8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) +target_compile_definitions( t8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) +target_compile_definitions( t8 PUBLIC T8_LIBS="???" ) -target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) -target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) -target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) -target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) -target_compile_definitions( T8 PUBLIC T8_VERSION_POINT=1.??? ) +target_compile_definitions( t8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) +target_compile_definitions( t8 PUBLIC T8_VERSION="1.6.1.???" ) +target_compile_definitions( t8 PUBLIC T8_VERSION_MAJOR=1 ) +target_compile_definitions( t8 PUBLIC T8_VERSION_MINOR=6 ) +target_compile_definitions( t8 PUBLIC T8_VERSION_POINT=1.??? ) if ( T8CODE_ENABLE_MPI ) - target_compile_definitions( T8 PUBLIC T8_ENABLE_MPI ) - target_compile_definitions( T8 PUBLIC T8_ENABLE_MPIIO ) + target_compile_definitions( t8 PUBLIC T8_ENABLE_MPI ) + target_compile_definitions( t8 PUBLIC T8_ENABLE_MPIIO ) endif() \ No newline at end of file From 81165395f39caefd28abf0869afbab16f0e63222 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:35:46 +0100 Subject: [PATCH 11/36] libt8.a / libt8.so option --- CMakeLists.txt | 22 ++++++++++------- src/CMakeLists.txt | 59 +++++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae6f4f804b..cde552502a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,19 +2,28 @@ cmake_minimum_required( VERSION 3.16 ) project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." LANGUAGES C CXX ) include( CTest ) + option( T8CODE_ENABLE_MPI "" ON ) +option( T8CODE_ENABLE_DYNAMIC_LINKAGE "" ON ) + option( T8CODE_BUILD_TESTS "" ON ) option( T8CODE_BUILD_TUTORIALS "" ON ) option( T8CODE_BUILD_EXAMPLES "" ON ) -if( NOT CMAKE_CXX_STANDARD ) - set( CMAKE_CXX_STANDARD 17 ) + +if( NOT CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE "Release" ) endif() if( NOT CMAKE_INSTALL_PREFIX ) set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build ) endif() +if( NOT CMAKE_CXX_STANDARD ) + set( CMAKE_CXX_STANDARD 17 ) +endif() + + if( T8CODE_ENABLE_MPI ) find_package( MPI COMPONENTS C REQUIRED ) if( NOT MPIEXEC_EXECUTABLE ) @@ -24,14 +33,11 @@ if( T8CODE_ENABLE_MPI ) set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo endif() -add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) -add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc EXCLUDE_FROM_ALL ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est EXCLUDE_FROM_ALL ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) -install( TARGETS t8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) - -add_library( T8 INTERFACE IMPORTED GLOBAL ) -target_link_libraries( T8 INTERFACE t8 ) +install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) if ( T8CODE_BUILD_TESTS ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/test ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3da5ddb93c..c51b566d0b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,37 @@ -add_library( t8 ) -target_include_directories( t8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) -target_link_libraries( t8 PUBLIC P4EST::P4EST SC::SC $<$:MPI::MPI_C> ) -target_sources( t8 PRIVATE +if ( ${T8CODE_ENABLE_DYNAMIC_LINKAGE} ) + add_library( T8 SHARED ) + set_target_properties( T8 PROPERTIES POSITION_INDEPENDENT_CODE ON ) +else() + add_library( T8 STATIC ) +endif() + +set_target_properties( T8 PROPERTIES OUTPUT_NAME t8 ) + +target_compile_definitions( T8 PUBLIC T8_CMAKE_BUILD ) +target_compile_definitions( T8 PUBLIC T8_CC="${CMAKE_C_COMPILER}" ) +target_compile_definitions( T8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) +target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) +target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) + +# There has to be an elegant solution to embed the version and commit here... +target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) +target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) +target_compile_definitions( T8 PUBLIC T8_VERSION_POINT=1.??? ) + +target_include_directories( T8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) +target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC ) + +if ( T8CODE_ENABLE_MPI ) + target_compile_definitions( T8 PUBLIC T8_ENABLE_MPI ) + target_compile_definitions( T8 PUBLIC T8_ENABLE_MPIIO ) + target_link_libraries( T8 PUBLIC MPI::MPI_C ) +endif() + +target_sources( T8 PRIVATE t8.c t8_eclass.c t8_mesh.c @@ -79,23 +109,4 @@ target_sources( t8 PRIVATE t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.cxx t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.c t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_connectivity.c -) - -target_compile_definitions( t8 PUBLIC T8_CMAKE_BUILD ) -target_compile_definitions( t8 PUBLIC T8_CC="${CMAKE_C_COMPILER}" ) -target_compile_definitions( t8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) -target_compile_definitions( t8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) -target_compile_definitions( t8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) -target_compile_definitions( t8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) -target_compile_definitions( t8 PUBLIC T8_LIBS="???" ) - -target_compile_definitions( t8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) -target_compile_definitions( t8 PUBLIC T8_VERSION="1.6.1.???" ) -target_compile_definitions( t8 PUBLIC T8_VERSION_MAJOR=1 ) -target_compile_definitions( t8 PUBLIC T8_VERSION_MINOR=6 ) -target_compile_definitions( t8 PUBLIC T8_VERSION_POINT=1.??? ) - -if ( T8CODE_ENABLE_MPI ) - target_compile_definitions( t8 PUBLIC T8_ENABLE_MPI ) - target_compile_definitions( t8 PUBLIC T8_ENABLE_MPIIO ) -endif() \ No newline at end of file +) \ No newline at end of file From 652291a0440aea56e3c96261499ab689303ad87d Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:49:54 +0100 Subject: [PATCH 12/36] small cleanups --- CMakeLists.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cde552502a..2cf9c9ccf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,25 +3,27 @@ project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-ba include( CTest ) -option( T8CODE_ENABLE_MPI "" ON ) -option( T8CODE_ENABLE_DYNAMIC_LINKAGE "" ON ) +option( T8CODE_ENABLE_MPI "Enable t8code's MPI support" ON ) +option( T8CODE_ENABLE_DYNAMIC_LINKAGE "Build t8code as a dynamic library" ON ) -option( T8CODE_BUILD_TESTS "" ON ) -option( T8CODE_BUILD_TUTORIALS "" ON ) -option( T8CODE_BUILD_EXAMPLES "" ON ) +option( T8CODE_BUILD_TESTS "Build t8code's automated tests" ON ) +option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON ) +option( T8CODE_BUILD_EXAMPLES "Build t8code's examples" ON ) if( NOT CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE "Release" ) endif() -if( NOT CMAKE_INSTALL_PREFIX ) - set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build ) -endif() +set( CMAKE_C_STANDARD 11 ) +set( CMAKE_C_STANDARD_REQUIRED ON ) +set( CMAKE_C_EXTENSIONS OFF ) +list( APPEND CMAKE_C_FLAGS "-Wall" ) -if( NOT CMAKE_CXX_STANDARD ) - set( CMAKE_CXX_STANDARD 17 ) -endif() +set( CMAKE_CXX_STANDARD 17 ) +set( CMAKE_CXX_STANDARD_REQUIRED ON ) +set( CMAKE_CXX_EXTENSIONS OFF ) +list( APPEND CMAKE_CXX_FLAGS "-Wall" ) if( T8CODE_ENABLE_MPI ) From 0136dfb1f323384ebbe671c27fa8e261ba5e5953 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:40:35 +0100 Subject: [PATCH 13/36] added public headers to install --- CMakeLists.txt | 6 ++--- src/CMakeLists.txt | 64 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cf9c9ccf7..5c4e7e6c0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,12 +35,10 @@ if( T8CODE_ENABLE_MPI ) set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo endif() -add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc EXCLUDE_FROM_ALL ) -add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est EXCLUDE_FROM_ALL ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) -install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) - if ( T8CODE_BUILD_TESTS ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/test ) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c51b566d0b..cb66477323 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -108,5 +108,65 @@ target_sources( T8 PRIVATE t8_schemes/t8_default/t8_default_vertex/t8_dvertex_bits.c t8_schemes/t8_default/t8_default_pyramid/t8_default_pyramid_cxx.cxx t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.c - t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_connectivity.c -) \ No newline at end of file + t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_connectivity.c +) + +set( T8_PUBLIC_HEADERS + t8.h + t8_eclass.h + t8_mesh.h + t8_element_cxx.hxx + t8_element.h + t8_element_c_interface.h + t8_refcount.h + t8_cmesh.h t8_cmesh_triangle.h + t8_cmesh_tetgen.h t8_cmesh_readmshfile.h + t8_cmesh_vtk_writer.h + t8_cmesh_vtk_reader.hxx + t8_vec.h + t8_version.h + t8_vtk.h + t8_cmesh_netcdf.h + t8_forest_netcdf.h + t8_element_shape.h + t8_netcdf.h + t8_cmesh/t8_cmesh_testcases.h + t8_cmesh/t8_cmesh_save.h + t8_cmesh/t8_cmesh_examples.h + t8_cmesh/t8_cmesh_geometry.h + t8_cmesh/t8_cmesh_helpers.h + t8_cmesh/t8_cmesh_occ.hxx + t8_data/t8_shmem.h + t8_data/t8_containers.h + t8_forest/t8_forest.h + t8_forest/t8_forest_general.h + t8_forest/t8_forest_geometrical.h + t8_forest/t8_forest_profiling.h + t8_forest/t8_forest_io.h + t8_forest/t8_forest_adapt.h + t8_forest/t8_forest_vtk.h + t8_forest/t8_forest_to_vtkUnstructured.hxx + t8_forest/t8_forest_iterate.h + t8_forest/t8_forest_partition.h + t8_geometry/t8_geometry.h + t8_geometry/t8_geometry_base.hxx + t8_geometry/t8_geometry_base.h + t8_geometry/t8_geometry_with_vertices.hxx + t8_geometry/t8_geometry_with_vertices.h + t8_geometry/t8_geometry_helpers.h + t8_geometry/t8_geometry_implementations/t8_geometry_linear.h + t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h + t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_examples.h + t8_geometry/t8_geometry_implementations/t8_geometry_occ.h + t8_geometry/t8_geometry_implementations/t8_geometry_occ.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx + t8_vtk/t8_vtk_reader.hxx + t8_vtk/t8_vtk_types.h +) + +install( FILES ${T8_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include ) +install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) \ No newline at end of file From 52c8156fdf4df8ec1e2089a96cb54a58b9cd7ccd Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:38:14 +0100 Subject: [PATCH 14/36] libT8ex => libt8example --- example/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index ff6c9c2e5f..62439948fd 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,8 +1,8 @@ # Conditionally adding new sources to the main T8 target as in the original BS looked wrong... -add_library( T8ex ) -target_sources( T8ex PRIVATE common/t8_example_common.cxx common/t8_example_common_functions.cxx ) -target_include_directories( T8ex PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) -target_link_libraries( T8ex PRIVATE T8 ) +add_library( t8example ) +target_sources( t8example PRIVATE common/t8_example_common.cxx common/t8_example_common_functions.cxx ) +target_include_directories( t8example PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) +target_link_libraries( t8example PRIVATE T8 ) function( add_t8_example ) set( options "" ) @@ -11,7 +11,7 @@ function( add_t8_example ) cmake_parse_arguments( ADD_T8_EXAMPLE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) add_executable( ${ADD_T8_EXAMPLE_NAME} ${ADD_T8_EXAMPLE_SOURCES} ) - target_link_libraries( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8 T8ex SC::SC ) + target_link_libraries( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8 t8example SC::SC ) target_include_directories( ${ADD_T8_EXAMPLE_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) endfunction() From b5ac255d31edee553784288e73477dcf8837af59 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:50:51 +0100 Subject: [PATCH 15/36] added tutorials and examples to the install --- example/CMakeLists.txt | 2 ++ tutorials/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 62439948fd..3962326739 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -13,6 +13,8 @@ function( add_t8_example ) add_executable( ${ADD_T8_EXAMPLE_NAME} ${ADD_T8_EXAMPLE_SOURCES} ) target_link_libraries( ${ADD_T8_EXAMPLE_NAME} PRIVATE T8 t8example SC::SC ) target_include_directories( ${ADD_T8_EXAMPLE_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) + + install( TARGETS ${ADD_T8_EXAMPLE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/example ) endfunction() add_t8_example( NAME t8_advection SOURCES advect/t8_advection.cxx ) diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index e77d20e3e0..9d291eb3d3 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -7,6 +7,8 @@ function( add_t8_tutorial ) add_executable( ${ADD_T8_TUTORIAL_NAME} ${ADD_T8_TUTORIAL_SOURCES} ) target_link_libraries( ${ADD_T8_TUTORIAL_NAME} PRIVATE T8 SC::SC ) target_include_directories( ${ADD_T8_TUTORIAL_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) + + install( TARGETS ${ADD_T8_TUTORIAL_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/tutorials ) endfunction() add_t8_tutorial( NAME t8_step0_helloworld SOURCES general/t8_step0_helloworld.cxx ) From 673dfcc7dce8ae113e2dd6593afc72a00c19d370 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:02:46 +0100 Subject: [PATCH 16/36] added T8CODE_ENABLE_VTK flag --- CMakeLists.txt | 9 +++++++-- src/CMakeLists.txt | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c4e7e6c0b..88545d7fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,9 @@ project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-ba include( CTest ) -option( T8CODE_ENABLE_MPI "Enable t8code's MPI support" ON ) -option( T8CODE_ENABLE_DYNAMIC_LINKAGE "Build t8code as a dynamic library" ON ) +option( T8CODE_ENABLE_MPI "Enable t8code's MPI dependant features" ON ) +option( T8CODE_ENABLE_VTK "Enable t8code's VTK dependant features" OFF ) +option( T8CODE_ENABLE_DYNAMIC_LINKAGE "Build t8code as a shared library" ON ) option( T8CODE_BUILD_TESTS "Build t8code's automated tests" ON ) option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON ) @@ -35,6 +36,10 @@ if( T8CODE_ENABLE_MPI ) set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo endif() +if( T8CODE_ENABLE_VTK ) + find_package( VTK REQUIRED ) +endif() + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb66477323..6fd5a833df 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,11 @@ if ( T8CODE_ENABLE_MPI ) target_link_libraries( T8 PUBLIC MPI::MPI_C ) endif() +if( T8CODE_ENABLE_VTK ) + target_include_directories( T8 PUBLIC ${VTK_INCLUDE_DIRS} ) + target_link_libraries( T8 PUBLIC ${VTK_LIBRARY_DIRS} ) +endif() + target_sources( T8 PRIVATE t8.c t8_eclass.c From 89bcd5acafa16298f3a13cbe8e2c0a2a81aea347 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:06:47 +0100 Subject: [PATCH 17/36] minor cleanups --- CMakeLists.txt | 10 +++++----- src/CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88545d7fe4..5ae666101e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,14 +3,14 @@ project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-ba include( CTest ) -option( T8CODE_ENABLE_MPI "Enable t8code's MPI dependant features" ON ) -option( T8CODE_ENABLE_VTK "Enable t8code's VTK dependant features" OFF ) -option( T8CODE_ENABLE_DYNAMIC_LINKAGE "Build t8code as a shared library" ON ) - +option( T8CODE_BUILD_AS_SHARED_LIBRARY "Whether t8code should be built as a shared or a static library" ON ) option( T8CODE_BUILD_TESTS "Build t8code's automated tests" ON ) option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON ) option( T8CODE_BUILD_EXAMPLES "Build t8code's examples" ON ) +option( T8CODE_ENABLE_MPI "Enable t8code's features which rely on MPI" ON ) +option( T8CODE_ENABLE_VTK "Enable t8code's features which rely on VTK" OFF ) + if( NOT CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE "Release" ) @@ -30,7 +30,7 @@ list( APPEND CMAKE_CXX_FLAGS "-Wall" ) if( T8CODE_ENABLE_MPI ) find_package( MPI COMPONENTS C REQUIRED ) if( NOT MPIEXEC_EXECUTABLE ) - message( FATAL_ERROR "MPIEXEC is missing, MPI will not work properly" ) + message( FATAL_ERROR "MPIEXEC was not found" ) endif() set( SC_ENABLE_MPI ON ) set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6fd5a833df..86464393e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -if ( ${T8CODE_ENABLE_DYNAMIC_LINKAGE} ) +if ( ${T8CODE_BUILD_AS_SHARED_LIBRARY} ) add_library( T8 SHARED ) set_target_properties( T8 PROPERTIES POSITION_INDEPENDENT_CODE ON ) else() @@ -13,7 +13,7 @@ target_compile_definitions( T8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) -target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) +target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) # Not sure what this flag is supposed to be... # There has to be an elegant solution to embed the version and commit here... target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) From 7989b4f984f8fe927b7f447705ef791201eaba30 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:40:11 +0100 Subject: [PATCH 18/36] better #defines for t8 version --- src/CMakeLists.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86464393e3..33487b4092 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,12 +15,19 @@ target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) # Not sure what this flag is supposed to be... -# There has to be an elegant solution to embed the version and commit here... -target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 1.6.1.???" ) -target_compile_definitions( T8 PUBLIC T8_VERSION="1.6.1.???" ) -target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=1 ) -target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=6 ) -target_compile_definitions( T8 PUBLIC T8_VERSION_POINT=1.??? ) + +find_package( Git REQUIRED ) +execute_process( COMMAND ${GIT_EXECUTABLE} describe --tags COMMAND cut -c 2- OUTPUT_VARIABLE T8CODE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f1 OUTPUT_VARIABLE T8CODE_VERSION_MAJOR OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f2 OUTPUT_VARIABLE T8CODE_VERSION_MINOR OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f3 OUTPUT_VARIABLE T8CODE_VERSION_POINT OUTPUT_STRIP_TRAILING_WHITESPACE ) + +target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 ${T8CODE_VERSION}" ) +target_compile_definitions( T8 PUBLIC T8_VERSION="${T8CODE_VERSION}" ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MAJOR=${T8CODE_VERSION_MAJOR} ) +target_compile_definitions( T8 PUBLIC T8_VERSION_MINOR=${T8CODE_VERSION_MINOR} ) +target_compile_definitions( T8 PUBLIC T8_VERSION_POINT=${T8CODE_VERSION_POINT} ) + target_include_directories( T8 PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) target_link_libraries( T8 PUBLIC P4EST::P4EST SC::SC ) From 4e71dc8a8d38a86d2acda9da4ba388975128802a Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:22:57 +0100 Subject: [PATCH 19/36] bug fix --- src/CMakeLists.txt | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33487b4092..cddf6060bd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,10 +17,23 @@ target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) # Not sure what this flag find_package( Git REQUIRED ) -execute_process( COMMAND ${GIT_EXECUTABLE} describe --tags COMMAND cut -c 2- OUTPUT_VARIABLE T8CODE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) -execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f1 OUTPUT_VARIABLE T8CODE_VERSION_MAJOR OUTPUT_STRIP_TRAILING_WHITESPACE ) -execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f2 OUTPUT_VARIABLE T8CODE_VERSION_MINOR OUTPUT_STRIP_TRAILING_WHITESPACE ) -execute_process( COMMAND echo ${T8CODE_VERSION} COMMAND cut -d. -f3 OUTPUT_VARIABLE T8CODE_VERSION_POINT OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND ${GIT_EXECUTABLE} describe --tags + COMMAND cut -c 2- + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE T8CODE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} + COMMAND cut -d. -f1 + OUTPUT_VARIABLE T8CODE_VERSION_MAJOR + OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} + COMMAND cut -d. -f2 + OUTPUT_VARIABLE T8CODE_VERSION_MINOR + OUTPUT_STRIP_TRAILING_WHITESPACE ) +execute_process( COMMAND echo ${T8CODE_VERSION} + COMMAND cut -d. -f3 + OUTPUT_VARIABLE T8CODE_VERSION_POINT + OUTPUT_STRIP_TRAILING_WHITESPACE ) target_compile_definitions( T8 PUBLIC T8_PACKAGE_STRING="t8 ${T8CODE_VERSION}" ) target_compile_definitions( T8 PUBLIC T8_VERSION="${T8CODE_VERSION}" ) From 1211e31f2690ea43450d5e57ac69da4bf0a9cc21 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:05:32 +0100 Subject: [PATCH 20/36] override default for libsc's BUILD_SHARED_LIBS --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ae666101e..4c550218e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ if( T8CODE_ENABLE_VTK ) find_package( VTK REQUIRED ) endif() +# Overide default for this libsc option +set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" ) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) From 51d13262aa00496a0ba045804cf8392c50d6452e Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:07:30 +0100 Subject: [PATCH 21/36] typo fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c550218e2..4b03340eb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ if( T8CODE_ENABLE_VTK ) find_package( VTK REQUIRED ) endif() -# Overide default for this libsc option +# Override default for this libsc option set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) From 2376154d2f5ca61d2a3b377f3def21c56fbc1f15 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:38:28 +0100 Subject: [PATCH 22/36] Update CMakeLists.txt --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cddf6060bd..3bd230830b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,7 @@ target_compile_definitions( T8 PUBLIC T8_CFLAGS="${CMAKE_C_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_CPP="${CMAKE_CXX_COMPILER}" ) target_compile_definitions( T8 PUBLIC T8_CPPFLAGS="${CMAKE_CXX_FLAGS}" ) target_compile_definitions( T8 PUBLIC T8_LDFLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ) -target_compile_definitions( T8 PUBLIC T8_LIBS="???" ) # Not sure what this flag is supposed to be... +target_compile_definitions( T8 PUBLIC T8_LIBS="Not available with CMake builds" ) find_package( Git REQUIRED ) @@ -194,4 +194,4 @@ set( T8_PUBLIC_HEADERS ) install( FILES ${T8_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include ) -install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) \ No newline at end of file +install( TARGETS T8 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) From 0a6306ae262cf76fce5ff9b5bb08fcb9badb1654 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:38:22 +0100 Subject: [PATCH 23/36] Update CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b03340eb6..d31fdfcdfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,9 @@ endif() # Override default for this libsc option set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" ) +# Prevent `libsc` and `p4est` from overwriting the default install prefix. +set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) From dbde5d720bdc68b65151258537b7b0da93127abc Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:39:47 +0100 Subject: [PATCH 24/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3bd230830b..2fad9574a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,7 +53,7 @@ endif() if( T8CODE_ENABLE_VTK ) target_include_directories( T8 PUBLIC ${VTK_INCLUDE_DIRS} ) - target_link_libraries( T8 PUBLIC ${VTK_LIBRARY_DIRS} ) + target_link_libraries( T8 PUBLIC ${VTK_LIBRARIES} ) endif() target_sources( T8 PRIVATE From 9a463246382112d6c22482048aee3009e6ae3154 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:15:34 +0100 Subject: [PATCH 25/36] Update CMakeLists.txt --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2fad9574a3..8f85d7c12f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,6 +52,8 @@ if ( T8CODE_ENABLE_MPI ) endif() if( T8CODE_ENABLE_VTK ) + target_compile_definitions( T8 PUBLIC T8_VTK_VERSION_USED="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" ) + target_compile_definitions( T8 PUBLIC T8_WITH_VTK=1 ) target_include_directories( T8 PUBLIC ${VTK_INCLUDE_DIRS} ) target_link_libraries( T8 PUBLIC ${VTK_LIBRARIES} ) endif() From 5f5792b176c69462bcff1533bfafa1904f1d59c4 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:09:29 +0100 Subject: [PATCH 26/36] Update example/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- example/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 3962326739..a44b444a33 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -3,6 +3,7 @@ add_library( t8example ) target_sources( t8example PRIVATE common/t8_example_common.cxx common/t8_example_common_functions.cxx ) target_include_directories( t8example PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ) target_link_libraries( t8example PRIVATE T8 ) +install( TARGETS t8example DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) function( add_t8_example ) set( options "" ) From 0bb7d83d01ea3cc652e519a360bf75f11f372a3f Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:10:02 +0100 Subject: [PATCH 27/36] Update CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d31fdfcdfb..5e07b82cb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,11 @@ set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" ) # Prevent `libsc` and `p4est` from overwriting the default install prefix. set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) +# Rpath options necessary for shared library install to work correctly in user projects. +set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) +set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) + add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src ) From efa5975d8f0960c7e05e09c2946ac9b0f721a5f7 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:10:46 +0100 Subject: [PATCH 28/36] Update test/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e1058bece4..e0e627462b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,11 @@ function( add_t8_test ) add_test( NAME ${ADD_T8_TEST_NAME} COMMAND ./${ADD_T8_TEST_NAME} ) endfunction() +# Copy test files to build folder so that the t8_test programs can find them. +function( copy_test_file TEST_FILE_NAME ) + configure_file(${CMAKE_CURRENT_LIST_DIR}/testfiles/${TEST_FILE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/test/testfiles/${TEST_FILE_NAME} COPYONLY) +endfunction() + add_t8_test( NAME t8_gtest_cmesh_bcast SOURCES t8_gtest_main.cxx t8_cmesh/t8_gtest_bcast.cxx ) add_t8_test( NAME t8_gtest_eclass SOURCES t8_gtest_main.cxx t8_gtest_eclass.cxx ) add_t8_test( NAME t8_gtest_vec SOURCES t8_gtest_main.cxx t8_gtest_vec.cxx ) From f7e6ffef95c36fcc374d36a25c5be52338b98800 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:11:16 +0100 Subject: [PATCH 29/36] Update test/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- test/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e0e627462b..5cb0480826 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -76,4 +76,11 @@ add_t8_test( NAME t8_gtest_successor SOURCES t8_gtest_main.cxx t8_sc add_t8_test( NAME t8_gtest_boundary_extrude SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_boundary_extrude.cxx ) add_t8_test( NAME t8_gtest_face_descendant SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_face_descendant.cxx ) add_t8_test( NAME t8_gtest_default SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_default.cxx ) -add_t8_test( NAME t8_gtest_child_parent_face SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_child_parent_face.cxx ) \ No newline at end of file +add_t8_test( NAME t8_gtest_child_parent_face SOURCES t8_gtest_main.cxx t8_schemes/t8_gtest_child_parent_face.cxx ) + +copy_test_file( test_cube_unstructured_1.inp ) +copy_test_file( test_cube_unstructured_2.inp ) +copy_test_file( test_vtk_tri.vtu ) +copy_test_file( test_vtk_cube.vtp ) +copy_test_file( test_parallel_file.pvtu ) +copy_test_file( test_polydata.pvtp ) From 450cd7359155b872bcf0bea1950d8b2ece217801 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:33:16 +0100 Subject: [PATCH 30/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8f85d7c12f..1f67b17506 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,7 +67,7 @@ target_sources( T8 PRIVATE t8_element_c_interface.cxx t8_refcount.c t8_cmesh/t8_cmesh.c - t8_cmesh/t8_cmesh_occ.cxx + t8_cmesh/t8_cmesh_cad.cxx t8_cmesh/t8_cmesh_cxx.cxx t8_cmesh/t8_cmesh_triangle.c t8_cmesh/t8_cmesh_vtk_writer.c From 3a014f08ccaada758d4f0439b70479a0e81c13a3 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:33:41 +0100 Subject: [PATCH 31/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f67b17506..687396e408 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,7 +93,7 @@ target_sources( T8 PRIVATE t8_geometry/t8_geometry_base.cxx t8_geometry/t8_geometry_with_vertices.cxx t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx - t8_geometry/t8_geometry_implementations/t8_geometry_occ.cxx + t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx From b21289b3e5a7db480ce8d4cf6adc4b363ffb9940 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:33:54 +0100 Subject: [PATCH 32/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 687396e408..c5a7ce13e4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -162,7 +162,7 @@ set( T8_PUBLIC_HEADERS t8_cmesh/t8_cmesh_examples.h t8_cmesh/t8_cmesh_geometry.h t8_cmesh/t8_cmesh_helpers.h - t8_cmesh/t8_cmesh_occ.hxx + t8_cmesh/t8_cmesh_cad.hxx t8_data/t8_shmem.h t8_data/t8_containers.h t8_forest/t8_forest.h From 9ceabfda831d1b6d9905e2d07c3b5c7841da56db Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:34:02 +0100 Subject: [PATCH 33/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c5a7ce13e4..99ed19ccef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -185,7 +185,7 @@ set( T8_PUBLIC_HEADERS t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx t8_geometry/t8_geometry_implementations/t8_geometry_examples.h - t8_geometry/t8_geometry_implementations/t8_geometry_occ.h + t8_geometry/t8_geometry_implementations/t8_geometry_cad.h t8_geometry/t8_geometry_implementations/t8_geometry_occ.hxx t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx From a1fdf1bd7f133a14d124b02d67c4e858c984bb80 Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:34:14 +0100 Subject: [PATCH 34/36] Update test/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5cb0480826..43d4fa7b5f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,7 +22,7 @@ add_t8_test( NAME t8_gtest_eclass SOURCES t8_gtest_main.cxx t8_gtest_ add_t8_test( NAME t8_gtest_vec SOURCES t8_gtest_main.cxx t8_gtest_vec.cxx ) add_t8_test( NAME t8_gtest_mat SOURCES t8_gtest_main.cxx t8_gtest_mat.cxx ) add_t8_test( NAME t8_gtest_refcount SOURCES t8_gtest_main.cxx t8_gtest_refcount.cxx ) -add_t8_test( NAME t8_gtest_occ_linkage SOURCES t8_gtest_main.cxx t8_gtest_occ_linkage.cxx ) +add_t8_test( NAME t8_gtest_cad_linkage SOURCES t8_gtest_main.cxx t8_gtest_cad_linkage.cxx ) add_t8_test( NAME t8_gtest_version SOURCES t8_gtest_main.cxx t8_gtest_version.cxx ) add_t8_test( NAME t8_gtest_basics SOURCES t8_gtest_main.cxx t8_gtest_basics.cxx ) add_t8_test( NAME t8_gtest_netcdf_linkage SOURCES t8_gtest_main.cxx t8_gtest_netcdf_linkage.cxx ) From 27d6fb195336efd7b81e4fa3031a061ff8143c7c Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:34:23 +0100 Subject: [PATCH 35/36] Update test/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 43d4fa7b5f..cacb44c8d1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -56,7 +56,7 @@ add_t8_test( NAME t8_gtest_iterate_replace SOURCES t8_gtest_main.cxx t8_forest add_t8_test( NAME t8_gtest_empty_local_tree SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_local_tree.cxx ) add_t8_test( NAME t8_gtest_empty_global_tree SOURCES t8_gtest_main.cxx t8_forest_incomplete/t8_gtest_empty_global_tree.cxx ) -add_t8_test( NAME t8_gtest_geometry_occ SOURCES t8_gtest_main.cxx t8_geometry/t8_geometry_implementations/t8_gtest_geometry_occ.cxx ) +add_t8_test( NAME t8_gtest_geometry_cad SOURCES t8_gtest_main.cxx t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx ) add_t8_test( NAME t8_gtest_geometry SOURCES t8_gtest_main.cxx t8_geometry/t8_gtest_geometry.cxx ) add_t8_test( NAME t8_gtest_point_inside SOURCES t8_gtest_main.cxx t8_geometry/t8_gtest_point_inside.cxx ) From 6aed99382e58c7263aaba8304beca53089e4578e Mon Sep 17 00:00:00 2001 From: Alex Dutka <97711898+dutkalex@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:34:55 +0100 Subject: [PATCH 36/36] Update src/CMakeLists.txt Co-authored-by: Johannes Markert <10619309+jmark@users.noreply.github.com> --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 99ed19ccef..7da9644454 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -186,7 +186,7 @@ set( T8_PUBLIC_HEADERS t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx t8_geometry/t8_geometry_implementations/t8_geometry_examples.h t8_geometry/t8_geometry_implementations/t8_geometry_cad.h - t8_geometry/t8_geometry_implementations/t8_geometry_occ.hxx + t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx