Skip to content

Commit

Permalink
Merge pull request #1974 from borglab/fix-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal authored Jan 21, 2025
2 parents c3908c8 + 2115cd1 commit d5f304e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/scripts/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function configure()
-DGTSAM_BUILD_TESTS=${GTSAM_BUILD_TESTS:-OFF} \
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
-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_USE_QUATERNIONS=${GTSAM_USE_QUATERNIONS:-OFF} \
-DGTSAM_ROT3_EXPMAP=${GTSAM_ROT3_EXPMAP:-ON} \
Expand All @@ -71,7 +71,6 @@ function finish ()
# compile the code with the intent of populating the cache
function build ()
{
export GTSAM_BUILD_EXAMPLES_ALWAYS=ON
export GTSAM_BUILD_TESTS=OFF

configure
Expand All @@ -92,7 +91,6 @@ function build ()
# run the tests
function test ()
{
export GTSAM_BUILD_EXAMPLES_ALWAYS=OFF
export GTSAM_BUILD_TESTS=ON

configure
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build-special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
ubuntu-clang-system-libs,
ubuntu-no-boost,
ubuntu-no-unstable,
ubuntu-build-examples,
]

build_type: [Debug, Release]
Expand Down Expand Up @@ -81,6 +82,12 @@ jobs:
version: "14"
flag: no_unstable

- name: ubuntu-build-examples
os: ubuntu-22.04
compiler: clang
version: "14"
flag: build_examples

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -158,6 +165,11 @@ jobs:
echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV
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
if: matrix.flag == 'system'
run: |
Expand Down
3 changes: 2 additions & 1 deletion gtsam_unstable/discrete/examples/schedulingExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ void runLargeExample() {

// Do brute force product and output that to file
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);
}

Expand Down
3 changes: 2 additions & 1 deletion gtsam_unstable/discrete/examples/schedulingQuals12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ void runLargeExample() {

// Do brute force product and output that to file
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);
}

Expand Down
3 changes: 2 additions & 1 deletion gtsam_unstable/discrete/examples/schedulingQuals13.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ void runLargeExample() {

// Do brute force product and output that to file
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);
}

Expand Down

0 comments on commit d5f304e

Please sign in to comment.