tudat-team / tudat

A C++ platform to perform astrodynamics and space research.
BSD 3-Clause "New" or "Revised" License
17 stars 28 forks source link

Use Conda-Forge's CSPICE Package in Tudat #225

Open geoffreygarrett opened 3 months ago

geoffreygarrett commented 3 months ago

Please review and merge, @DominicDirkx. With this update, we will no longer need to maintain our own cspice fork and can instead utilize the peer-reviewed package maintained by astrojuanlu and AndrewAnnex available at conda-forge/cspice-feedstock. This change is long overdue. Re-rendering our own cspice was causing issues, and switching to the conda-forge package has proven to be a much faster and more sustainable solution.

Testing Procedure

I followed these steps to ensure that the integration of the conda-forge cspice package works correctly with Tudat:

  1. Created a new conda environment using the environment.yaml provided in the Tudat repository.

    conda env create -f environment.yml
    conda activate tudat
  2. Set up the build directory and configured the project using CMake:

    mkdir build
    cd build
    cmake .. -DCMAKE_PREFIX_PATH=${CONDA_PREFIX}
  3. Built the specific test target and ran it using ctest:

    cmake --build . --target test_spice_SpiceInterface
    ctest -R test_spice_SpiceInterface

    Test Results:

    Test project /home/geoffrey/tudat/build
       Start 205: test_spice_SpiceInterface
    1/1 Test #205: test_spice_SpiceInterface ........   Passed    0.03 sec
    
    100% tests passed, 0 tests failed out of 1
    
    Total Test time (real) =   0.05 sec

These results confirm that the cspice library from conda-forge is compatible with our current Tudat setup and meets all our requirements. This switch should simplify our dependencies and reduce maintenance overhead.

geoffreygarrett commented 3 months ago

This works locally on my macbook so I'm not sure why it's failing on mac. Some of the failures seemed to suggest that the mac build was working with the wrong CMake files, but it doesn't seem to have been loading from the wrong build cache.

Local:

-- Found Boost: /Users/geoffreygarrett/mambaforge/envs/tudat/lib/cmake/Boost-1.85.0/BoostConfig.cmake (found suitable version "1.85.0", minimum required is "1.72.0") found components: filesystem system regex date_time thread chrono atomic unit_test_framework
-- Detected Boost version: 1.85.0
-- Boost include dirs: /Users/geoffreygarrett/mambaforge/envs/tudat/include
-- Checking for _GLIBCXX_USE_CXX11_ABI definition...
-- _GLIBCXX_USE_CXX11_ABI was not found.
/Users/geoffreygarrett/mambaforge/envs/tudat/lib/cmake/tudatresources/../../../include
-- Found CSpice: /Users/geoffreygarrett/mambaforge/envs/tudat/lib/libcspice.dylib (found version "67.0.0")
-- Found CSpice: /Users/geoffreygarrett/mambaforge/envs/tudat/include (found version 67.0.0)
-- Extended precision propagation disabled!
-- TUDAT_DATA_DIR_RELATIVE_TO_INSTALL_PREFIX: data/tudat
-- Configuring done (1.4s)
-- Generating done (1.1s)

@niketagrawal maybe you might have an opinion given you authored the test_and_build workflow.

DominicDirkx commented 3 months ago

Sounds great! Before merging this into develop, I think it's also crucial to test if all the builds on Azure of both tudat and tudatpy are still successful. When they are, I think this is great!

Listing required tasks before merging: