Commit Graph

4723 Commits

Author SHA1 Message Date
Vassil Vassilev
ad6a1b47cd Improve shutdown logic.
We should follow the shutdown procedure from FrontendAction::EndSourceFile
which ensures clang is properly torn down.

This patch allows us to write a module file without having to explicitly
call CompilerInstance::clearOutputFiles.
2019-12-23 19:14:14 +01:00
Pratyush Das
e5d9141fcd Remove GCC test in OS X
If using GCC in OS X, we cannot build using LLVM from Macports because that is built using libc++.
2019-12-23 06:44:30 +01:00
Pratyush Das
8a64fb67e5 Cleanup 2019-12-23 06:44:30 +01:00
Pratyush Das
ba5b08c837 Fix warning - is keyword only applies to literals 2019-12-23 06:44:30 +01:00
Pratyush Das
334ac32e25 platform.linux_distribution is deprecated 2019-12-23 06:44:30 +01:00
Pratyush Das
4b928845e3 Refactor code in last_stable and current_dev 2019-12-23 06:44:30 +01:00
Pratyush Das
eec9a3559f Remove legacy code to build libcpp 2019-12-23 06:44:29 +01:00
Pratyush Das
0af62c625d Fix global namespace error on variable tar_required 2019-12-23 06:44:29 +01:00
Pratyush Das
20254e5926 Enable flag with-llvm-tar for OS X 2019-12-23 06:44:29 +01:00
Pratyush Das
ad0126f994 Fix lit.cfg for building from LLVM binary in OS X 2019-12-23 06:44:29 +01:00
Pratyush Das
e9f0bc3458 Build cling using LLVM packaged binary for OS X 2019-12-23 06:44:28 +01:00
Pratyush Das
f2ea3180f3 Force travis to use LLVM binary release tar 2019-12-23 06:44:28 +01:00
Pratyush Das
a876834199 Disable Clang SA and ARCMT to speed up the build. 2019-12-23 06:44:28 +01:00
Pratyush Das
eb5d0d5db2 Increase travis timeout to 50 minutes 2019-12-23 06:44:28 +01:00
Pratyush Das
15678df401 Disable ccache 2019-12-23 06:44:28 +01:00
Pratyush Das
5bfb2b834d Cleanup 2019-12-23 06:44:28 +01:00
Pratyush Das
bc70947c9a Fix broken vanilla-cling tests.
Change condition of adding vanilla-cling, change directory locations for
downloaded binary release.
2019-12-23 06:44:28 +01:00
Pratyush Das
8c433c0367 Remove GCC4.8 test instance from travis.
We do not need to officially support GCC4.8 or GCC4.9 anymore.
2019-12-23 06:44:28 +01:00
Pratyush Das
28c58fdf34 Add support to build Cling using LLVM from Distro's package manager. 2019-12-23 06:44:28 +01:00
Pratyush Das
5ebd9587dd Comply with new NVPTX update of Cling 2019-12-23 06:44:28 +01:00
Pratyush Das
21d3cd2d7c Enabled support to build Cling using downloaded LLVM release tar. 2019-12-23 06:44:27 +01:00
Pratyush Das
2796d6bf96 Proof of concept - Cling can be built using downloaded LLVM release tar. 2019-12-23 06:44:27 +01:00
Pratyush Das
ecd8c35c1f Add a gitignore 2019-12-23 06:44:27 +01:00
Pratyush Das
495a667988 Removed redundant line 2019-12-23 06:44:27 +01:00
Axel Naumann
687c653589 Expose ROOTLIBDIR to cling::DynamicLibraryManager: (#4710)
DynamicLibraryManager only looks at LD_LIBRARY_PATH and friends, but for install / prefix
builds that might not point to the ROOT library dir. Make it explicit that the
DynamicLibraryManager is supposed to look at the directory containing ROOT libraries.
Fixes install-with-prefix builds with RPATH, that now do not need a fake LD_LIBRARY_PATH
anymore.
2019-12-21 11:59:23 +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
Vassil Vassilev
595580b181 Revert "[travis] Adjust the timeout to the new travis timeouts at 50m."
This reverts commit 1e6cf7e294dbc5450d17600e91d42dd22a4a63cb.

Travis counts the packet install time which depends on network. Let's play
safe for now until more detailed tests are conducted.
2019-12-01 14:14:06 +01:00
Vassil Vassilev
537f7ad5cf Adjust the timeout to the new travis timeouts at 50m. 2019-12-01 11:29:38 +01:00
Vassil Vassilev
299fbcc268 Resolve modulemaps after the HeaderSearch is initialized.
This patch allows us to resolve system-specific header search directories
such as the location of libc.

This patch fixes experimental runtime_cxxmodules on OSX where libc is in
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/
2019-11-29 17:29:25 +01:00
Axel Naumann
140b66e2c1 Separate memory regions for recursive jitting (ROOT-10426) 2019-11-29 09:00:21 +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
Simeon Ehrig
ad8d5e1137 Changes for Pull Request #284
- add Author to CUDA test cases
- optimize DeviceKernelInliner
- improve some comments
- remove deprecated opt level variables
- change interface of IncrementalCUDADeviceCompiler::process() IncrementalCUDADeviceCompiler::declare()
2019-11-07 19:29:15 +01:00
Simeon Ehrig
65b9ee7a8c Add functionality to SourceNormalization to detect cuda kernels
- a really weak solution, which should replaced by a generic solution
2019-11-07 19:29:15 +01:00
Simeon Ehrig
f63b935c68 Refactor public interface of cling::IncrementalCUDADeviceCompiler
- it is more similar to the interface of cling::Interpreter
- replace function compileDeviceCode() with process()
- add declare() and parse() functions
- the functions have only the argument input, because the rest of the missing arguments (e.g. Transaction) requires modifications at the transaction system
- it also fixes a bug in the I/O system of the xeus-cling kernel
2019-11-07 19:29:15 +01:00
Simeon Ehrig
6443f5fb06 Add -include argument to cling ptx 2019-11-07 19:29:15 +01:00
Simeon Ehrig
43d5583905 Add NVPTX backend to CPT 2019-11-07 19:29:15 +01:00
Simeon Ehrig
cc28579124 Add in-memory fatbin generation
- instead of using the NVIDIA tool fatbin, the fatbin is now generated directly in the cling
- clean up the IncrementalCUDADeviceCompiler class depending on the new fatbin implementation (e.g. remove findToolChain())
- last I/O-operation is required -> write the fatbin code to a file for the CodeGen
2019-11-07 19:29:15 +01:00
Simeon Ehrig
64fe3f7d6d Setting a new include path at runtime in the PTX compiler now works 2019-11-07 19:29:15 +01:00
Simeon Ehrig
0d9d8be5b9 Support for the define argument (-D) in the CUDA mode 2019-11-07 19:29:15 +01:00
Simeon Ehrig
2489cf13b1 Replaced incremental PTX compiler with a internal implementation
Replaced the old version of the PTX compiler which used external tools and llvm::ExecuteAndWait with an internal implementation. The new incremental PTX compiler uses a modified version of the cling::Interpreter instance. The instance can process the PTX built-ins and generates LLVM IR. The LLVM IR is be compiled to PTX via an additional NVPTX backend implemented in the IncrementalCUDADeviceCompiler.

The new implementation has many advantages:
- it's much faster than the old version
- less error-prone because the ASTPrinter and some unnecessary cling transformations are avoided
- reduction of problems in searching for external tools (can be very complicated on HPC systems)

The IncrementalCUDADeviceCompiler is moved from the cling::IncrementalParser to the cling::Interpreter, because the second interpreter needs the input without wrappers or transformations.
2019-11-07 19:29:15 +01:00
Simeon Ehrig
96366346c0 Added DeviceKernelInliner ASTTransformer
This ASTTransformer adds an inline attribute to any CUDA __device__ kernel
that does not have the attribute. Inlining solves a problem caused by
incremental compilation of PTX code. In a normal compiler, all definitions
of __global__ and __device__ kernels are in the same translation unit. In
the incremental compiler, each kernel has its own translation unit. In case
a __global__ kernel uses a __device__ function, this design caused an error.
Instead of generating the PTX code of the __device__ kernel in the same file
as the __global__ kernel, there is only an external declaration of the
__device__ function. However, normal PTX code does not support an external
declaration of functions.

The transformer only works if the target device is nvptx.
2019-11-07 19:29:15 +01:00
Simeon Ehrig
6c46b65754 Extend cling::Intpereter to incremental compile PTX code for CUDA devices
- change CUDA to CUDAHost and add CUDADevice to the InvocationOptions
- in the PTX mode, some ASTTransformer will not be used, which are useful for the x86 mode
2019-11-07 19:29:15 +01:00
Vassil Vassilev
b1c18ae3cf Print the vfs overlay file in the log in verbose mode. 2019-11-01 09:19:38 +01:00
Vassil Vassilev
14428ee875 Move curand_discrete and remove curand_poisson.
This should fix the cuda failures.
2019-10-29 20:29:06 +01:00
Vassil Vassilev
b2e854cb13 Add an initial version of a modulemap for cuda.
This should fix our TMVA cuda builds.
2019-10-29 12:29:39 +01:00
Vassil Vassilev
d4e822e8d9 Sink {libc,std}.modulemap in cling.
This patch teaches cling to detect if the essential libraries have modulemaps
and if necessary it adds an overlay around libc and std.

This tightens the implementation and makes cling standalone easier to run in
-fmodules mode.
2019-10-22 14:14:49 +02:00
Vassil Vassilev
02f7ae2a91 Collect the modulemaps even if no overlay is set.
This patch tightens the implementation of the collection of modulemap files.
It still gathers all 'system' modulemaps necessary for cling to run if
-fno-implicit-module-maps is specified.

This patch should unbreak our osx builds.
2019-10-21 15:44:51 +02:00
Vassil Vassilev
313734145e Iterate only once. Use early exits. 2019-10-21 15:44:51 +02:00
Vassil Vassilev
7e544b502a Remove negation from parameter name, add default value. NFC. 2019-10-21 15:44:49 +02:00
Vassil Vassilev
024cf290d4 Teach cling about explicit modulemaps; Move TROOT::Get*Dir to FoundationUtils.
If we use -fimplicit-module-maps this means that cling will find all files called
module.modulemap on the include paths. In certain cases the same modulemap can
be present in two locations causing module redefinition errors.

This patch teaches cling to work with explicitly specified modulemaps in
-fno-implicit-module-maps mode. It moves the generation of the overlay file
closer to the CIFactory so that we can reuse the modulemap loading code before
the interpreter object was set up.

The patch also turns off the implicit module map discovery and explicitly
specifies the ROOT-related modulemap files. The modulemap files need to be
enumerated in both TCling and rootcling. Rootcling requires -fno-rtti build mode
and we cannot use the utilities in TROOT (also because rootcling_stage1 is
built before libCore). This requires the extraction of the `GetSysRoot`,
`GetIncludeDir` and `GetEtcDir` in the `ROOT::FoundationUtils` which is can be
used throughout the entire core component.

This fixes ROOT-10354.
2019-10-17 18:59:48 +02:00