Merge pull request #1974 from borglab/fix-examples

release/4.3a0
Varun Agrawal 2025-01-21 00:27:56 -05:00 committed by GitHub
commit d5f304ef50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 6 deletions

View File

@ -45,7 +45,7 @@ function configure()
-DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \ -DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \ -DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \ -DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-ON} \ -DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-OFF} \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=${GTSAM_ALLOW_DEPRECATED_SINCE_V43:-OFF} \ -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=${GTSAM_ALLOW_DEPRECATED_SINCE_V43:-OFF} \
-DGTSAM_USE_QUATERNIONS=${GTSAM_USE_QUATERNIONS:-OFF} \ -DGTSAM_USE_QUATERNIONS=${GTSAM_USE_QUATERNIONS:-OFF} \
-DGTSAM_ROT3_EXPMAP=${GTSAM_ROT3_EXPMAP:-ON} \ -DGTSAM_ROT3_EXPMAP=${GTSAM_ROT3_EXPMAP:-ON} \
@ -71,7 +71,6 @@ function finish ()
# compile the code with the intent of populating the cache # compile the code with the intent of populating the cache
function build () function build ()
{ {
export GTSAM_BUILD_EXAMPLES_ALWAYS=ON
export GTSAM_BUILD_TESTS=OFF export GTSAM_BUILD_TESTS=OFF
configure configure
@ -92,7 +91,6 @@ function build ()
# run the tests # run the tests
function test () function test ()
{ {
export GTSAM_BUILD_EXAMPLES_ALWAYS=OFF
export GTSAM_BUILD_TESTS=ON export GTSAM_BUILD_TESTS=ON
configure configure

View File

@ -34,6 +34,7 @@ jobs:
ubuntu-clang-system-libs, ubuntu-clang-system-libs,
ubuntu-no-boost, ubuntu-no-boost,
ubuntu-no-unstable, ubuntu-no-unstable,
ubuntu-build-examples,
] ]
build_type: [Debug, Release] build_type: [Debug, Release]
@ -81,6 +82,12 @@ jobs:
version: "14" version: "14"
flag: no_unstable flag: no_unstable
- name: ubuntu-build-examples
os: ubuntu-22.04
compiler: clang
version: "14"
flag: build_examples
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -158,6 +165,11 @@ jobs:
echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV
echo "GTSAM Uses Cayley map for Rot3" echo "GTSAM Uses Cayley map for Rot3"
- name: Build Examples
if: matrix.flag == 'build_examples'
run: |
echo "GTSAM_BUILD_EXAMPLES_ALWAYS=ON" >> $GITHUB_ENV
- name: Use system versions of 3rd party libraries - name: Use system versions of 3rd party libraries
if: matrix.flag == 'system' if: matrix.flag == 'system'
run: | run: |

View File

@ -108,7 +108,8 @@ void runLargeExample() {
// Do brute force product and output that to file // Do brute force product and output that to file
if (scheduler.nrStudents() == 1) { // otherwise too slow if (scheduler.nrStudents() == 1) { // otherwise too slow
DecisionTreeFactor product = scheduler.product(); DecisionTreeFactor product =
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
product.dot("scheduling-large", DefaultKeyFormatter, false); product.dot("scheduling-large", DefaultKeyFormatter, false);
} }

View File

@ -108,7 +108,8 @@ void runLargeExample() {
// Do brute force product and output that to file // Do brute force product and output that to file
if (scheduler.nrStudents() == 1) { // otherwise too slow if (scheduler.nrStudents() == 1) { // otherwise too slow
DecisionTreeFactor product = scheduler.product(); DecisionTreeFactor product =
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
product.dot("scheduling-large", DefaultKeyFormatter, false); product.dot("scheduling-large", DefaultKeyFormatter, false);
} }

View File

@ -132,7 +132,8 @@ void runLargeExample() {
// Do brute force product and output that to file // Do brute force product and output that to file
if (scheduler.nrStudents() == 1) { // otherwise too slow if (scheduler.nrStudents() == 1) { // otherwise too slow
DecisionTreeFactor product = scheduler.product(); DecisionTreeFactor product =
*std::dynamic_pointer_cast<DecisionTreeFactor>(scheduler.product());
product.dot("scheduling-large", DefaultKeyFormatter, false); product.dot("scheduling-large", DefaultKeyFormatter, false);
} }