Skip to content

Commit d5f304e

Browse files
authored
Merge pull request #1974 from borglab/fix-examples
2 parents c3908c8 + 2115cd1 commit d5f304e

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

.github/scripts/unix.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function configure()
4545
-DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \
4646
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
4747
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \
48-
-DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-ON} \
48+
-DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-OFF} \
4949
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=${GTSAM_ALLOW_DEPRECATED_SINCE_V43:-OFF} \
5050
-DGTSAM_USE_QUATERNIONS=${GTSAM_USE_QUATERNIONS:-OFF} \
5151
-DGTSAM_ROT3_EXPMAP=${GTSAM_ROT3_EXPMAP:-ON} \
@@ -71,7 +71,6 @@ function finish ()
7171
# compile the code with the intent of populating the cache
7272
function build ()
7373
{
74-
export GTSAM_BUILD_EXAMPLES_ALWAYS=ON
7574
export GTSAM_BUILD_TESTS=OFF
7675

7776
configure
@@ -92,7 +91,6 @@ function build ()
9291
# run the tests
9392
function test ()
9493
{
95-
export GTSAM_BUILD_EXAMPLES_ALWAYS=OFF
9694
export GTSAM_BUILD_TESTS=ON
9795

9896
configure

.github/workflows/build-special.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
ubuntu-clang-system-libs,
3535
ubuntu-no-boost,
3636
ubuntu-no-unstable,
37+
ubuntu-build-examples,
3738
]
3839

3940
build_type: [Debug, Release]
@@ -81,6 +82,12 @@ jobs:
8182
version: "14"
8283
flag: no_unstable
8384

85+
- name: ubuntu-build-examples
86+
os: ubuntu-22.04
87+
compiler: clang
88+
version: "14"
89+
flag: build_examples
90+
8491
steps:
8592
- name: Checkout
8693
uses: actions/checkout@v4
@@ -158,6 +165,11 @@ jobs:
158165
echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV
159166
echo "GTSAM Uses Cayley map for Rot3"
160167
168+
- name: Build Examples
169+
if: matrix.flag == 'build_examples'
170+
run: |
171+
echo "GTSAM_BUILD_EXAMPLES_ALWAYS=ON" >> $GITHUB_ENV
172+
161173
- name: Use system versions of 3rd party libraries
162174
if: matrix.flag == 'system'
163175
run: |

gtsam_unstable/discrete/examples/schedulingExample.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void runLargeExample() {
108108

109109
// Do brute force product and output that to file
110110
if (scheduler.nrStudents() == 1) { // otherwise too slow
111-
DecisionTreeFactor product = scheduler.product();
111+
DecisionTreeFactor product =
112+
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
112113
product.dot("scheduling-large", DefaultKeyFormatter, false);
113114
}
114115

gtsam_unstable/discrete/examples/schedulingQuals12.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void runLargeExample() {
108108

109109
// Do brute force product and output that to file
110110
if (scheduler.nrStudents() == 1) { // otherwise too slow
111-
DecisionTreeFactor product = scheduler.product();
111+
DecisionTreeFactor product =
112+
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
112113
product.dot("scheduling-large", DefaultKeyFormatter, false);
113114
}
114115

gtsam_unstable/discrete/examples/schedulingQuals13.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ void runLargeExample() {
132132

133133
// Do brute force product and output that to file
134134
if (scheduler.nrStudents() == 1) { // otherwise too slow
135-
DecisionTreeFactor product = scheduler.product();
135+
DecisionTreeFactor product =
136+
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
136137
product.dot("scheduling-large", DefaultKeyFormatter, false);
137138
}
138139

0 commit comments

Comments
 (0)