Commit Graph

77 Commits

Author SHA1 Message Date
Jonas Hahnfeld
51e15ea523 Prepare for monorepo layout 2023-01-16 14:59:08 +01:00
Vassil Vassilev
a804b3d9eb LLVM now requires C++14.
Patch by Lang Hames.
2022-12-09 08:44:18 +01:00
Bertrand Bellenot
6a7fc6bdc8 change compiler flags (#9083)
* [cling][windows] change compiler flags

 - Set the `-std:c++14` / `-std:c++17` flag depending on the version of Visual Studio (only if building outside ROOT)
 - Split the one line exports in three lines to fix a potential issue with Ninja on Windows (missing a white space between each `/EXPORT:` specifier)

* Add a forgotten `endif()`
2021-10-07 16:59:05 +02:00
Axel Naumann
07c6081059 Simplify visibility setting:
Rather than string-replacing visibility, use the CMake interface.
Do not set visibility in the ROOT case; ROOT can handle that
just fine itself.
ROOT actually does *not* need visibility=default, now that the
few symbols that are required for using cling (apart from clingtest)
are explicitly requested through attributes.
2021-05-25 16:29:06 +02:00
Vassil Vassilev
899b3337fc Install the modulemap files 2021-03-11 10:44:07 +01:00
Vassil Vassilev
1804436da1 Add the CLANG_INCLUDE_DIRS if we build as part of LLVM. 2021-02-26 20:59:05 +01:00
Axel Naumann
ffc267b9dd Import updated lit config:
Copy and adapt lit.cfg from clang.
Export the CMake variable cling needs.
Add missing, now needed call to lit.llvm.initialize.
Remove unused "loadable_module" feature.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
23dadd0812 Mark the include directories of clang and llvm as system. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
cad5c25c17 Implement -Dbuiltin_cling=Off
Cling needs to be built and installed as part of llvm/clang and
then we need to specify paths as we do for builtin_clang=Off.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
a65caf82d7 Better export cling's cmake targets 2021-02-25 20:44:18 +01:00
Axel Naumann
09a061dc5d Hide C and C++ symbols alike:
We had symbols exposed, which in turn meant symbols were resolved by the dynamic loader,
which in turn meant another libllvm.so could interfere with those of cling. By hiding these
symbols, all symbols are self-contained and not external symbols leak into libCling.
cling needs to resolve its own symbols, so unhide those.
2019-12-17 16:44:40 +01:00
Simeon Ehrig
9470e538f4 Adds a check to the CMakeLists.txt if the NVPTX backend is enabled 2019-11-07 19:29:15 +01:00
Axel Naumann
646ccb8b9c Enable warnings for cling, disable them for llvm. 2019-09-10 16:29:09 +02:00
Vassil Vassilev
1cb36481ba Add missing dependency. 2019-03-17 08:15:02 +01:00
Vassil Vassilev
6c74a386ba Enable ROOT to be built with prebuilt clang and llvm.
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/
2018-03-28 19:29:10 +02:00
Bertrand Bellenot
e26a6cb2df Several fixes for Windows
- cling: add missing symbol in the export list and fix semicolon issue in CMakeList.txt (it has to be in quotes)
 - cling-demo: export symbols and format hexadecimal output
2018-03-22 13:44:16 +01:00
Vassil Vassilev
911071a080 CLANG_INCLUDE_DIRS and LLVM_INCLUDE_DIRS can be lists of values.
The cmake lists are semicolon-separated strings which we fail to pass
to the colon-expecting interface.
2018-03-08 22:44:16 +01:00
Vassil Vassilev
3a5d26ebf0 Enable ROOT's builtin_llvm=Off
This patch allows ROOT to be built against compatible external llvm (5.0
or 5.0.1). Note that we still need to build clang (eg. we require
builtin_clang=On) due to the ROOT-specific patches which are not yet
upstream.

Since we have externally installed llvm, we configure and build clang as
a standalone project. The configuration relies on finding llvm-config-5.0
and uses an adapted version of the standard clang standalone build
procedure.

Clang provides dependencies such as FileCheck and not which are used by
cling's testsuite and are not being installed with the standard llvm
package.

Cling (which depends on llvm and clang) is built as a clang tool to avoid
unresolved dependencies to clang and complicating further the already
complicated cmake setup.

This patch intends a minimal change and follows the initial (suboptimal)
design to configure and build llvm, clang and cling as part of ROOT. An
ultimate solution would be to have llvm, clang and cling built as separate
standalone projects (following the recommended way by the LLVM cmake
developers).
2018-02-20 13:44:05 +01:00
Vassil Vassilev
75b9ee317f Fix typo. 2018-02-20 13:44:05 +01:00
Vassil Vassilev
0fa6cbe4f7 Use the standard cmake variables showing the include path. 2018-02-20 13:44:05 +01:00
Bertrand Bellenot
cf766f02ee Add comment for VS 2017 2017-08-29 15:21:36 +02:00
Bertrand Bellenot
5d4a7b51a7 Add support for Visual Studio 2017 2017-08-29 15:21:36 +02:00
Vassil Vassilev
b2a4fbbcf4 Configure cling from the outside. Reduces the ROOT-patches branch. 2017-06-08 10:29:13 +02:00
Frederich Munch
02d00992e0 CMake: Don’t add compiler flags as preprocessor definitions. 2017-03-09 08:29:28 +01:00
Axel Naumann
53bed3dce6 Export cling (for the JIT) and a few key functions from libCling; hide everything else. 2016-12-20 17:29:10 +01:00
Axel Naumann
a7bb139829 Whitespace. 2016-12-20 12:59:08 +01:00
Frederich Munch
f846990f8d Windows: Fix InterpreterException not being caught and terminating. 2016-12-20 12:59:08 +01:00
Frederich Munch
ce31cab80e CMake: Add clang-headers dependency. 2016-12-02 14:14:06 +01:00
Vassil Vassilev
e0c52bc29a Unbreak the builds of cling standalone. 2016-10-16 11:39:16 +02:00
Pere Mato
466279d16d Fix for ROOT-8375 - Spurious CMake warning in configure/make configuration 2016-10-14 13:42:49 +02:00
Axel Naumann
83b879cd3a Fix detection of available compilation flags. 2016-09-29 11:33:53 +02:00
Vassil Vassilev
95f07ec272 Cling standalone cmake builds on Windows require cmake 3.6.2.
We need to export symbols from cling's executable which was not possible until
the accepted in cmake patch by Bertrand.
2016-09-17 12:38:03 +02:00
Roman Zulak
3a4063090e CMake: Move Windows setting cling_include_deflt under if (CLING_INCLUDE_TESTS). 2016-09-16 10:27:58 +02:00
Roman Zulak
a2ee62913b CMake: Fix cling_include_deflt now being set to itself. 2016-09-16 10:27:58 +02:00
Danilo Piparo
8f60f8dc30 Further polish list of include paths 2016-09-15 10:20:17 +02:00
Danilo Piparo
f33ef5e6f0 Polish include path inclusion. We do not need LLVM in ROOT. 2016-09-14 18:29:38 +02:00
Danilo Piparo
b1ce4dbc1f Do not inject in the cling include paths portions of the sources
unless we are in a regime where CLING_INCLUDE_TESTS is defined.
This requires to re-balance the dictionary construction adding the
paths for the runtime universe.
2016-09-14 18:29:38 +02:00
Axel Naumann
a1ee1c31cf ROOT does not need the cling-install -I path. 2016-09-12 18:20:05 +02:00
Axel Naumann
c2736a6cc2 Help cling binary find llvm headers when part of ROOT. 2016-09-12 13:29:13 +02:00
Frederich Munch
63ead8d92e Windows: Fix CMake generation of CLING_INCLUDE_PATHS. 2016-09-09 09:29:49 +02:00
Axel Naumann
27b505e2a2 Disable some more warnings from clang. 2016-09-05 11:14:08 +02:00
Frederich Munch
ea25014f1f Add -DCLING_INCLUDE_PATHS to CMake.
This allows a user to prepend to CLING_INCLUDE_PATHS any additional include paths
they want to add on startup.

Refactor common path splitting code into Utils/Paths

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Axel Naumann
b9539a473f Install cling Jupyter kernel. 2016-07-22 19:29:12 +02:00
Axel Naumann
a758044f79 Declare dependency on tablegen-ed files.
Much better than depending on the library targets.
2016-07-19 17:59:14 +02:00
Pere Mato
809a9ad727 Better fix for ROOT-8267 2016-07-13 17:44:14 +02:00
Pere Mato
547d42919d Fix for ROOT-8267 - ROOT 6 master fails to compile if clang present in system include paths, picks up system's clang includes! 2016-07-13 14:59:39 +02:00
Axel Naumann
ec74408174 Force CMake 3.4.3 like llvm. 2016-06-18 16:44:29 +02:00
Axel Naumann
7cc8e65c90 From Bertrand (slight mods by me): fix CMake for Windows. 2016-06-15 14:14:34 +02:00
Axel Naumann
110763c786 Refresh CMakeLists.txt from clang. 2016-06-15 14:14:32 +02:00
Bertrand Bellenot
2649f0d318 Fix cling compilation errors on Windows (with VS 2015) 2016-02-23 09:29:07 +01:00