Skip to content

Commit 3a51b37

Browse files
committed
Merge branch 'develop' into CMake
2 parents 16660dc + ce1daeb commit 3a51b37

File tree

12 files changed

+332
-12
lines changed

12 files changed

+332
-12
lines changed

.github/workflows/ci.yml

+224
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,227 @@ jobs:
176176
- name: Test
177177
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.3
178178
working-directory: ../boost-root/libs/graph/test
179+
180+
posix-cmake-subdir:
181+
strategy:
182+
fail-fast: false
183+
matrix:
184+
include:
185+
- os: ubuntu-20.04
186+
- os: ubuntu-22.04
187+
- os: ubuntu-24.04
188+
- os: macos-13
189+
- os: macos-14
190+
- os: macos-15
191+
192+
runs-on: ${{matrix.os}}
193+
194+
steps:
195+
- uses: actions/checkout@v4
196+
197+
- name: Install packages
198+
if: matrix.install
199+
run: sudo apt-get -y install ${{matrix.install}}
200+
201+
- name: Setup Boost
202+
run: |
203+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
204+
LIBRARY=${GITHUB_REPOSITORY#*/}
205+
echo LIBRARY: $LIBRARY
206+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
207+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
208+
echo GITHUB_REF: $GITHUB_REF
209+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
210+
REF=${REF#refs/heads/}
211+
echo REF: $REF
212+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
213+
echo BOOST_BRANCH: $BOOST_BRANCH
214+
cd ..
215+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
216+
cd boost-root
217+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
218+
git submodule update --init tools/boostdep
219+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
220+
221+
- name: Use library with add_subdirectory
222+
run: |
223+
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
224+
mkdir __build__ && cd __build__
225+
cmake ..
226+
cmake --build .
227+
ctest --output-on-failure --no-tests=error
228+
229+
posix-cmake-install:
230+
strategy:
231+
fail-fast: false
232+
matrix:
233+
include:
234+
- os: ubuntu-20.04
235+
- os: ubuntu-22.04
236+
- os: ubuntu-24.04
237+
- os: macos-13
238+
- os: macos-14
239+
- os: macos-15
240+
241+
runs-on: ${{matrix.os}}
242+
243+
steps:
244+
- uses: actions/checkout@v4
245+
246+
- name: Install packages
247+
if: matrix.install
248+
run: sudo apt-get -y install ${{matrix.install}}
249+
250+
- name: Setup Boost
251+
run: |
252+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
253+
LIBRARY=${GITHUB_REPOSITORY#*/}
254+
echo LIBRARY: $LIBRARY
255+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
256+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
257+
echo GITHUB_REF: $GITHUB_REF
258+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
259+
REF=${REF#refs/heads/}
260+
echo REF: $REF
261+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
262+
echo BOOST_BRANCH: $BOOST_BRANCH
263+
cd ..
264+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
265+
cd boost-root
266+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
267+
git submodule update --init tools/boostdep
268+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
269+
270+
- name: Configure
271+
run: |
272+
cd ../boost-root
273+
mkdir __build__ && cd __build__
274+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
275+
276+
- name: Install
277+
run: |
278+
cd ../boost-root/__build__
279+
cmake --build . --target install
280+
281+
- name: Use the installed library
282+
run: |
283+
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
284+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
285+
cmake --build .
286+
ctest --output-on-failure --no-tests=error
287+
288+
windows-cmake-subdir:
289+
strategy:
290+
fail-fast: false
291+
matrix:
292+
include:
293+
- os: windows-2019
294+
- os: windows-2022
295+
296+
runs-on: ${{matrix.os}}
297+
298+
steps:
299+
- uses: actions/checkout@v4
300+
301+
- name: Setup Boost
302+
shell: cmd
303+
run: |
304+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
305+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
306+
echo LIBRARY: %LIBRARY%
307+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
308+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
309+
echo GITHUB_REF: %GITHUB_REF%
310+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
311+
set BOOST_BRANCH=develop
312+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
313+
echo BOOST_BRANCH: %BOOST_BRANCH%
314+
cd ..
315+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
316+
cd boost-root
317+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
318+
git submodule update --init tools/boostdep
319+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
320+
321+
- name: Use library with add_subdirectory (Debug)
322+
shell: cmd
323+
run: |
324+
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
325+
mkdir __build__ && cd __build__
326+
cmake ..
327+
cmake --build . --config Debug
328+
ctest --output-on-failure --no-tests=error -C Debug
329+
330+
- name: Use library with add_subdirectory (Release)
331+
shell: cmd
332+
run: |
333+
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
334+
cmake --build . --config Release
335+
ctest --output-on-failure --no-tests=error -C Release
336+
337+
windows-cmake-install:
338+
strategy:
339+
fail-fast: false
340+
matrix:
341+
include:
342+
- os: windows-2019
343+
- os: windows-2022
344+
345+
runs-on: ${{matrix.os}}
346+
347+
steps:
348+
- uses: actions/checkout@v4
349+
350+
- name: Setup Boost
351+
shell: cmd
352+
run: |
353+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
354+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
355+
echo LIBRARY: %LIBRARY%
356+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
357+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
358+
echo GITHUB_REF: %GITHUB_REF%
359+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
360+
set BOOST_BRANCH=develop
361+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
362+
echo BOOST_BRANCH: %BOOST_BRANCH%
363+
cd ..
364+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
365+
cd boost-root
366+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
367+
git submodule update --init tools/boostdep
368+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
369+
370+
- name: Configure
371+
shell: cmd
372+
run: |
373+
cd ../boost-root
374+
mkdir __build__ && cd __build__
375+
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
376+
377+
- name: Install (Debug)
378+
shell: cmd
379+
run: |
380+
cd ../boost-root/__build__
381+
cmake --build . --target install --config Debug
382+
383+
- name: Install (Release)
384+
shell: cmd
385+
run: |
386+
cd ../boost-root/__build__
387+
cmake --build . --target install --config Release
388+
389+
- name: Use the installed library (Debug)
390+
shell: cmd
391+
run: |
392+
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
393+
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
394+
cmake --build . --config Debug
395+
ctest --output-on-failure --no-tests=error -C Debug
396+
397+
- name: Use the installed library (Release)
398+
shell: cmd
399+
run: |
400+
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
401+
cmake --build . --config Release
402+
ctest --output-on-failure --no-tests=error -C Release

doc/using_adjacency_list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ <H4>Time Complexity</H4>
133133
<PRE>
134134
vertex()
135135
</PRE>
136-
This operation is constant time for <TT>vecS</TT> and for
136+
This operation is constant time for <TT>vecS</TT> and <i>O(V)</i> for
137137
<TT>listS</TT>.
138138

139139
</ul>

example/fibonacci_heap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main()
3434
uniform_int<> distrib(0, N - 1);
3535
boost::variate_generator< random_ns::mt19937&, uniform_int<> > rand_gen(
3636
gen, distrib);
37-
for (int t = 0; t < 10; ++t)
37+
for (std::size_t t = 0; t < 10; ++t)
3838
{
3939
std::vector< float > v, w(N);
4040

example/graph-thingie.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <boost/foreach.hpp>
1515
#include <string>
1616
#include <sstream>
17+
#include <cstdlib>
1718

1819
using namespace boost;
1920
using namespace std;
@@ -104,5 +105,5 @@ int main()
104105
<< get("label", dp, v) << ")\n";
105106
}
106107

107-
return 0;
108+
return status ? EXIT_SUCCESS : EXIT_FAILURE;
108109
}

example/prim-telephone.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ int main()
5353
#endif
5454

5555
int total_weight = 0;
56-
for (int v = 0; v < num_vertices(g); ++v)
56+
for (std::size_t v = 0; v < num_vertices(g); ++v)
5757
if (parent[v] != v)
5858
total_weight += get(weight, edge(parent[v], v, g).first);
5959
std::cout << "total weight: " << total_weight << std::endl;
6060

61-
for (int u = 0; u < num_vertices(g); ++u)
61+
for (std::size_t u = 0; u < num_vertices(g); ++u)
6262
if (parent[u] != u)
6363
edge_attr_map[edge(parent[u], u, g_dot).first]["color"] = "black";
6464
std::ofstream out("figs/telephone-mst-prim.dot");

include/boost/graph/bron_kerbosch_all_cliques.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct max_clique_visitor
104104
max_clique_visitor(std::size_t& max) : maximum(max) {}
105105

106106
template < typename Clique, typename Graph >
107-
inline void clique(const Clique& p, const Graph& g)
107+
inline void clique(const Clique& p, const Graph&)
108108
{
109109
BOOST_USING_STD_MAX();
110110
maximum = max BOOST_PREVENT_MACRO_SUBSTITUTION(maximum, p.size());
@@ -220,7 +220,7 @@ namespace detail
220220

221221
// otherwise, iterate over candidates and and test
222222
// for maxmimal cliquiness.
223-
typename Container::iterator i, j;
223+
typename Container::iterator i;
224224
for (i = cands.begin(); i != cands.end();)
225225
{
226226
Vertex candidate = *i;

include/boost/graph/cycle_canceling.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace detail
172172
template < class Graph, class P, class T, class R >
173173
void cycle_canceling(Graph& g, const bgl_named_params< P, T, R >& params)
174174
{
175-
cycle_canceling_dispatch1(g,
175+
detail::cycle_canceling_dispatch1(g,
176176
choose_const_pmap(get_param(params, edge_weight), g, edge_weight),
177177
choose_const_pmap(get_param(params, edge_reverse), g, edge_reverse),
178178
choose_pmap(get_param(params, edge_residual_capacity), g,

include/boost/graph/dominator_tree.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#define BOOST_GRAPH_DOMINATOR_HPP
1111

1212
#include <boost/config.hpp>
13-
#include <deque>
1413
#include <set>
14+
#include <vector>
1515
#include <boost/graph/depth_first_search.hpp>
1616
#include <boost/concept/assert.hpp>
1717

@@ -155,7 +155,7 @@ namespace detail
155155
//
156156
// idom(n) = semi(n) if semi(y)=semi(n) or
157157
// idom(y) if semi(y) != semi(n)
158-
typename std::deque< Vertex >::iterator buckItr;
158+
typename std::vector< Vertex >::iterator buckItr;
159159
for (buckItr = get(bucketMap_, p).begin();
160160
buckItr != get(bucketMap_, p).end(); ++buckItr)
161161
{
@@ -195,10 +195,10 @@ namespace detail
195195

196196
std::vector< Vertex > semi_, ancestor_, samedom_, best_;
197197
PredMap semiMap_, ancestorMap_, bestMap_;
198-
std::vector< std::deque< Vertex > > buckets_;
198+
std::vector< std::vector< Vertex > > buckets_;
199199

200200
iterator_property_map<
201-
typename std::vector< std::deque< Vertex > >::iterator, IndexMap >
201+
typename std::vector< std::vector< Vertex > >::iterator, IndexMap >
202202
bucketMap_;
203203

204204
const Vertex& entry_;
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2018, 2019, 2021 Peter Dimov
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
4+
5+
cmake_minimum_required(VERSION 3.5...3.16)
6+
7+
project(boost_graph_install_test LANGUAGES CXX)
8+
9+
if(BOOST_RUNTIME_LINK STREQUAL "static")
10+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
11+
endif()
12+
13+
find_package(boost_graph REQUIRED)
14+
15+
add_executable(main main.cpp)
16+
target_link_libraries(main Boost::graph)
17+
18+
enable_testing()
19+
add_test(NAME main COMMAND main)
20+
21+
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>)

test/cmake_install_test/main.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2006 The Trustees of Indiana University.
2+
3+
// Use, modification and distribution is subject to the Boost Software
4+
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
// Authors: Douglas Gregor
8+
// Andrew Lumsdaine
9+
10+
// Make sure adjacency_list works with EdgeListS=setS
11+
#include <boost/graph/adjacency_list.hpp>
12+
13+
using namespace boost;
14+
15+
typedef adjacency_list< vecS, vecS, undirectedS, no_property, no_property,
16+
no_property, setS >
17+
GraphType;
18+
19+
int main()
20+
{
21+
GraphType g(10);
22+
add_vertex(g);
23+
add_edge(0, 5, g);
24+
}

0 commit comments

Comments
 (0)