diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index b2e960fc1..931495744 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -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} \ @@ -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 @@ -92,7 +91,6 @@ function build () # run the tests function test () { - export GTSAM_BUILD_EXAMPLES_ALWAYS=OFF export GTSAM_BUILD_TESTS=ON configure diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml index d0a182975..5ad7039ed 100644 --- a/.github/workflows/build-special.yml +++ b/.github/workflows/build-special.yml @@ -34,6 +34,7 @@ jobs: ubuntu-clang-system-libs, ubuntu-no-boost, ubuntu-no-unstable, + ubuntu-build-examples, ] build_type: [Debug, Release] @@ -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 @@ -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: | diff --git a/gtsam_unstable/discrete/examples/schedulingExample.cpp b/gtsam_unstable/discrete/examples/schedulingExample.cpp index 2b52a3e3a..47bcd0a85 100644 --- a/gtsam_unstable/discrete/examples/schedulingExample.cpp +++ b/gtsam_unstable/discrete/examples/schedulingExample.cpp @@ -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(scheduler.product()); product.dot("scheduling-large", DefaultKeyFormatter, false); } diff --git a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp index 913bfb21a..869c13459 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp @@ -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(scheduler.product()); product.dot("scheduling-large", DefaultKeyFormatter, false); } diff --git a/gtsam_unstable/discrete/examples/schedulingQuals13.cpp b/gtsam_unstable/discrete/examples/schedulingQuals13.cpp index e52e3d0c6..487215e03 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals13.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals13.cpp @@ -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(scheduler.product()); product.dot("scheduling-large", DefaultKeyFormatter, false); }