|
发表于 2015-11-14 19:16:07
|
显示全部楼层
Basic SystemC Installation
==========================
To install SystemC on a UNIX system, do the following steps:
1. Change to the top level directory (systemc-2.3.1)
2. Create a temporary directory, e.g.,
> mkdir objdir
3. Change to the temporary directory, e.g.,
> cd objdir
4. Choose your compiler by setting the CXX environment variable
(the configure script tries to guess the default compiler, if
this step is omitted):
If you use a POSIX-compatible shell (e.g. bash):
> export CXX="<compiler>"
e.g. for GCC compilers
> export CXX=g++
The Clang compiler is usually named 'clang++', thus e.g.
> export CXX=clang++
When using a C shell (e.g. csh/tcsh), the syntax to set the
environment variable is different:
> setenv CXX g++
For the Sun/Solaris Studio compilers, use
> setenv CXX CC
You can also specify an absolute path to the compiler of your choice.
See also the Section "Compilation and Linking Options" below.
5. Configure the package for your system, e.g.,
(The configure script is explained below.)
> ../configure
While the 'configure' script is running, which takes a few moments,
it prints messages to inform you of the features it is checking.
It also detects the platform.
Note for System V users:
If you are using `csh' on an older version of System V, you might
need to use the `sh ../configure' command instead of '../configure'.
Otherwise, `csh' will attempt to `configure' itself.
SystemC 2.3 includes a fixed-point package that is always built.
When compiling your applications with fixed-point types, you still have
to use compiler flag -DSC_INCLUDE_FX. Note that compile times increase
significantly when using this compiler flag.
In case you want to install the package in another place than the
top level directory (systemc-2.3.1), configure the package e.g. as
follows:
> ../configure --prefix=/usr/local/systemc-2.3.1
Note: make sure you have created the target directory before installing
the package. Do _not_ use /usr/local as a prefix, unless you
follow the Unix/FHS directory layouts (see below).
A fine grained configuration of the installation directories can
be achieved via additional options, given to the configure script.
By default, the files are installed directly to the PREFIX directory
root and the library is installed to PREFIX/lib-<TARGETARCH>,
depending on the current target architecture. This may be undesired
in cases where the package is meant to be installed in a system-wide
location as part of shared (default) library and include hierarchies
(e.g. /usr/local, /usr, /opt, ...). To follow the Unix/FHS directory
standards, you can use the following options:
--with-unix-layout use Unix directory layout for installation
[default=no]
when "yes", the following (fine-grained) settings will be used:
--includedir=DIR C++ header files [PREFIX/include]
--libdir=DIR object code libraries [EPREFIX/lib]
--docdir=DIR documentation root [DATAROOTDIR/doc/systemc]
The library destination itself can be further and separately configured
by using the following option:
--with-arch-suffix add suffix to library installation directory
[default=-<TARGETARCH>]
With this option, one can easily follow e.g. the "multi-arch"
conventions on some platforms:
../configure --with-arch-suffix=32 # lib32
../configure --with-arch-suffix=/x86_64-linux-gnu # lib/x86_64-linux-gnu
Several options are available to the configure script to modify
the compiler configuration and the selection of certain features:
--disable-shared do not build shared library (libsystemc.so)
--enable-debug include debugging symbols
--disable-optimize disable compiler optimization
--disable-async-updates disable request_async_update support
--enable-pthreads use POSIX threads for SystemC processes
--enable-phase-callbacks
enable simulation phase callbacks (experimental)
See the section on the general usage of the configure script and
"../configure --help" for more information.
Note: If you change the configuration after having compiled the
package already, you should run a "gmake clean" before
recompiling.
6. Compile the package.
> gmake
Note: The explicit gmake targets "opt" and "debug", etc. have
been removed in this package. Use the corresponding
options to the configure script instead.
7. At this point you may wish to verify the compiled package by
testing the example suite.
> gmake check
This will compile and run the examples in the subdirectory
examples.
8. Install the package.
> gmake install
9. You can now remove the temporary directory, .e.g,
> cd ..
> rm -rf objdir |
|