From 14e0dcbd89a027b7a6be19e238c048b5a27ea028 Mon Sep 17 00:00:00 2001 From: Emmett Lalish Date: Sun, 19 Jun 2022 22:27:46 -0700 Subject: [PATCH 1/5] disable branch coverage --- .github/workflows/manifold.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifold.yml b/.github/workflows/manifold.yml index 26e7af929..e668807ba 100644 --- a/.github/workflows/manifold.yml +++ b/.github/workflows/manifold.yml @@ -56,7 +56,7 @@ jobs: cd test ./manifold_test cd ../ - lcov --directory ./manifold --directory collider --directory polygon --directory utilities --capture --output-file ./code_coverage.info -rc lcov_branch_coverage=1 + lcov --directory ./manifold --directory collider --directory polygon --directory utilities --capture --output-file ./code_coverage.info - uses: codecov/codecov-action@v2 if: matrix.parallel_backend == 'NONE' with: From 3da4dfbde0201d10606dd3378403cc4dbef36f98 Mon Sep 17 00:00:00 2001 From: Emmett Lalish Date: Sun, 19 Jun 2022 23:15:16 -0700 Subject: [PATCH 2/5] remove third_party coverage --- .github/workflows/manifold.yml | 5 ++++- README.md | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manifold.yml b/.github/workflows/manifold.yml index e668807ba..8882c6726 100644 --- a/.github/workflows/manifold.yml +++ b/.github/workflows/manifold.yml @@ -53,10 +53,13 @@ jobs: run: | cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DMANIFOLD_PAR=${{matrix.parallel_backend}} -DMANIFOLD_USE_CUDA=${{matrix.cuda_support}} -DCODE_COVERAGE=ON .. && make + lcov --no-external --capture --initial --directory . --output-file ./code_coverage_init.info cd test ./manifold_test cd ../ - lcov --directory ./manifold --directory collider --directory polygon --directory utilities --capture --output-file ./code_coverage.info + lcov --no-external --capture --directory . --output-file ./code_coverage_test.info + lcov --add-tracefile ./code_coverage_init.info --add-tracefile ./code_coverage_test.info --output-file ./code_coverage_total.info + lcov --remove ./code_coverage_total.info './third_party/*' './test/*' './tools/*' --output-file ./code_coverage.info - uses: codecov/codecov-action@v2 if: matrix.parallel_backend == 'NONE' with: diff --git a/README.md b/README.md index 401f8a720..d6bd15af4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![codecov](https://codecov.io/github/elalish/manifold/branch/master/graph/badge.svg?token=IIA8G5HVS7)](https://codecov.io/github/elalish/manifold) + ![A metallic Menger sponge](https://elalish.github.io/manifold/samples/models/mengerSponge3.webp "A metallic Menger sponge") # Manifold From 870b94e1727e96db3fb9c49030c100cf26b3e923 Mon Sep 17 00:00:00 2001 From: Emmett Lalish Date: Mon, 20 Jun 2022 16:12:03 -0700 Subject: [PATCH 3/5] fixed coverage --- .github/workflows/manifold.yml | 6 +++--- .vscode/settings.json | 4 +++- CMakeLists.txt | 18 +++++++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/manifold.yml b/.github/workflows/manifold.yml index 8882c6726..631454ea8 100644 --- a/.github/workflows/manifold.yml +++ b/.github/workflows/manifold.yml @@ -53,13 +53,13 @@ jobs: run: | cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DMANIFOLD_PAR=${{matrix.parallel_backend}} -DMANIFOLD_USE_CUDA=${{matrix.cuda_support}} -DCODE_COVERAGE=ON .. && make - lcov --no-external --capture --initial --directory . --output-file ./code_coverage_init.info + lcov --capture --initial --directory . --output-file ./code_coverage_init.info cd test ./manifold_test cd ../ - lcov --no-external --capture --directory . --output-file ./code_coverage_test.info + lcov --capture --directory . --output-file ./code_coverage_test.info lcov --add-tracefile ./code_coverage_init.info --add-tracefile ./code_coverage_test.info --output-file ./code_coverage_total.info - lcov --remove ./code_coverage_total.info './third_party/*' './test/*' './tools/*' --output-file ./code_coverage.info + lcov --remove ./code_coverage_total.info '/usr/*' '*/third_party/*' '*/test/*' '*/tools/*' --output-file ./code_coverage.info - uses: codecov/codecov-action@v2 if: matrix.parallel_backend == 'NONE' with: diff --git a/.vscode/settings.json b/.vscode/settings.json index 723cd2708..5fdb61844 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -97,7 +97,9 @@ "C_Cpp.clang_format_fallbackStyle": "google", "editor.formatOnSave": true, "cmake.configureArgs": [ + "-DBUILD_SHARED_LIBS=ON", "-DMANIFOLD_USE_CUDA=OFF", - "-DMANIFOLD_PAR=NONE" + "-DMANIFOLD_PAR=NONE", + "-DCODE_COVERAGE=OFF" ], } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index bba46bfaf..49d53c2fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,17 +19,19 @@ option(PYBIND11_FINDPYTHON on) option(BUILD_TEST_CGAL off) option(BUILD_SHARED_LIBS off) -set(ASSIMP_INC_DIR +set(ASSIMP_INC_DIR ${PROJECT_SOURCE_DIR}/third_party/assimp/include ${CMAKE_BINARY_DIR}/third_party/assimp/include) set(GLM_INC_DIR ${PROJECT_SOURCE_DIR}/third_party/glm) set(PYBIND11_DIR ${PROJECT_SOURCE_DIR}/third_party/pybind11) option(ASSIMP_FAST_BUILD "build ASSIMP just for tests" ON) + if(ASSIMP_FAST_BUILD) - option(ASSIMP_INSTALL FALSE) - option(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT FALSE) - option(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT FALSE) + set(ASSIMP_INSTALL FALSE) + set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT FALSE) + set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT FALSE) + foreach(FMT OBJ;PLY;STL;GLTF) set(ASSIMP_BUILD_${FMT}_IMPORTER TRUE) set(ASSIMP_BUILD_${FMT}_EXPORTER TRUE) @@ -38,9 +40,10 @@ endif() set(THRUST_INC_DIR ${PROJECT_SOURCE_DIR}/third_party/thrust) -if (MANIFOLD_USE_CUDA) +if(MANIFOLD_USE_CUDA) enable_language(CUDA) find_package(CUDA REQUIRED) + # we cannot set THRUST_INC_DIR when building with CUDA, otherwise the # compiler will not use the system CUDA headers which causes incompatibility # clear THRUST_INC_DIR, we use the one from nvcc @@ -48,8 +51,8 @@ if (MANIFOLD_USE_CUDA) set(MANIFOLD_NVCC_RELEASE_FLAGS -O3 -lineinfo) set(MANIFOLD_NVCC_DEBUG_FLAGS -G) set(MANIFOLD_NVCC_FLAGS -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored --extended-lambda - "$<$:${MANIFOLD_NVCC_RELEASE_FLAGS}>" - "$<$:${MANIFOLD_NVCC_DEBUG_FLAGS}>") + "$<$:${MANIFOLD_NVCC_RELEASE_FLAGS}>" + "$<$:${MANIFOLD_NVCC_DEBUG_FLAGS}>") endif() if(NOT MSVC) @@ -58,6 +61,7 @@ if(NOT MSVC) "$<$:${WARNING_FLAGS}>" "$<$:-Xcompiler=${WARNING_FLAGS}>") endif() + if(CODE_COVERAGE AND NOT MSVC) add_compile_options( "$<$:-coverage>" From 3e5ab8eb0cf0cf8b2030ef42af54dc455cb5f8d1 Mon Sep 17 00:00:00 2001 From: Emmett Lalish Date: Mon, 20 Jun 2022 17:02:03 -0700 Subject: [PATCH 4/5] revert cmake change --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49d53c2fa..7ef6393e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,9 @@ set(PYBIND11_DIR ${PROJECT_SOURCE_DIR}/third_party/pybind11) option(ASSIMP_FAST_BUILD "build ASSIMP just for tests" ON) if(ASSIMP_FAST_BUILD) - set(ASSIMP_INSTALL FALSE) - set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT FALSE) - set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT FALSE) + option(ASSIMP_INSTALL FALSE) + option(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT FALSE) + option(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT FALSE) foreach(FMT OBJ;PLY;STL;GLTF) set(ASSIMP_BUILD_${FMT}_IMPORTER TRUE) From c13ad5657e78c0c1e9ad1827f1480f841114779a Mon Sep 17 00:00:00 2001 From: Emmett Lalish Date: Mon, 20 Jun 2022 17:31:51 -0700 Subject: [PATCH 5/5] speed up CI --- .github/workflows/manifold.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manifold.yml b/.github/workflows/manifold.yml index 631454ea8..64bcad455 100644 --- a/.github/workflows/manifold.yml +++ b/.github/workflows/manifold.yml @@ -49,7 +49,7 @@ jobs: # only do code coverage for default sequential backend, it seems that TBB # backend will cause failure # perhaps issue related to invalid memory access? - if: matrix.parallel_backend == 'NONE' + if: matrix.parallel_backend == 'NONE' && matrix.cuda_support == 'OFF' run: | cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DMANIFOLD_PAR=${{matrix.parallel_backend}} -DMANIFOLD_USE_CUDA=${{matrix.cuda_support}} -DCODE_COVERAGE=ON .. && make @@ -61,7 +61,7 @@ jobs: lcov --add-tracefile ./code_coverage_init.info --add-tracefile ./code_coverage_test.info --output-file ./code_coverage_total.info lcov --remove ./code_coverage_total.info '/usr/*' '*/third_party/*' '*/test/*' '*/tools/*' --output-file ./code_coverage.info - uses: codecov/codecov-action@v2 - if: matrix.parallel_backend == 'NONE' + if: matrix.parallel_backend == 'NONE' && matrix.cuda_support == 'OFF' with: files: build/code_coverage.info fail_ci_if_error: true