Changes between Version 1 and Version 2 of SoCLIB_configuration


Ignore:
Timestamp:
Jan 18, 2013, 11:57:53 AM (11 years ago)
Author:
meunier
Comment:

Mise à jour des infos à partir de la page soclib correspondante

Legend:

Unmodified
Added
Removed
Modified
  • SoCLIB_configuration

    v1 v2  
    1 Modify .soclib/global.conf as the following:
     1
     2''Note: The following information is taken from the [http://www.soclib.fr/trac/dev/wiki/SoclibCc/SoclibConf soclib] trac.''
     3
     4SoCLib's configuration file is used by `soclib-cc` to find your tools paths. You may override:
     5
     6 * `libraries`: SystemC implementation to use (its paths, ...), tlm, ...
     7 * `toolchain`: Compiler and compiler flags
     8 * `build env`: toolchain, libraries and other flags (where objects reside, ...)
     9
     10Let's suppose we want to override SystemC's path, we can write the following `~/.soclib/global.conf`:
    211
    312{{{
    4 config.systemcass = Config(
    5        base = config.systemc,
    6        dir = "/path/to/systemcass/",
    7        libs = ["-Wl,-rpath,%(libdir)s", "-L%(libdir)s", "-lsystemc", "-ldl"],
    8        )
     13#!python
     14config.libsystemc_22 = Library(
     15        parent = config.systemc,
     16        dir = "/home/me/tools/systemc/2.2"
     17        )
    918
    10 config.use_systemcass = Config(
    11        base = config.default,
    12        systemc = config.systemcass,
    13        repos = config.default.repos + "/systemcass",
    14        )
     19config.foo = BuildEnv(
     20        parent = config.build_env,
     21        libraries = [config.libsystemc_22],
     22        )
     23
     24config.default = config.foo
    1525}}}
     26
     27Now let's suppose we would like to add another configuration where we use !SystemCass. We don't want compiled objects to mix-up, so we'll set another repository for built files.
     28
     29{{{
     30#!python
     31config.libsystemcass = Library(
     32        parent = config.systemc,
     33        dir = "/home/me/tools/systemc/cass",
     34        libs = config.systemc.libs + ["-Wl,-rpath,%(libdir)s", "-ldl", "-fopenmp"],
     35        )
     36
     37config.systemcass = BuildEnv(
     38        parent = config.default,
     39        repos = "repos/systemcass_objs",
     40        libraries = [config.libsystemcass],
     41        )
     42}}}
     43
     44Now if we want to compile a platform with !SystemCass, the only thing to do is to tell it to `soclib-cc`:
     45
     46{{{
     47$ soclib-cc -t systemcass
     48}}}
     49
     50The argument after -t is the configuration name, attribute set to config in this line:
     51
     52{{{
     53config.systemcass = BuildEnv( ....
     54}}}
     55
     56
     57The only configuration names that can be passed to `-t` are the ones associated to `BuildEnvs`.