SCons- *** 未找到 SConstruct 文件 [英] SCons- *** No SConstruct file found
问题描述
使用安装的 SCons# cd scons-2.3.0# python setup.py install
安装后,当我尝试运行 scons 时,出现以下错误.
scons:* 未找到 SConstruct 文件.文件/usr/local/lib/scons-2.3.0/SCons/Script/Main.py",第905行,在_main
如何克服这个???
使用SCons时指定SConstruct文件有3种方式,如下:
从项目的根目录执行
scons
,这里应该有一个 SConstruct 文件.这是最标准的方式.从项目的子目录中,在根目录下应该有一个 SConsctruct 文件,使用以下选项之一(如 scons -h 所见)执行
scons
告诉它查找 SConstruct 的目录结构
-u, --up, --search-up搜索 SConstruct 的目录树,在或构建目标在当前目录下.-U搜索 SConstruct 的目录树,构建 Default() 目标来自当地的 SConscript.
- 明确指定 SConstruct 文件的位置,这也可以从
scons -h
-f FILE, --file=FILE, --makefile=FILE, --sconstruct=FILE将 FILE 作为顶级 SConstruct 文件读取.
这是/home/notroot/projectDir
目录下的一个示例项目,其目录结构如下:
SConstruct子目录/文件.hh子目录/file.cc
以下是使用上述不同选项的方法:
选项 1:
从项目根目录执行scons
# cd/home/notroot/projectDir# scons
选项 2:
从项目目录中执行 scons 并告诉它查找 SConstruct 的目录层次结构
# cd/home/notroot/projectDir/subdir# scons -u
选项 3:
从项目目录中执行 scons 并指定 SConstruct 的路径
# cd/home/notroot/projectDir/subdir# scons -f/home/notroot/projectDir/SConstruct
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 ???
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
这篇关于SCons- *** 未找到 SConstruct 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!