This file contains instructions on how to build and run the srcfacts program.
This project does not support an in-source build. The instructions are based on a build subdirectory. You can also use a sibling directory of the source.
The commands are given in terms of make
. If you setup cmake with ninja
as your build tool (highly recommended), then just replace make
with ninja
in those commands.
Create a build directory and move into it:
mkdir build
cd build
Once in your build directory run cmake with a path to the (parent) source directory:
cmake ..
Running cmake with the path to the source directory is only needed the first time. From then on, you can directly run cmake in the build directory:
cmake .
You can then perform the build:
make
An example input file is provided. To run with make:
make run
To run on the command line:
./srcfacts < data/demo.xml
You can also time it:
time ./srcfacts < data/demo.xml
Tracing shows each parsing event on a separate output line. Trace is off by default. To turn tracing on:
cmake .. -DTRACE=ON
To turn tracing back off:
cmake .. -DTRACE=OFF
The included demo file is quite small. In order to check scalability, a much larger example can be used. This larger example is the srcML file for linux-6.0 and consists of 55,174 linux source-code files. The zip archive download is not that big (over 280 MB), but the unzipped file is extremely large at over 4 GB.
To download the linux kernel example, use the following cmake option:
cmake . -DDOWNLOAD_BIGDATA=ON
This option does not directly download the file, but provides instructions and a warning about the resulting file size. To confirm the download, use the following cmake option:
cmake . -DDOWNLOAD_BIGDATA_CONFIRM=ON
The resulting file, linux-6.0.xml, is placed in the data subdirectory of your build.
To run this linux kernel example with your program, use the following make command:
make run_bigdata
To run on the command line:
./srcfacts < data/linux-6.0.xml
You can also time it:
time ./srcfacts < data/linux-6.0.xml