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,258
questions
-1
votes
2
answers
53
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
17
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
40
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
40
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
56
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
61
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
60
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
12
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
57
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
44
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
103
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
40
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
34
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
66
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
24
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
50
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
255
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
27
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
77
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
33
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
33
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
87
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
88
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
37
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
41
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
161
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
40
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 ...
-1
votes
1
answer
158
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
28
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:
...
0
votes
0
answers
257
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
49
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
27
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 ...
0
votes
1
answer
59
views
Purify build using scons
I need to do purify build using SCons. Normally in nmake we would do
Nmake install -purify_7.0.1.0-008
How to do the same in SCons? Do I need to add any change in SConstruct file?
-2
votes
1
answer
608
views
ModuleNotFoundError: No module named 'SCons' when trying to build a project on Eclipse with scons
I am trying to build a project with scons on Eclipse. When I do, the command line outputs the following:
Traceback (most recent call last):
File "<<<scons-location>>>/scons&...
1
vote
1
answer
36
views
How can I reference cousin objects in scons?
How can I get objects that are built under separate SConscripts in my program correctly? I have a directory structure that looks similar to this:
SConstruct
|
|---- moduleA
| |
| ----...
0
votes
1
answer
48
views
How can I require a generated file in my SConscript?
I'm working on adding googletest unit testing to a large project.
We have a top level SConstruct, which calls SConscripts for each of the git submodules, which may further call other SConstructs ...
0
votes
0
answers
85
views
Header only libraries with scons
I am new to scons so maybe my google-fu is really bad but I could not find a way to create a header-only C++ library. I know I can use CPPPATH to put directories in the include path but that is not ...
0
votes
0
answers
17
views
SCons: How to check if an construction variable is set
I am new to SCons. I want to modify the SConstruct file of gem5 to use clang and clang++ instead of default gcc and g++ compilers. I want to do this by modifying the CC and CXX values of main ...
0
votes
2
answers
147
views
Replacing "-W1,-rpath=\$ORIGIN" with "-W1,-rpath,\$ORIGIN" in Scons
I am trying to install Openloops on a Mac with Scons using their provided SConstruct file. During the installation process I get the following error:
ld: unknown option: -rpath=$ORIGIN
collect2: error:...
1
vote
2
answers
207
views
Rebuild target if it was externally changed while the source remained the same
I have a Flex source file and the result of converting it to C++ both stored in version control.
(Pretty common practice. This allows compiling the program on machines that don't have Flex installed.)
...
0
votes
1
answer
32
views
Vary CPPPATH based on file compiled
I have some .c files that will compile to .o files. These .c files include a third party .h file. I would like to only include the third party folder as an include location for only the files that ...
3
votes
3
answers
187
views
Get scons to distinguish an empty and a non-existing source while rebuilding
While building my program it is important to distinguish between files that don't exists and files that are empty.
However, it appears that scons treats them the same and neglect to rebuild a target ...
0
votes
1
answer
43
views
Caching Dependencies
How does scons cache the dependencies that is scans for C code?
The context of the question is I want to use that same technique in other languages.
Right now I have to do something like this:
env....
2
votes
1
answer
82
views
Scons for COBOL
I want to create a builder in scons works with COBOL.
Here is a start:
import re
Import('env')
# Source:
# src/cpy/COPYBK1.cpy
# src/cpy/COPYBK2.cpy
# src/cpy/COPYBK3.cpy
# src/bat/PROG1.cbl
# src/...
0
votes
1
answer
36
views
How to enable virtualenv inside SConstruct?
I need to run scons with --enable-virtualenv argument to make the third party python scripts called in SConstruct to work. Would like to know if I can achieve the same result by add some config in ...
0
votes
1
answer
43
views
Running copy command in SConstruct doesn't effect
When I want to copy file in Linux platform, with this SConstruct file:
Command('/lib64/'+ tbbLibNames[i] , tbb_dylibs + '/' + tbbLibNames[i], Copy("$TARGET", "$SOURCE"))
it doesn'...
0
votes
0
answers
66
views
Keep getting error while trying to add 3ds support to godot
I am trying to develop for the 3ds on Godot. I have been following this tutorial. Everything has been going smoothly until I get this error while trying to run the commandscons p=3ds -j4 target=...
0
votes
1
answer
104
views
failed to build gem5(stt/sdo/invisispec) with old version using scons 0.98.1 and python2.7
ubuntu version 20.04
python --version
Python 2.7.18
scons -version
script: v0.98.1.r2881
engine: v0.98.1.r2881
Since the latest gem5 use python3/scons3.0.0
and i tried the project with old version ...
0
votes
1
answer
50
views
`scons run` target completion for zsh
Is there scons target completion in zsh, similar to Makefile completion?
0
votes
0
answers
165
views
Error when install RosettaCommon using Scons
I'm building release executables for RosettaCommons, I input to the terminal with the following code:
scons bin mode=release
And I got the following error:
scons: Reading SConscript files ...
Running ...