tudat-team / tudat

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

Failing tests for Clang build on Windows using MSVC libraries #7

Closed geoffreygarrett closed 2 years ago

geoffreygarrett commented 3 years ago

The tests fail due to tolerances in tests being exceeded. This must be resolved, but for now these tests will be omitted from the feedstock releases in the YOLO/YOLOAddTestCase.cmake file (on tudat/develop branch), in order to meet deadlines for Numerical Astrodynamics.

The following tests FAILED:
         12 - test_basic_astro_OrbitalElementConversions (Failed)
         21 - test_basic_astro_TimeConversions (Failed)
         26 - test_basic_astro_SphericalOrbitStateConversions (Failed)
         70 - test_shape_based_HodographicShaping (Failed)
         92 - test_orbit_determination_EstimationInput (Failed)
         95 - test_orbit_determination_HybridArcStateEstimation (Failed)
        142 - test_propagators_VariationalEquations (Failed)
        160 - test_basics_TimeTypes (Failed)
        221 - test_io_MultiArrayReader (Failed)
Errors while running CTest

Either we change the tolerances or determine why occurs with MSVC libraries compiled with Clang.

DominicDirkx commented 3 years ago

Hi Geoffrey, could you also post the (link to) the full error output here?

geoffreygarrett commented 3 years ago

This remains only to be seen on local builds. This is because the complete building of the tudat test-suite results in the Azure server running out of memory. The build log which I do have available (only as far back as test 88) is this. When I have a moment to modify the compiler configurations and try mitigate memory usage, I'll get back to posting the full log.

DominicDirkx commented 2 years ago

https://dev.azure.com/tudat-team/30083fed-1a6f-4bb8-982c-21d0eefb8bc6/_apis/build/builds/439/logs/34

This link has all the errors in it that we need to fix.

DominicDirkx commented 2 years ago

I've resolved most of them, and am rebuilding for addititonal output concerning the failing ones:

https://dev.azure.com/tudat-team/feedstock-builds/_build/results?buildId=441&view=results

The ones that still will fail:

DominicDirkx commented 2 years ago

Hi all, I've made some progress in this, but the one test still failing is the test_io_MultiArrayReader. I'm completely stumped on why this test is failing, and could use some assistance.

The failure is occuring on this line, only on Windows (MSVC):

https://github.com/tudat-team/tudat/blob/master/tests/src/io/unitTestMultiArrayReader.cpp#L157

In this line, the dCDw4DTest1.txt file (attached here) is being read, which is a file of aerodynamic coefficients. For some reason, the reader files on line 9 of this file, which reads:

0.0070 0.0050 0.0030 0.0010 -0.0010 -0.0050 -0.0080 -0.0130 -0.0180

For some reason, which I cannot for the life of me figure out, the code does not read the first value (0.0070), and instead starts at 0.0050. I've added some output statements to the code:

https://github.com/tudat-team/tudat/blob/feature/windows_test_fixes/src/io/multiDimensionalArrayReader.cpp#L255-L264

resulting in error output (on the azure Windows build: https://dev.azure.com/tudat-team/30083fed-1a6f-4bb8-982c-21d0eefb8bc6/_apis/build/builds/443/logs/31)

2021-11-24T15:19:32.3427227Z 218: Entry 0:0.0050 2021-11-24T15:19:32.3427667Z 218: Entry 1:0.0030 2021-11-24T15:19:32.3428592Z 218: Entry 2:0.0010 2021-11-24T15:19:32.3429502Z 218: Entry 3:-0.0010 2021-11-24T15:19:32.3429978Z 218: Entry 4:-0.0050 2021-11-24T15:19:32.3430492Z 218: Entry 5:-0.0080 2021-11-24T15:19:32.3430956Z 218: Entry 6:-0.0130 2021-11-24T15:19:32.3436274Z 218: Entry 7:-0.0180 2021-11-24T15:19:32.3437447Z 218: unknown location(0): fatal error: in "test_multi_array_reader/testMultiArrayReader": class std::runtime_error: Error on data line 0 found 8 columns, but expected 9. Current line is:0.0050 0.0030 0.0010 -0.0010 -0.0050 -0.0080 -0.0130 -0.0180. Current file name is:D:/bld/tudat_1637757294634/work/build/tests/data//dCDw4DTest1.txt

What the code should be doing, is taking each line of numbers, and cutting it into separate piece, and store these pieces (values on each line), into a vector of strings, which then gets converted into the correct matrix entries. Because it's ignoring the first entry, the size that it finds and expects don't match, and an exception gets thrown.

Any help would be much appreciated!

dCDw4DTest1.txt

DominicDirkx commented 2 years ago

Issue has been addressed with speedy help from Jeremie G (from Slack):

Jeremie G 1 hour ago I don't have the occasion to run this code on my machine to test my intuition, but I wonder if this would not be an issue with the line endings of the txt file. Perhaps std::getline does not handle the fact that the end lines ar LF when running under Windows. I attach the datafile with CRLF endings instead, in case you want to test this. Also, this txt file separate data by using spaces everywhere except between 0.7 and 0.9 in the first line of the header (4th line of the file). I changed it to a space just in case. These may not fix it, but I would personnaly run them just in case this easy fix does the job.