Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building bde_verify on vanilla Centos 6.6 #1

Open
abeels opened this issue Feb 5, 2015 · 2 comments
Open

Building bde_verify on vanilla Centos 6.6 #1

abeels opened this issue Feb 5, 2015 · 2 comments

Comments

@abeels
Copy link

abeels commented Feb 5, 2015

I used the following process to build and run bde_verify (commit 9536848) on a vanilla Centos 6.6 machine (equivalent to RHEL 6).

  • Problem: No pre-installed clang 3.6 (duh).

So, I download and build clang:

$ git clone http://llvm.org/git/llvm.git
$ cd llvm
$ git checkout release_36
$ cd tools
$ git clone http://llvm.org/git/clang.git 
$ cd clang
$ git checkout release_36
  • Problem: GCC toolchain (4.4.7) insufficient to build clang -> install devtoolset 1.1, which provides gcc 4.7.2

I followed the instructions in http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos, and put the toolchain in /opt/centos. Now we can pick up gcc-4.7.2 with:

$ export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/g++
$ export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc

Follow the configuration instructions in README.md to configure and build clang.

  • Problem: GCC toolchain (4.7.2) insufficient to build bde_verify -> use newly-built clang instead.
  • Problem: The bde_verify Makefile variable GCCDIR (which identifies the location of the standard library that will be used to build bde_verify) assumes that the library is installed side-by-side with $CXX. Not true for clang++, so change := to ?= on the lines that set GCCDIR, and provide an external value for the variable. (Future: rename the variable to STDLIBDIR?)
export GCCDIR=/opt/centos/devtoolset-1.1/root/usr
  • Problem: Documentation of bde_verify Makefiles is inaccurate. The variables you are told to set in the two Makefiles do not exist. Instead, set and export the following variables before running the make:
$ export CXX=/opt/llvm36/bin/clang++
$ export CC=/opt/llvm36/bin/clang
$ export LLVMDIR=/opt/llvm36
$ export PREFIX=/opt/bde_verify

...with the appropriate changes to the paths to fit your system.

  • Problem: The bde_verify script '#!' line is wrong for a standard system. Change to:
#!/usr/bin/env perl
  • Problem: The bde_verify script is a perl script that uses DateTime. Install perl-DateTime, if it is not already present on your system.
# yum install perl-DateTime
@kpfleming
Copy link

Thanks for accurately reporting all of these details!

@hyrosen
Copy link
Contributor

hyrosen commented Feb 25, 2015

  1. The bde_verify script now uses a #!/usr/bin/env perl shebang.
  2. The bde_verify script formats the logging date "by hand" and no longer needs DateTime.
  3. GCCDIR is now set via ?=. Additionally, if GCCDIR is not set and CXX is not .../g++, the Makefile will evaluate which g++ and set GCCDIR from that. If CXX is .../g++, GCCDIR will be set from CXX.
  4. If PREFIX is unset, it is taken as the first of /opt/bb or /usr which exists.
  5. If LLVMDIR is unset, it defaults to PREFIX.
  6. There should be no need to set CC.
  7. If CXX is .../clang++, it will be passed the option --gcc-toolchain=$(GCCDIR) (with GCCDIR as determined above) so that it can find the correct headers and libraries.
  8. There is no help for the system not having adequate compilers installed except installing them.

hyrosen added a commit that referenced this issue Aug 2, 2018
hyrosen added a commit that referenced this issue Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants