tests: Add '--duplicate-sources' to libgem5 SST build

Unfortunately the building of SST (in "ext/sst") depends on generated
header files. Therefore it adds the build directory to the include path.
For this to work the libgem5.so must be build with
"--duplicate-sources".

Change-Id: I5ed26a89c81402d421f5dfa110de7cf758f28694
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70497
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2023-05-10 12:19:38 -07:00
committed by Alex Richardson
parent fccd13ac85
commit c4d61ca143
2 changed files with 5 additions and 2 deletions

View File

@@ -61,9 +61,12 @@ echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/" >>
At the root of gem5 folder,
```sh
scons build/RISCV/libgem5_opt.so -j $(nproc) --without-tcmalloc
scons build/RISCV/libgem5_opt.so -j $(nproc) --without-tcmalloc --duplicate-sources
```
**Note:** `--without-tcmalloc` is required to avoid a conflict with SST's malloc.
`--duplicate-sources` is required as the compilation of SST depends on sources to be present in the "build" directory.
### Compiling the SST integration
At the root of gem5 folder,

View File

@@ -159,7 +159,7 @@ build_and_run_SST () {
"${gem5_root}" --rm --memory="${docker_mem_limit}" \
gcr.io/gem5-test/sst-env:${tag} bash -c "\
scons build/${isa}/libgem5_${variant}.so -j${compile_threads} \
--without-tcmalloc --ignore-style && \
--without-tcmalloc --duplicate-sources --ignore-style && \
cd ext/sst && \
make clean; make -j ${compile_threads} && \
sst --add-lib-path=./ sst/example.py && \