Skip to content

Commit ca7e1ce

Browse files
authored
Merge pull request #218 from alicevision/dev/fixes
[fixes] Boost fixes for versions >=1.85
2 parents d2d846b + 0ac133a commit ca7e1ce

File tree

15 files changed

+101
-36
lines changed

15 files changed

+101
-36
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ name: Continuous Integration
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- develop
5+
# branches:
6+
# - master
7+
# - develop
88
# Skip jobs when only documentation files are changed
9-
paths-ignore:
10-
- '**.md'
11-
- '**.rst'
12-
- 'docs/**'
9+
# paths-ignore:
10+
# - '**.md'
11+
# - '**.rst'
12+
# - 'docs/**'
1313
pull_request:
1414
paths-ignore:
1515
- '**.md'
1616
- '**.rst'
1717
- 'docs/**'
1818

1919
jobs:
20-
build:
20+
build-linux:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
@@ -68,3 +68,83 @@ jobs:
6868
-DBUILD_SHARED_LIBS:BOOL=ON \
6969
-DCMAKE_PREFIX_PATH:PATH="$PWD/../../cctag_install;${DEPS_INSTALL_DIR}"
7070
make -j8
71+
72+
build_windows:
73+
runs-on: windows-latest
74+
strategy:
75+
matrix:
76+
config: [ Debug, Release ]
77+
env:
78+
buildDir: '${{ github.workspace }}\build\'
79+
vcpkgDir: '${{ github.workspace }}\..\e\vcpkg'
80+
# commit for version 2023.11.20
81+
COMMIT_ID: a42af01b72c28a8e1d7b48107b33e4f286a55ef6
82+
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v3
86+
with:
87+
submodules: true
88+
89+
- name: Install latest CMake.
90+
uses: lukka/get-cmake@latest
91+
92+
# 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.
93+
- name: vcpkg - Setup dependencies
94+
uses: lukka/run-vcpkg@v7
95+
with:
96+
# Just install vcpkg for now, do not install any ports in this step yet.
97+
setupOnly: false
98+
# Location of the vcpkg submodule in the Git repository.
99+
vcpkgDirectory: ${{ env.vcpkgDir }}
100+
vcpkgGitCommitId: ${{ env.COMMIT_ID }}
101+
vcpkgArguments: >
102+
boost-accumulators
103+
boost-algorithm boost-container
104+
boost-date-time
105+
boost-exception
106+
boost-filesystem
107+
boost-foreach
108+
boost-iterator
109+
boost-lexical-cast
110+
boost-math
111+
boost-mpl
112+
boost-multi-array
113+
boost-ptr-container
114+
boost-program-options
115+
boost-serialization
116+
boost-spirit
117+
boost-static-assert
118+
boost-stacktrace
119+
boost-test
120+
boost-thread
121+
boost-throw-exception
122+
boost-timer
123+
boost-type-traits
124+
boost-unordered
125+
opencv
126+
tbb
127+
eigen3
128+
vcpkgTriplet: x64-windows
129+
# doNotCache: true
130+
# This is used to unbreak cached artifacts if for some reason dependencies fail to build,
131+
# the action does not notice it and saves broken artifacts.
132+
appendedCacheKey: cache007
133+
134+
- name: vcpkg - Display installed packages
135+
run:
136+
${{ env.vcpkgDir }}\vcpkg.exe list
137+
138+
- name: Build
139+
uses: lukka/run-cmake@v3
140+
with:
141+
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
142+
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
143+
buildDirectory: ${{ env.buildDir }}
144+
# cmakeGenerator: VS16Win64
145+
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
146+
# This input tells run-cmake to consume the vcpkg.cmake toolchain file set by run-vcpkg.
147+
cmakeBuildType: ${{ matrix.config }}
148+
useVcpkgToolchainFile: true
149+
buildWithCMake: true
150+
buildWithCMakeArgs: -j1 --config ${{ matrix.config }}

doc/sphinx/source/install/install.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ To install the dependencies:
120120
boost-container
121121
boost-date-time
122122
boost-exception
123+
boost-foreach
123124
boost-filesystem
124125
boost-iterator
125126
boost-lexical-cast
@@ -142,6 +143,8 @@ To install the dependencies:
142143
tbb
143144
eigen3
144145
146+
Note that for boost >= 1.85 you have to use :code:`math[legacy]`.
147+
145148
You can add the flag :code:`--triplet` to specify the architecture and the version you want to build.
146149
For example:
147150

src/applications/detection/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <boost/archive/xml_oarchive.hpp>
2222
#include <boost/exception/all.hpp>
2323
#include <boost/filesystem.hpp>
24-
#include <boost/filesystem/convenience.hpp>
2524
#include <boost/ptr_container/ptr_list.hpp>
2625
#include <boost/timer/timer.hpp>
2726
#include <opencv2/core/core.hpp>
@@ -501,7 +500,7 @@ int main(int argc, char** argv)
501500
tbb::parallel_for(0, 2, [&](size_t fileListIdx) {
502501
for(const auto& fileInFolder : files[fileListIdx])
503502
{
504-
const std::string subExt(bfs::extension(fileInFolder.second));
503+
const std::string subExt(fileInFolder.second.extension().string());
505504

506505
if((subExt == ".png") || (subExt == ".jpg") || (subExt == ".PNG") || (subExt == ".JPG"))
507506
{

src/cctag/CCTag.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include <opencv2/core/core_c.h>
1919

20-
#include <boost/foreach.hpp>
2120
#include <boost/array.hpp>
2221
#include <boost/mpl/bool.hpp>
2322

src/cctag/CCTagFlowComponent.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <cctag/CCTagFlowComponent.hpp>
99
#include <cctag/utils/Defines.hpp>
1010

11-
#include <boost/foreach.hpp>
1211

1312
namespace cctag
1413
{

src/cctag/DataSerialization.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <boost/serialization/nvp.hpp>
1616
#include <boost/serialization/serialization.hpp>
1717
#include <boost/archive/text_oarchive.hpp>
18-
#include <boost/foreach.hpp>
1918

2019
namespace cctag {
2120

src/cctag/Detection.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "cctag/cuda/tag.h"
2929
#endif
3030

31-
#include <boost/foreach.hpp>
3231
#include <boost/math/constants/constants.hpp>
3332
#include <boost/math/special_functions/round.hpp>
3433
#include <boost/mpl/bool.hpp>

src/cctag/EllipseGrowing.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <opencv2/core/types_c.h>
2424

2525
#include <boost/math/special_functions/pow.hpp>
26-
#include <boost/foreach.hpp>
2726
#include <boost/math/constants/constants.hpp>
2827
#include <boost/mpl/bool.hpp>
2928
#include <boost/assert.hpp>

src/cctag/Fitting.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
#include <boost/algorithm/string/classification.hpp>
99
#include <boost/algorithm/string/split.hpp>
10-
#include <boost/foreach.hpp>
1110
#include <boost/lexical_cast.hpp>
1211
#include <boost/math/constants/constants.hpp>
1312
#include <boost/math/special_functions/round.hpp>
@@ -226,8 +225,6 @@ template void fitEllipse(std::vector<cctag::Point2d<Eigen::Vector3f>>::const_ite
226225
} // geometry
227226

228227
float innerProdMin(const std::vector<cctag::EdgePoint*>& filteredChildren, float thrCosDiffMax, Point2d<Vector3s> & p1, Point2d<Vector3s> & p2) {
229-
using namespace boost::numeric;
230-
//using namespace cctag::numerical;
231228

232229
EdgePoint* pAngle1 = nullptr;
233230
EdgePoint* pAngle2 = nullptr;
@@ -335,7 +332,6 @@ void ellipseFitting( cctag::numerical::geometry::Ellipse& e, const std::vector<c
335332
}
336333

337334
void circleFitting(cctag::numerical::geometry::Ellipse& e, const std::vector<cctag::EdgePoint*>& points) {
338-
using namespace boost::numeric;
339335

340336
std::size_t nPoints = points.size();
341337

src/cctag/Fitting.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <cctag/EdgePoint.hpp>
1212
#include <cctag/geometry/Ellipse.hpp>
1313
#include <cctag/geometry/Point.hpp>
14-
#include <boost/foreach.hpp>
1514

1615
#include <list>
1716
#include <string>

0 commit comments

Comments
 (0)