ekanar-eklectic / clang-builder Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bobsteagall/clang-builder
A collection of scripts for building Clang on Linux
License: University of Illinois/NCSA Open Source License
This project forked from bobsteagall/clang-builder
A collection of scripts for building Clang on Linux
License: University of Illinois/NCSA Open Source License
================================================================================ 2020-03-26 Bob Steagall KEWB Computing ================================================================================ This is the README file for the KEWB Clang 10.0.X build scripts. In the following text, the version numbers will be referred to as 10.0.X or 100X, depending on the usage and context. In order to run these scripts, the following prerequisites must be installed: a. lsb_release on Linux b. the typical GNU build tools c. CMake 3.4.3 or higher d. Python 2.7 or higher -------------------------------------------- 1. SCRIPTS THAT PROVIDE CUSTOM BUILD OPTIONS * clang-build-vars.sh - This very important script sets critical environment variables that are used by all the other scripts. The first few variables can be modified; if you think you want to modify some of these variables, follow the directions in the script file. ---------------------------------------------------- 2. TOP-LEVEL SCRIPTS THAT PERFORM HIGH-LEVEL ACTIONS * build-clang.sh - This script will perform an entire build of Clang. It builds the compiler first, and then the LibC++ library. The compiler and library are each built by running fetch-clang.sh, unpack-clang.sh, configure-clang.sh, and make-clang.sh, in that order. * stage-clang.sh - This script installs Clang into a staging location specified by the build variables script (clang-build-vars.sh). This is normally in the ./dist subdirectory, which serves as the staging area for creating a TGZ (compressed tarball) file and/or an RPM file. * pack-clang.sh - This script creates a compressed tarball of compiler files installed into the staging directory by the stage-clang.sh script. The resulting TGZ file will be in the ./packages subdirectory. * make-clang-rpm.sh - This script creates an RPM of the compiler files installed into the staging directory by the stage-clang.sh script. The resulting RPM file will be in the ./packages subdirectory. ----------------------------------------------------- 3. SECOND-LEVEL SCRIPTS THAT PERFORM BASIC OPERATIONS This set of scripts performs several basic operations that are part of the build process. Each operation is a distinct step in that process. * fetch-clang.sh - This script downloads the required source tarballs from LLVM mirror sites. * unpack-clang.sh - This script unpacks the tarballs, places everything in the correct relative locations, and then performs any required patching. * configure-clang.sh - This script runs Clang's configure script from within the build subdirectory. It sets several key options for building Clang, including some that are specified by the environment variables set in clang-build-vars.sh. * make-clang.sh - This script makes Clang from within the build subdirectory. By default, tt runs with -j8 (i.e., up to 8 parallel processes); you can change this value by modifying the CLANG_BUILD_THREADS_ARG variable defined in the clang-build-vars.sh script described above. * clean-clang.sh - This script deletes the source, build, install staging, and package output directories. ---------------------------------------------- 4. HOW TO BUILD CLANG 10.0.X WITH THESE SCRIPTS The process is pretty simple: a. Clone the git repo and checkout the clang100 branch. $ cd <build_dir> $ git clone [email protected]/BobSteagall/clang-builder.git $ cd <build_dir>/clang-builder $ git checkout clang100 b. Customize the variables exported by clang-build-vars.sh. In particular, you will need to customize the first variable at the top of that file, CLANG_VERSION, to select the version of Clang 10.0.X to download and build. $ vi ./clang-build-vars.sh c. Run the build-clang.sh script. $ ./build-clang.sh | tee build.log This command will build Clang and run the various unit tests that come with the distribution. To build without running the tests, you can use: $ ./build-clang.sh -T | tee build.log d. If the build succeeds, and you are satisfied with the test results, run the stage-clang.sh script to create the installation staging area. $ ./stage-clang.sh e. If you want to create a tarball for subsequent installations: $ ./pack-clang.sh The resulting tarball will be in the ./packages subdirectory. To install the tarball: $ cd / $ sudo tar -zxvf <build_dir>/clang-builder/packages/kewb-clang100X*.tgz or, alternatively: $ sudo tar -zxvf ./clang-builder/packages/kewb-clang100X*.tgz -C / If you are satisfied that everything is working correctly, then at some point you'll want to set ownership of the un-tarred files to root: $ cd /usr/local $ sudo chown -R root:root clang/10.0.X/ $ sudo chown root:root bin/*clang100X* f. If you want to create an RPM for subsequent installations: $ ./make-clang-rpm.sh -v The resulting RPM will be in the ./packages subdirectory. Install it using RPM or YUM on the command line. g. That's it! ----------------------------------------------- 5. HOW TO USE THE KEWB CUSTOM CLANG 10.0.X BUILD Before using the compiler, some paths need to be set. The simplest way to do this is source the "setenv-for-clang100X.sh" script that is installed. a. Source the script /usr/local/bin/setenv-for-clang-100X.sh, which was installed in step 4.e or 4.f above. For example, $ source /usr/local/bin/setenv-for-clang100X.sh -- OR -- a. You will need to modify your PATH environment variable so that the directory $CLANG_INSTALL_DIR/bin appears before the directory where your system default compiler is installed (which is usually in /usr/bin or /usr/local/bin). For example, $ export PATH=/usr/local/clang/10.0.X/bin:$PATH b. On Linux, you will also need to modify your LD_LIBRARY_PATH environment variable so that the $CLANG_INSTALL_PREFIX/lib, $GCC_INSTALL_PREFIX/lib, and $GCC_INSTALL_PREFIX/lib64 directories appear first in the path. For example, $ export LD_LIBRARY_PATH=/usr/local/clang/10.0.X/lib:\ /usr/local/gcc/9.3.0/lib:/usr/local/gcc/9.3.0/lib64:\ $LD_LIBRARY_PATH On FreeBSD, it suffices to prepend LD_LIBRARY_PATH with only the $CLANG_INSTALL_PREFIX/lib directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.