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

Enable ROOT to be built with prebuilt clang and llvm. #1798

Merged
merged 1 commit into from Mar 28, 2018

Conversation

vgvassilev
Copy link
Member

@vgvassilev vgvassilev commented Mar 28, 2018

#To do so one needs to pass -Dbuiltin_llvm=Off -Dbuiltin_clang=Off and the
PATH should contain the path to llvm-config.

Note this is not enabling ROOT to work with vanilla clang!

This patch allows ROOT to be built against a prebuilt clang and llvm from
https://root.cern.ch/git/{llvm.git,clang.git}. It allows to reduce ROOT's
build times (in cases when cmake decides to rebuild the in-tree llvm for
no good reason). It moves the common denominator of different ROOT builds
in one place to save space. It also allows easy switch between LLVM in
debug and release mode.

To build the external clang and llvm exactly in the same way as the
in-tree builds use:

CMAKE_FLAGS="
-DLLVM_ENABLE_WARNINGS=OFF
-DLLVM_INCLUDE_TESTS=OFF
-DCLANG_INCLUDE_TESTS=OFF
-DLLVM_INCLUDE_EXAMPLES=OFF
-DCLANG_BUILD_TOOLS=OFF
-DCLANG_TOOL_ARCMT_TEST_BUILD=OFF
-DCLANG_TOOL_CLANG_CHECK_BUILD=OFF
-DCLANG_TOOL_CLANG_FORMAT_BUILD=OFF
-DCLANG_TOOL_CLANG_FORMAT_VS_BUILD=OFF
-DCLANG_TOOL_CLANG_FUZZER_BUILD=OFF
-DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF
-DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF
-DCLANG_TOOL_CLANG_RENAME_BUILD=OFF
-DCLANG_TOOL_C_ARCMT_TEST_BUILD=OFF
-DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF
-DCLANG_TOOL_DIAGTOOL_BUILD=OFF
-DCLANG_TOOL_LIBCLANG_BUILD=OFF
-DCLANG_TOOL_SCAN_BUILD_BUILD=OFF
-DCLANG_TOOL_SCAN_VIEW_BUILD=OFF
-DLLVM_BUILD_TOOLS=ON
-DLLVM_TOOL_LLVM_AR_BUILD=OFF
-DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF
-DLLVM_FORCE_USE_OLD_TOOLCHAIN=ON
-DCLANG_ENABLE_STATIC_ANALYZER=OFF
-DCLANG_ENABLE_ARCMT=OFF
-DCLANG_ENABLE_FORMAT=OFF
-DLLVM_TARGETS_TO_BUILD=host
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
-DLLVM_ENABLE_ABI_BREAKING_CHECKS=OFF
-DCMAKE_INSTALL_PREFIX=..
-DCMAKE_BUILD_TYPE=Debug"

cmake "$CMAKE_FLAGS" ../../../sources/root-llvm/

EDIT: We actially need -DLLVM_BUILD_TOOLS=OFF to be ON to build the llvm-config binary. Fixed in the description of this PR but not in the commit message.

@vgvassilev vgvassilev requested a review from amadio as a code owner March 28, 2018 15:27
@phsft-bot
Copy link
Collaborator

Starting build on centos7/gcc49, mac1013/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu16/native, ubuntu16/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on centos7/gcc49.
See console output.

Errors:

  • ninja: error: loading 'build.ninja': No such file or directory

@phsft-bot
Copy link
Collaborator

Build failed on slc6/gcc62.
See console output.

Errors:

  • ninja: error: loading 'build.ninja': No such file or directory

@phsft-bot
Copy link
Collaborator

Build failed on slc6/gcc49.
See console output.

Errors:

  • ninja: error: loading 'build.ninja': No such file or directory

@phsft-bot
Copy link
Collaborator

Build failed on ubuntu16/native.
See console output.

Errors:

  • ninja: error: loading 'build.ninja': No such file or directory

@phsft-bot
Copy link
Collaborator

Build failed on ubuntu16/native.
See console output.

Errors:

  • ninja: error: loading 'build.ninja': No such file or directory

To do so one needs to pass -Dbuiltin_llvm=Off -Dbuiltin_clang=Off and the
PATH should contain the path to llvm-config.

Note this is not enabling ROOT to work with vanilla clang!

This patch allows ROOT to be built against a prebuilt clang and llvm from
https://root.cern.ch/git/{llvm.git,clang.git}. It allows to reduce ROOT's
build times (in cases when cmake decides to rebuild the in-tree llvm for
no good reason). It moves the common denominator of different ROOT builds
in one place to save space. It also allows easy switch between LLVM in
debug and release mode.

To build the external clang and llvm exactly in the same way as the
in-tree builds use:

CMAKE_FLAGS="\
            -DLLVM_ENABLE_WARNINGS=OFF                   \
            -DLLVM_INCLUDE_TESTS=OFF                     \
            -DCLANG_INCLUDE_TESTS=OFF                    \
            -DLLVM_INCLUDE_EXAMPLES=OFF                  \
            -DCLANG_BUILD_TOOLS=OFF                      \
            -DCLANG_TOOL_ARCMT_TEST_BUILD=OFF            \
            -DCLANG_TOOL_CLANG_CHECK_BUILD=OFF           \
            -DCLANG_TOOL_CLANG_FORMAT_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_FORMAT_VS_BUILD=OFF       \
            -DCLANG_TOOL_CLANG_FUZZER_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF     \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DCLANG_TOOL_CLANG_RENAME_BUILD=OFF          \
            -DCLANG_TOOL_C_ARCMT_TEST_BUILD=OFF          \
            -DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF          \
            -DCLANG_TOOL_DIAGTOOL_BUILD=OFF              \
            -DCLANG_TOOL_LIBCLANG_BUILD=OFF              \
            -DCLANG_TOOL_SCAN_BUILD_BUILD=OFF            \
            -DCLANG_TOOL_SCAN_VIEW_BUILD=OFF             \
            -DLLVM_BUILD_TOOLS=OFF                       \
            -DLLVM_TOOL_LLVM_AR_BUILD=OFF                \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DLLVM_FORCE_USE_OLD_TOOLCHAIN=ON            \
            -DCLANG_ENABLE_STATIC_ANALYZER=OFF           \
            -DCLANG_ENABLE_ARCMT=OFF                     \
            -DCLANG_ENABLE_FORMAT=OFF                    \
            -DLLVM_TARGETS_TO_BUILD=host                 \
            -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF         \
            -DLLVM_ENABLE_ABI_BREAKING_CHECKS=OFF        \
            -DCMAKE_INSTALL_PREFIX=..                    \
            -DCMAKE_BUILD_TYPE=Debug"

cmake "$CMAKE_FLAGS"   ../../../sources/root-llvm/
@phsft-bot
Copy link
Collaborator

Starting build on centos7/gcc49, mac1013/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu16/native, ubuntu16/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@vgvassilev vgvassilev merged commit 4dd1729 into root-project:master Mar 28, 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

Successfully merging this pull request may close these issues.

None yet

2 participants