Table of Contents

Building the StdLib

First of all you want to make sure you meet the stdlib-build-requirements.

Then you should clone the GitHub repo, e.g. by

git clone https://github.com/SacBase/Stdlib.git
which will create a subdirectory named Stdlib which contains all the Stdlib sources. Before you start building them you need to make sure that

Once that is done, you can simply follow the instructions from the README file contained in your copy from GitHub:

Current Release

Please be Aware

All development of the stdlib is happening on GitHub as of this moment. Furthermore, a new build system has been implemented using CMake. Users still using a other version of stdlib (specifically contained within the Git repository branch stdlib-follow) should skip this section and go to Previous Releases.

Work in progress — Hans-Nikolai Viessmann 2016/12/05 22:44

Previous Releases

September 2016

Notice

This section concerns itself primarily with the building of the stdlib from the Git repository branch stdlib-follow.

Package Dependencies

You will need autoconf and related tools to be installed in order to build the stdlib; OSX / macOS users can find this in mac-ports.

Change your actual path to your check-out of stdlib. Then do

./bootstrap                           # this will scan through all source files
                                      # under /src and store their location for
                                      # later dependency generation. We also
                                      # call autotools and generate the
                                      # ./configure scripts

./configure                           # generate Makefiles

make SUB_CONFIGURE_FLAGS=--disable-opencv
                                      # builds all modules for all (several?)
                                      # targets within the target/<..target..>
                                      # directory. The make command can
                                      # instruct the per-target configuration
                                      # to enable/disable some features. This
                                      # is done by setting the variable
                                      # SUB_CONFIGURE_FLAGS on the command
                                      # line. See `sub/configure --help` for
                                      # further features that can be
                                      # enabled/disabled.

make EXCLUDEMODS="ArrayIO RGB"        # the EXCLUDEMODS var can be used to
                                      # instruct the build system to NOT
                                      # compile the listed modules, even
                                      # against what has been configured.

make INCLUDEMODS="ArrayBasics"        # the INCLUDEMODS will completely
                                      # override the build system and only
                                      # compile the listed modules, including
                                      # their dependencies recursively.

make COPT=2                           # the COPT allows you to control what
                                      # optimisation level is used by the
                                      # compiler, e.g. COPT=1 equates to -O2

make LINKSETSIZE=25                   # the LINKSETSIZE allows you to control
                                      # the SAC compilers `-linksetsize' flag,
                                      # e.g. LINKSETSIZE=15 equates to
                                      # -linksetsize 15

make install                          # moves all your targets into the 
                                      # location of the sac2c compiler

Note, that any call to sac2c will try to find any used or imported modules in the installed version of the stdlib that was installed with sac2c of the very same revision number! So, if you have a newer version of sac2c, be it installed or not, it will no longer find previously compiled and installed libraries! Likewise, if you modify your stdlib, compile it but do not install it, it will not be picked up!

To tackle these issues, you may want to add your stdlib-build-directory to your search pathes in TREE_OUTPUTDIR and LIB_OUTPUTDIR. For convenience, we recommend that you create or add to your local sac2crc file ˜/.sac2crc the following lines and replace STDLIB-BUILD_DIR by the absolute path to your own stdlib build:

target add_stdlib_local:
TREE_OUTPUTDIR += ":STDLIB-BUILD_DIR/lib"
LIB_OUTPUTDIR  += ":STDLIB-BUILD_DIR/lib"

target default_sbi :: add_default_sbi :: add_local :: add_stdlib_local:

Suggestion for Newbie Developers

If your aim is to primarily do stdlib development with no or almost no compiler development, we suggest you do not install a stdlib at all!

If you are doing primarily sac2c development we suggest you install a compiled version for each version of sac2c that you install. That way, you can try older compiler versions without being required to recompile the corresponding stdlib!

In both cases you should put the above lines into your local .sac2crc file!

Pitfalls