FLiT icon indicating copy to clipboard operation
FLiT copied to clipboard

Executing binaries do not work outside of src directory

Open mikebentley15 opened this issue 7 years ago • 3 comments

When doing the full run, the compiled binaries get put into FLiT/results, but when I try to run them from that directory, I get the following error:

$ cd FLiT/results
$ ./GCC_thinkpad-mint_UNSOPTS_01
GCC_thinkpad-mint_UNSOPTS_01: ./S32FP/simple_convex_hull.cpp:295: void ReadInputs(FILE*): Assertion `infile != NULL' failed.
Aborted

But I do not get the error if I run from the src directory:

$ cd FLiT/src
$ ../results/GCC_thinkpad-mint_UNSOPTS_01
<expected output>
...

It seems this is a problem with the S32FP module and tests. There is probably a data file that is expected in a certain relative path. This should be fixed. Our litmus tests should not be so finicky.

mikebentley15 avatar Jun 07 '17 19:06 mikebentley15

It looks like the problem is in src/tests/SimpleCHull.cpp on line 30. It opens src/data/random_input. I recommend putting the data into the test file directly, to write to a temporary file, then pass that in to the S3FP module. Either that or change the S3FP code to take a std::stream instead of a FILE* and give it canned in-memory data.

I would prefer the first way.

mikebentley15 avatar Jun 07 '17 19:06 mikebentley15

The SimpleCHull test has been disabled until this bug can be resolved

mikebentley15 avatar Jun 20 '17 23:06 mikebentley15

Because tests are now guaranteed to be run from the top-level flit test directory, this is now expected behavior. If your test gives relative paths relative to the top-level flit test directory, then you are stuck to always call them from that directory. If your tests do not depend on relative paths, then you can run them from any directory.

As for the litmus tests provided as part of FLiT, I would prefer all tests to be agnostic to the directory they are run from. Therefore, I think the SimpleCHull example should have the data compiled in so that it does not depend on relative paths.

mikebentley15 avatar Jul 10 '19 23:07 mikebentley15