FTensor build and test guide

This page is a guide to running the testing and timing programs for the FTensor tensor class library as part of GCC integration testing.

Resource usage

The uncompressed distribution comprises some 2.9 MB of source files.


To prepare for a build, perform the following:


FTensor tests in directory tests/conformance exercise most of the package's possible operations, and the tests in directory tests/speed compare how fast the FTensor classes are compared to ordinary arrays. See the file tests/README for more information about the two sets of tests.

To build and run the subset of conformance tests meant for compiler testing, do:

cd tests/conformance
make CXX=<compiler> CXXOPTIMIZE="<flags>" test_compiler

The conformance tests print out PASS or FAIL followed by a unique test name. There should be no failures.

The path to the C++ compiler is defined in CXX and the compiler optimization options are defined in CXXOPTIMIZE in the Makefile. If you don't override them as shown above, CXX will be g++ and CXXOPTIMIZE will be the flags that are normally used by FTensor developers and users. Testing with the usual flags ensures that FTensor will work for its users on your platform; testing with other optimizations might uncover GCC bugs.

To build and run the performance tests using the optimizations that are normally used for them, simply do:

cd tests/speed
make CXX=<compiler> CXXOPTIMIZE="<flags>" one_over one_over_fast

In addition to printing timing information, one_over_script prints out PASS or FAIL for each performance test, followed by the unique test name. There should be no failures.


The timing information output by the script tests/speed/one_over_script can be compared for different versions of GCC, starting with version 3.1.


Cleanup (to prepare for a fresh run, e.g. with another version of the compiler), is done as follows:

(cd tests/conformance; make clean)
(cd tests/speed; make clean)