Package Details: cling 0.6-1

Git Clone URL: https://aur.archlinux.org/cling.git (read-only)
Package Base: cling
Description: Interactive C++ interpreter, built on the top of LLVM and Clang libraries
Upstream URL: https://root.cern.ch/cling
Licenses: custom:Cling Release License
Conflicts: cling
Provides: cling
Submitter: archibald869
Maintainer: archibald869
Last Packager: archibald869
Votes: 3
Popularity: 1.969116
First Submitted: 2019-08-28 11:45
Last Updated: 2019-08-28 11:45

Dependencies (4)

Required by (0)

Sources (3)

Latest Comments

racko commented on 2019-10-19 18:55

Using this package to build https://github.com/QuantStack/xeus-cling I found that /opt/cling/lib/cmake/llvm/ is missing. Checking the PKGBUILD I realized that this is caused by only installing tools/clang and tools/cling. I fixed this with the following patch (while I was at it I also removed the unnecessary -j arguments. Users should set these in MAKEFLAGS in /etc/makepkg.conf):

diff --git a/PKGBUILD b/PKGBUILD
index [`6503cc5`](https://aur.archlinux.org/cgit/aur.git/commit/?h=cling&id=6503cc5)..[`84869d1`](https://aur.archlinux.org/cgit/aur.git/commit/?h=cling&id=84869d1) 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -51,18 +51,18 @@ build() {
         -DLLVM_BUILD_DOCS=OFF \
         -DLLVM_ENABLE_SPHINX=OFF \
         -DLLVM_ENABLE_DOXYGEN=OFF \
+        -DLLVM_BUILD_TOOLS=OFF \
         -DFFI_INCLUDE_DIR=$(pkg-config --cflags-only-I libffi | cut -c3-) \
         "$srcdir/llvm"

-    make -C tools/clang -j$_num_cores
-    make -C tools/cling -j$_num_cores
+    make -C tools/clang
+    make -C tools/cling
 }

 package() {
     cd "$srcdir/build"

-    make -C tools/clang -j$_num_cores DESTDIR="$pkgdir" install
-    make -C tools/cling -j$_num_cores DESTDIR="$pkgdir" install
+    make DESTDIR="$pkgdir" install

     install -d "$pkgdir/usr/bin"
     ln -s "/opt/cling/bin/cling" "$pkgdir/usr/bin/cling"

As for why I had to add -DLLVM_BUILD_TOOLS=OFF: See https://github.com/root-project/cling/commit/2c92b57062e22c14c015c7bd3f9c7d9d3197defa

Also I found that installing to /opt/cling breaks the cmake configs: The cling authors unfortunately neglected to add target_include_directories, so the cmake configs assume that the headers are installed to /usr/include and found by the compiler without providing additional include paths. So installing to /opt/cling violates that assumption. But for now I worked around that by adding

include_directories(/opt/cling/include)

to the xeus-cling toplevel CMakeLists.txt.