SCons User's Guide chapter I: Compiling and installing scons

Source: Internet
Author: User

1. Install PythonBecause SCons is written in Python, you have to install Python before using SCons. Before you install Python, you should be aware of whether Python is available in your system (running Python-v or Python--version on the system's command line). $python-V Python 2.5.1 in a Windows system,C:\>python-v python 2.5.1 If Python isn't installed, you'll see an error message such as "Command not Found" (in Unix or Linux) or "Python is not recognized as" I nternal or external command, operable program or batch file (in Windows). In this case, you need to install Python before you install scons. Information about downloading and installing Python can be obtained from http://www.python.org/download/.
2. Install SCons from pre-compiling package 2.1. Install scons in red Hat (or RPM) Linux systemIn Red Hat Linux,fedora, or any other Linux distribution, using the RPM (Red Hat Package Manager), SCons is the precompiled RPM format, ready to be installed. Your distribution may already contain a precompiled scons RPM. If your distribution supports Yum installation, you can run the following command to install SCons: #yum install scons If your Linux distribution does not contain a specific scons rpm file, you can download the SCons project provided by the generic RPM to install. This installs the SCons script to the/usr/bin directory, installs the SCons Library Module (library modules) to/usr/lib/scons. Install from the command line, download the appropriate. rpm file, and then run: #rpm-UVH scons-2.1.0-1.noarch.rpm
2.2. Install scons in Debian Linux systemIf your system is connected to the Internet, you can run the following command to install the latest official Debian package: #apt-get Install SCons
2.3. Install scons in Windows systemSCons provides a Windows Installer that makes installation very easy. Download Scons-2.1.0.win32.exe from http://www.scons.org/download.php. Then all you have to do is execute the file.
3. Compile and install scons in any systemIf you don't have a precompiled SCons package in your system, you can easily compile and install scons using the local Python distutils package. The first step is to download scons-2.1.0.tar.gz or scons-2.1.0.zip, address http://www.scons.org/download.html. Unzip the downloaded file, create a directory called scons-2.1.0, and enter this directory to install SCons: #cd scons-2.1.0 #python setup.py Install this will compile SCons, Install the scons script to the Python directory (/usr/local/bin or C:\Python25\Scripts) and install the SCons compilation engine to the library directory used by Python (/usr/local/lib/scons or C:\ python25\scons). Because these are system directories, you may need root or administrator privileges to install SCons.
3.1. Compile and install multiple versions of SConsSCons's setup.py scripts have some extensions that support the installation of multiple versions of SCons to different locations. This makes it easy to download and experience different versions of SCons. Install SCons to the location of the specified version and add the--version-lib option when calling setup.py: #python setup.py Install--version-lib This will install the SCons compile engine to/usr/lib/ scons-2.1.0 or C:\Python25\scons-2.1.0 directory.
3.2, install scons to the other positionYou can install scons to other locations instead of the default location, specify--prefix= options: #python setup.py Install--prefix=/opt/scons This will install SCons script to/opt/scons/bin, Install the build engine to/opt/scons/lib/scons. You can specify both--prefix and--version-lib, at which point setup.py will install the compilation engine to a specific version of the directory relative to the specified prefix, adding--version-lib to the example above, which will install the build engine to/opt/ scons/lib/scons-2.1.0.
3.3. Compile and install SCons without Administrator privilegesIf you do not have permission to install SCons to the system directory, use the--prefix option to install to another location of your choice. For example, install scons to the appropriate location relative to the user's $home directory, SCons script is installed to $home/bin, the compilation engine is installed to $home/lib/scons, use the following command: #python setup.py install--prefix = $HOME

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.