SCons- *** No SConstruct file

Installed SCons using # cd scons-2.3.0 # python setup.py install

After installation, when I try to run scons, you received the following error.

scons: * SConstruct file not found. File "/usr/local/lib/scons-2.3.0/SCons/ Script / Main.py", line 905, in _main

How to overcome this?

+4
source share
1 answer

There are 3 ways to specify a SConstruct file when using SCons, as shown below:

  • Run scons from the root of the project where the SConstruct file should be. This is the most standard way.

  • From the project subdirectory where the SConsctruct file should be in the root, execute scons using one of the following options (as seen by scons -h) to tell her to find the directory structure for SConstruct

 -u, --up, --search-up Search up directory tree for SConstruct, build targets at or below current directory. -U Search up directory tree for SConstruct, build Default() targets from local SConscript. 
  • Explicitly indicate where the SConstruct file is located, this is also available from scons -h
 -f FILE, --file=FILE, --makefile=FILE, --sconstruct=FILE Read FILE as the top-level SConstruct file. 

Here is an example project in the directory /home/notroot/projectDir with the following directory structure:

 SConstruct subdir/file.hh subdir/file.cc 

Here's how to use the various options mentioned above:

Option 1:

Run scons from the project root directory

 # cd /home/notroot/projectDir # scons 

Option 2:

Run scon from the project directory and tell it to view the dir hierarchy for SConstruct

 # cd /home/notroot/projectDir/subdir # scons -u 

Option 3:

Run scons from the project directory and specify the path to SConstruct

 # cd /home/notroot/projectDir/subdir # scons -f /home/notroot/projectDir/SConstruct 
+9
source

Source: https://habr.com/ru/post/1486963/


All Articles