Questions tagged [scons]
SCons is a cross platform, open source build tool and an alternative to the classic "Make". It works based on a declarative description of a build, using the Python programming language.
1,275
questions
-1
votes
0
answers
43
views
SCons : Jar Builder is not working as expected
We are using Scons 4.3.0 with Python 3.9 and using below script to create jar file
# Build jar
envJava['JAVACLASSPATH'] = ['./java/build', '$COMMSVR/lib/junit3.8.1/junit.jar']
configdata_classes = ...
0
votes
1
answer
47
views
How to call SCons global function from a helper-script called by a SConscript?
I have some non-trivial logic necessary to compute the paths to certain source & header file directories and since it applies to multiple SConscripts I put it in a separate .py file, imported from ...
1
vote
2
answers
72
views
How to use -isystem instead of -I to include directories of third-party projects in scons?
Recently, I found that by adding -Wall and -Wextra to CFLAGS can raise the compilation warning level.
And this exposes some hidden bugs.
But I do not wish to edit the warnings in the 3rd party code.
...
0
votes
1
answer
40
views
Controlling scons environment checking options
I'm trying to build mongodb (open source version 4.2) which uses python and scons for building. The problem relates to scons rather than mongodb.
My build fails very early with Couldn't find OpenSSL ...
0
votes
1
answer
63
views
Compiling C++ with Scons and Emscripten
I want to build a simple HelloWorld program for web using the Scons build system with emscripten.
I have this simple program:
#include <stdio.h>
#include <emscripten/emscripten.h>
void ...
0
votes
1
answer
35
views
Target dependent ParseConfig
I'm trying to only build a library without having all tests dependencies available,
my tests directory have it's own SConscript file that run env.ParseConfig('pkg-config --libs --cflags ...
0
votes
0
answers
38
views
ARGUMENTS['var'] in SCsub returns KeyError, but the var is set in config.py
I'm using SCons to build Godot with my custom module. It works, but I wanted to add some functionality there and have 'debug.py' and 'release.py' to be used as profile argument, not a single 'config....
1
vote
1
answer
20
views
How to prevent a change of a specific flag from triggering a rebuild?
I've added the option -fdiagnostics-color for GCC in my build.
It only changes colors in error commands so I don't want the targets to rebuild when this option is the only thing that has changed.
For ...
0
votes
1
answer
37
views
Remove outdated intermediate files before the build
I have a project where a lot of the source files needs to be modified by a script before they are compiled.
The build process has 2 steps:
Run a script on the original sources to create intermediate ...
0
votes
0
answers
71
views
Gem5 simulator installing scons build Error
I got the below errors after compiling Gem5 simulator (downloaded from Gem5.org) on ubuntu 20.04 using VirtualBox.
what are these errors and how can I fix them, please?
the command is: scons build/X86/...
1
vote
1
answer
127
views
Attaching .pdb to a compiled .exe in Visual Studio 2022
I am trying to debug a .exe file with a .pdb. The project is using SCons, and here is the part where it compiles in sconstruct:
env.Append( CCFLAGS=["/EHsc"])
env.Append( CCFLAGS=["/...
0
votes
1
answer
98
views
SCons build object files in source folders, rather have them in "build" folder
I'm very new to SCons and working on a project, where I am supposed to implement SCons.
The directory layout is like this:
Folder
build
subfoldr1
subsubfoldr1
SConscript1
subfoldr2
subsubfoldr2
...
0
votes
1
answer
461
views
undefined reference to '__atomic_*' in SCons but similar questions' solution won't work
I'm trying to build Godot with SCons. Everything was working fine until I've used std::atomic in my library my custom module uses (the library is working fine with a Qt application I've created to ...
0
votes
2
answers
245
views
'scons' not recognisable on command line
So I installed python-3.10.7 on a fresh windows 10 PC, then used pip install scons to install scons but I keep getting the following error when I type scons in terminal.
C:\Users\tempm>scons
'scons'...
0
votes
2
answers
38
views
Scons set s directory as NoClean
I'm using scons as my build system of c++.
There's a sub directory that contains a static library.
I've tried to set:
NoClean("${PATH_TO_DIR}")
But the files in this directory are still ...
0
votes
2
answers
268
views
Basic SCons example throwing `Do not know how to make File target `helloworld' error
I'm trying to follow this tutorial to build a simple C program using SCons. I created a file called SConstruct which contains the following:
env = Environment() # construction environment
env.Program(...
0
votes
1
answer
68
views
How long is a gem5 build with "gem5 scons build/ARM/gem5.opt -j2" expected to take on a docker container?
I need to simulate a cpu with an arm ISA and I followed the instructions on https://www.gem5.org/documentation/general_docs/building to build gem5 on a docker container. I'm on an m1 Mac and I have ...
1
vote
0
answers
110
views
scons cross-compilation for ARM64 target on x86-64 host
I'm trying to build an application using scons on x86-64 host Windows machine for Windows ARM64 target. I'm using Microsoft Visual Studio 2019 cross-compilers for ARM64 ("C:\Program Files (x86)\...
-1
votes
2
answers
62
views
How can python code in a Scons script ascertain that it's being run as part of a clean operation?
Is there a runtime variable that can be checked during tree generation if the scons -c flag has been provided?
Additional Context:
Suppose you have a Sconscript that generates a target "TARG"...
0
votes
0
answers
31
views
I meet a error when build gem5 x86, build/X86/ext/libelf/elf.c:34:29: error
I meet a error when build gem5 x86, build/X86/ext/libelf/elf.c:34:29: error
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
scons: done reading SConscript files.
scons: Building ...
1
vote
1
answer
205
views
How to make SCons export compile commands including flags pointing to a conda virtual environment?
I'm working on a C++ project that is built with SCons. I installed SCons using my system's package manager. The project has some dependencies that I installed into a virtual environment using conda. I ...
0
votes
0
answers
127
views
Error when trying to run `scons platform=windows generate_bindings=yes` into godot-cpp. Following a GDNative Tutorial
I was following this tutorial on youtube, and on Github. When I run the command scons platform=windows generate_bindings=yes inside of gdtest/godot-cpp I get the following error. I have VS 2022.
C:\...
0
votes
2
answers
135
views
Fatal error when trying to write scons platform=windows generate_bindings=yes. Following gdnative cpp tutorial
I was following this tutorial on youtube,
and on Github. When I run the command scons platform=windows generate_bindings=yes inside of gdtest/godot-cpp I get the following error. I have VS 2022.
C:\...
0
votes
1
answer
151
views
SCons: ld cannot find standard libraries
I'm developing a game with raylib using SCons for building. I'm using Clang to cross compile from Ubuntu (in WSL) to Windows. My project directory contains a lib directory with the raylib binaries and ...
0
votes
0
answers
72
views
Correct dependencies do not trigger rebuild
Premise: at our company, we are using python 2.7 with SCons 2.3.
The stucture of our project is as follows:
.
├── 3rd_party
│ └── ccur
│ ├── SimWB-2020.1
│ │ └── include
│ │ ...
0
votes
1
answer
23
views
How to get path to the current SCons executable in a SCons script?
I'm trying to build an executable from another external SCons project to use it in my SCons build.
At first I tried to run:
Command('other_project_dir/executable', None, 'scons -C other_project_dir')
...
1
vote
0
answers
79
views
Which scons command is good for compiling my godot native script project?
I want to use C++ script for my Godot project so I am trying to build the godot-cpp repository with scons.
Which command do I have to use?
0
votes
1
answer
64
views
Creating a C string macro with SCons
To create macros with SCons this seems to work for integers:
env.Append(CPPDEFINES=["MY_NUMBER_MACRO={0}".format(0))
Trying something similar with strings:
env.Append(CPPDEFINES=["...
0
votes
3
answers
435
views
Build failed gem5 with error file not found when the file exists in fact
When I try to build gem5 on wsl2 Ubuntu_20.04, it failed.
I use the steps in this page, and after I command the
scons build/X86/gem5.opt -j9
The build failed with:
scons: Reading SConscript files ...
...
-2
votes
1
answer
53
views
Using two compiler in one sconscript (nvcc, g++)
How can I use both of the compiler in one sconscript?? Some of the details of the sconscript is shown below:
I have a .cu file and with nvcc -c test.cu, I could generate a .o file. How can I import ...
2
votes
1
answer
89
views
Get node path relative to the SConstruct from inside a SConscript
In a hierarchical build, one of my SConscript files, located in a sub-directory needs to print paths of a few nodes (for use by an external script). However, the paths need to be relative to the main ...
0
votes
2
answers
132
views
Disable paralled build for a specific target
I need to disable parallel run for a single target. It is a test that verifies if program doesn't create some random or incorrectly named files. Any other file that is build in the meantime fails this ...
1
vote
0
answers
71
views
Problem with Running gem5: gem5.opt isn't generated after running /usr/bin/env python3.9 $(which scons) build/RISCV/gem5.opt -no-pie
I am trying to set up gem5 for RISCV on Ubuntu 18.04. I first ran the following commands:
sudo apt install build-essential
apt install m4 zlib1g-dev scons python-six python-dev
git clone https://gem5....
0
votes
0
answers
90
views
linking problem with dlfcn DLFCN-WIN32 library
I am currently trying to use the DLFCN-WIN32 library in order to use a c++ script originally implemented to use the dlfcn.h library.
When compiling the code (cantera V2.3), everything goes well except ...
2
votes
1
answer
474
views
How to manage source file dependencies automatically and fast build for large C++ project?
I am working on a c++ codebase using CMake with 500k+ lines of code. One problem I realize is that the (incremental) build speed is really slow.
Partly because the dependencies graph is not fine ...
0
votes
0
answers
57
views
Add Icon to ".exe" while building with SCONS
I am working with C and building my project with Scons.
My Sconstruct
Program("bin/output", [Glob("src/*.c")])
This gives me output.exe.
How can I add an icon to my .exe file with ...
0
votes
1
answer
118
views
Export variable from scons script to source file
I have an environment variable ( key value) pair in scons script. I want to export the value of this variable in a cpp source file.
How do I do that?
Because scons scripts may not be available after ...
0
votes
0
answers
46
views
Godot Engine 3.4.4 source compilation error after editing editor SVGs
I compiled the engine successfully without changing anything, but after editing "...\editor\icons\ *.svgs" with inkscape, I got an error.
D:\C2\godot-3.4.4-stable\editor\editor_icons.gen.h(...
0
votes
0
answers
60
views
Scons rebuilds everything under Ubuntu 20.04
I'm doing build management for a fairly large C++ project. Under Ubuntu with Linux 18.04, using Python 2.7, scons behaves as it should - that is,
make clean
scons <command line options>
scons &...
0
votes
0
answers
206
views
Gem5 v21.2.1.0 build error with hdf5 begin() undefined reference
I was trying to build the gem5 v21.2.1.0 with default configuration and had this error. I could build previous versions of gem5 (v20/v19) without similar issues.
g++:
:: g++ --version
g++ (...
-2
votes
1
answer
187
views
Unable to create c++ dll using Scons
I am trying to compile a c++ program in Scons. For c++ its giving the following error:
o Untitled_game_godot\bin\win64\libgd.dll -shared -Lgodot-cpp\bin -llibgodot-cpp.windows.debug.64
o not ...
0
votes
1
answer
51
views
Which build tool supports a separated config folder so that no config files are in the src folder?
i am looking for a build tool that allows me to store the build tool with additional pre and postscripts as well as the build configs in folders separated from the source code.
Most build tools i ...
0
votes
1
answer
75
views
Implement a SCons source code formater. Modify a source file before compiling it
I want to format my C/C++ source code before every compilation.
I found no information how to do it in SCons.
Ideas I tried:
What I would need: a Builder that has the same files for source and target....
0
votes
1
answer
242
views
Internal Error: no cycle found in Scons Build
When I build my Sconstruct file, I am getting the below error.
scons: *** Found dependency cycle(s):
build/sselser/sselConfigArgs.h -> build/sselser/sselConfigArgs.h
Internal Error: no cycle ...
1
vote
1
answer
59
views
How to shorten scons compilation output
Currently i'm compiling my unittests for a big c++ project with scons (2.2.0).
The include paths combined has more than 10000 characters.
Scons is creating a temp file to handle this, but prints out ...
0
votes
1
answer
259
views
SCons builder changes working directory to target file directory
I'm faced with the following situation. There is the simplest example of SCons builder (that does almost nothing) and pseudobuilder:
#------------------------------------------------
#
# Builder
#
...
0
votes
0
answers
35
views
Using imported variable in LIBPATH in Scons
I have a Sconstruct file where I have declared all libraries and imported all those variable in sconscript files.
Sconstruct:
env = Environment()
SCF=['path of the library']
Export(SCF)
Sconscript:
...
1
vote
0
answers
450
views
Import Error Occurs when Building GEM5 : undefined symbol
I am trying to follow default "Getting Started with GEM5" at the gem5.org
But build fails because of import error.
Especially, it seems /usr/local/lib/python3.6/lib-dynload/_struct.cpython-...
0
votes
1
answer
71
views
SCons generates an incomplete dependency tree if I use a custom decider
I'm trying to build a flex-bison parser with SCons, using a custom decider. (You can learn more about the decider in this question, although, the details probably aren't too relevant to the current ...
0
votes
0
answers
45
views
SCons: Jar Builder: How do you add resource files (foo.properties, bar.gif, etc.)
When I try to add resources to the source list of a env.Jar(), SCons tries to compile the resources. The code in jar.py looks like it should check for the JAVASUFFIX and just leave non-'.java' files ...