This repository consists of SaC modules with basic functionality like arithmetic, stdio, etc; which together form the standard library of the SaC language.
To build the system one requires an operational CMake >= 3.20, Flex, and Bison.
An example on how to build the library:
cd Stdlib
git submodule init
git submodule update
cmake -B build
cmake --build build -- -j4 # you should have roughly 2GB per thread :-)If you like you can also install the stdlib into /usr/local with make install, but this is unnecessary as sac2c will be able to find your stdlib
build automatically. This is achieved through a file named sac2crc.package.stdlib
which is being placed in ~/.sac2crc/ and which contains the path to the place
where you build your stdlib
NOTE: When pulling the latest commit, remember to run git submodule update or you will be missing changes to the cmake-common repository.
When running CMake it is possible to pass the following variables:
-DTARGETS=x;y;z--- build stdlib for targets x, y and z. (Defaults toseq;mt_pth)-DBUILDGENERIC=ON|OFF--- build stdlib without using architecture specific optimisations (useful when creating distributable packages). (Default isOFF)-DSAC2C_EXEC=/path/to/sac2c--- specifysac2cexecutable directly. Otherwise CMake will try to findsac2con yout PATH.-DLINKSETSIZE=n--- set-linksetsize nwhen callingsac2c. This option is responsible for the number of C functions that are put in a single C file when compiling a SaC program. The rule of thumb:-
value
0is the fastest time-wise but potentially results in a large memory consumption -
value
1reduces the memory consumption to minimum, but significantly increases compilation time.Default value: 500.
-
-DFULLTYPES=ON|OFF--- add support for further types to the stdlib, such aslongandlonglong(Default isOFF).-DBUILD_EXT=ON|OFF--- build extended stdlib (seecmake/source-core-ext.txtfor details) (Default isON)
We make use of Github Actions for our CI pipeline, building the standard library on different systems anytime there is a pull request. Build will fail if there are any compile-time warnings.
Currently we build on the following systems: ubuntu-18.04 and macos-11.
Please look at .github/workflows/ for more exact details on what we do.
This project is OSS, please have a look at LICENSE.md for more details. Contributions are welcome!