diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5ccc5ca2..9af7df05 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -2,14 +2,14 @@ name: Continuous Integration on: push: - branches: - - master - - develop +# branches: +# - master +# - develop # Skip jobs when only documentation files are changed - paths-ignore: - - '**.md' - - '**.rst' - - 'docs/**' +# paths-ignore: +# - '**.md' +# - '**.rst' +# - 'docs/**' pull_request: paths-ignore: - '**.md' @@ -17,7 +17,7 @@ on: - 'docs/**' jobs: - build: + build-linux: runs-on: ubuntu-latest strategy: matrix: @@ -68,3 +68,83 @@ jobs: -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_PREFIX_PATH:PATH="$PWD/../../cctag_install;${DEPS_INSTALL_DIR}" make -j8 + + build_windows: + runs-on: windows-latest + strategy: + matrix: + config: [ Debug, Release ] + env: + buildDir: '${{ github.workspace }}\build\' + vcpkgDir: '${{ github.workspace }}\..\e\vcpkg' + # commit for version 2023.11.20 + COMMIT_ID: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install latest CMake. + uses: lukka/get-cmake@latest + + # Restore from cache the previously built ports. If a "cache miss" occurs, then vcpkg is bootstrapped. Since a the vcpkg.json is being used later on to install the packages when run-cmake runs, no packages are installed at this time and the input 'setupOnly:true' is mandatory. + - name: vcpkg - Setup dependencies + uses: lukka/run-vcpkg@v7 + with: + # Just install vcpkg for now, do not install any ports in this step yet. + setupOnly: false + # Location of the vcpkg submodule in the Git repository. + vcpkgDirectory: ${{ env.vcpkgDir }} + vcpkgGitCommitId: ${{ env.COMMIT_ID }} + vcpkgArguments: > + boost-accumulators + boost-algorithm boost-container + boost-date-time + boost-exception + boost-filesystem + boost-foreach + boost-iterator + boost-lexical-cast + boost-math + boost-mpl + boost-multi-array + boost-ptr-container + boost-program-options + boost-serialization + boost-spirit + boost-static-assert + boost-stacktrace + boost-test + boost-thread + boost-throw-exception + boost-timer + boost-type-traits + boost-unordered + opencv + tbb + eigen3 + vcpkgTriplet: x64-windows + # doNotCache: true + # This is used to unbreak cached artifacts if for some reason dependencies fail to build, + # the action does not notice it and saves broken artifacts. + appendedCacheKey: cache007 + + - name: vcpkg - Display installed packages + run: + ${{ env.vcpkgDir }}\vcpkg.exe list + + - name: Build + uses: lukka/run-cmake@v3 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + buildDirectory: ${{ env.buildDir }} +# cmakeGenerator: VS16Win64 + cmakeAppendedArgs: -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DVCPKG_TARGET_TRIPLET=x64-windows -A x64 -T host=x64 -DCCTAG_WITH_CUDA:BOOL=OFF + # This input tells run-cmake to consume the vcpkg.cmake toolchain file set by run-vcpkg. + cmakeBuildType: ${{ matrix.config }} + useVcpkgToolchainFile: true + buildWithCMake: true + buildWithCMakeArgs: -j1 --config ${{ matrix.config }} \ No newline at end of file diff --git a/doc/sphinx/source/install/install.rst b/doc/sphinx/source/install/install.rst index 88fbbcdc..14b04147 100644 --- a/doc/sphinx/source/install/install.rst +++ b/doc/sphinx/source/install/install.rst @@ -120,6 +120,7 @@ To install the dependencies: boost-container boost-date-time boost-exception + boost-foreach boost-filesystem boost-iterator boost-lexical-cast @@ -142,6 +143,8 @@ To install the dependencies: tbb eigen3 +Note that for boost >= 1.85 you have to use :code:`math[legacy]`. + You can add the flag :code:`--triplet` to specify the architecture and the version you want to build. For example: diff --git a/src/applications/detection/main.cpp b/src/applications/detection/main.cpp index da8243b9..6807adad 100644 --- a/src/applications/detection/main.cpp +++ b/src/applications/detection/main.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -501,7 +500,7 @@ int main(int argc, char** argv) tbb::parallel_for(0, 2, [&](size_t fileListIdx) { for(const auto& fileInFolder : files[fileListIdx]) { - const std::string subExt(bfs::extension(fileInFolder.second)); + const std::string subExt(fileInFolder.second.extension().string()); if((subExt == ".png") || (subExt == ".jpg") || (subExt == ".PNG") || (subExt == ".JPG")) { diff --git a/src/cctag/CCTag.cpp b/src/cctag/CCTag.cpp index ac002fea..82838b64 100644 --- a/src/cctag/CCTag.cpp +++ b/src/cctag/CCTag.cpp @@ -17,7 +17,6 @@ #include -#include #include #include diff --git a/src/cctag/CCTagFlowComponent.cpp b/src/cctag/CCTagFlowComponent.cpp index 06f51254..85ecbdaf 100644 --- a/src/cctag/CCTagFlowComponent.cpp +++ b/src/cctag/CCTagFlowComponent.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace cctag { diff --git a/src/cctag/DataSerialization.hpp b/src/cctag/DataSerialization.hpp index 7f1db814..41142b04 100644 --- a/src/cctag/DataSerialization.hpp +++ b/src/cctag/DataSerialization.hpp @@ -15,7 +15,6 @@ #include #include #include -#include namespace cctag { diff --git a/src/cctag/Detection.cpp b/src/cctag/Detection.cpp index 514776d0..c7e34d24 100644 --- a/src/cctag/Detection.cpp +++ b/src/cctag/Detection.cpp @@ -28,7 +28,6 @@ #include "cctag/cuda/tag.h" #endif -#include #include #include #include diff --git a/src/cctag/EllipseGrowing.cpp b/src/cctag/EllipseGrowing.cpp index 71d92f30..bcf311e5 100644 --- a/src/cctag/EllipseGrowing.cpp +++ b/src/cctag/EllipseGrowing.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/src/cctag/Fitting.cpp b/src/cctag/Fitting.cpp index 931922e6..24212efe 100644 --- a/src/cctag/Fitting.cpp +++ b/src/cctag/Fitting.cpp @@ -7,7 +7,6 @@ */ #include #include -#include #include #include #include @@ -226,8 +225,6 @@ template void fitEllipse(std::vector>::const_ite } // geometry float innerProdMin(const std::vector& filteredChildren, float thrCosDiffMax, Point2d & p1, Point2d & p2) { - using namespace boost::numeric; - //using namespace cctag::numerical; EdgePoint* pAngle1 = nullptr; EdgePoint* pAngle2 = nullptr; @@ -335,7 +332,6 @@ void ellipseFitting( cctag::numerical::geometry::Ellipse& e, const std::vector& points) { - using namespace boost::numeric; std::size_t nPoints = points.size(); diff --git a/src/cctag/Fitting.hpp b/src/cctag/Fitting.hpp index f8137327..8babec7f 100644 --- a/src/cctag/Fitting.hpp +++ b/src/cctag/Fitting.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff --git a/src/cctag/ICCTag.cpp b/src/cctag/ICCTag.cpp index 1a3b51b9..509124e3 100644 --- a/src/cctag/ICCTag.cpp +++ b/src/cctag/ICCTag.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/src/cctag/Identification.cpp b/src/cctag/Identification.cpp index 9992b648..e0b866e4 100644 --- a/src/cctag/Identification.cpp +++ b/src/cctag/Identification.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -60,7 +61,7 @@ bool orazioDistanceRobust( using MapT = std::map; - if ( cuts.size() == 0 ) + if ( cuts.empty() ) { return false; } @@ -570,9 +571,7 @@ void selectCutCheapUniform( std::vector< cctag::ImageCut > & vSelectedCuts, vSelectedCuts.clear(); vSelectedCuts.reserve(selectSize); - - std::size_t sharpSize = 0; - + // Initialize vector of indices of sharp cuts std::vector indToAdd; indToAdd.reserve(varCuts.size()); @@ -700,12 +699,13 @@ std::pair convImageCut(const std::vector & kernel, ImageCut //cut.imgSignal() = output; // Locate the maximum value. - std::vector::iterator maxValueIt = std::max_element(output.begin(), output.end()); + auto maxValueIt = std::max_element(output.begin(), output.end()); float itsLocation = (float) std::distance(output.begin(), maxValueIt); //CCTAG_COUT_VAR2(*maxValueIt, itsLocation); - - return std::pair(*maxValueIt,itsLocation);// max value, its location + + // max value, its location + return {*maxValueIt, itsLocation}; } /** @@ -1261,7 +1261,7 @@ int identify_step_1( ) #endif - if ( cuts.size() == 0 ) + if ( cuts.empty() ) { // Can happen when an object or the image frame is occluding a part of all available cuts. return status::no_collected_cuts; @@ -1287,7 +1287,7 @@ int identify_step_1( const float spendTime = d.total_milliseconds(); } - if ( vSelectedCuts.size() == 0 ) + if ( vSelectedCuts.empty() ) { CCTAG_COUT_DEBUG("Unable to select any cut."); return status::no_selected_cuts; // todo: is class attributes the best option? diff --git a/src/cctag/Identification.hpp b/src/cctag/Identification.hpp index a86d957e..39e797b4 100644 --- a/src/cctag/Identification.hpp +++ b/src/cctag/Identification.hpp @@ -16,9 +16,7 @@ #include -#include #include -#include #include #include diff --git a/src/cctag/Vote.cpp b/src/cctag/Vote.cpp index a037fe96..4edc2fe5 100644 --- a/src/cctag/Vote.cpp +++ b/src/cctag/Vote.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/src/cctag/optimization/conditioner.hpp b/src/cctag/optimization/conditioner.hpp index 52d6747c..f437733c 100644 --- a/src/cctag/optimization/conditioner.hpp +++ b/src/cctag/optimization/conditioner.hpp @@ -12,9 +12,6 @@ #include #include -#include - - namespace cctag { namespace numerical { namespace optimization {