SCons- *** No SConstruct file found

不羁的心 提交于 2019-12-30 18:47:09

问题


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

After Installation, when i try to run scons , got the below error.

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

How to overcome this ???


回答1:


There are 3 ways to specify the SConstruct file when using SCons, as follows:

  • Execute scons from the root of the project, where there should be a SConstruct file. This is the most standard way.

  • From a subdirectory of the project, where there should be a SConsctruct file at the root, execute scons with one of the following options (as seen by scons -h) to tell it to look up the directory structure for the 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 specify where the SConstruct file is, 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 is how to use the different options mentioned above:

Option 1:

Execute scons from the root project directory

# cd /home/notroot/projectDir
# scons

Option 2:

Execute scons from within the project directory and tell it to look up the dir hierarchy for the SConstruct

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

Option 3:

Execute scons from within the project directory and specify the path of the SConstruct

# cd /home/notroot/projectDir/subdir
# scons -f /home/notroot/projectDir/SConstruct


来源:https://stackoverflow.com/questions/17182799/scons-no-sconstruct-file-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!