Package Details: cling 1.0-1

Git Clone URL: https://aur.archlinux.org/cling.git (read-only, click to copy)
Package Base: cling
Description: Interactive C++ interpreter, built on the top of LLVM and Clang libraries
Upstream URL: https://root.cern/cling/
Keywords: c c++ cling interpreter llvm
Licenses: custom:Cling Release License
Conflicts: cling
Provides: cling
Submitter: archibald869
Maintainer: archibald869
Last Packager: archibald869
Votes: 17
Popularity: 0.74
First Submitted: 2019-08-28 11:45 (UTC)
Last Updated: 2024-05-10 06:45 (UTC)

Dependencies (9)

Required by (1)

Sources (2)

Latest Comments

1 2 3 4 5 Next › Last »

Tyilo commented on 2024-05-17 11:11 (UTC)

The built cling binary doesn't seem to work for me:

ERROR in cling::CIFactory::createCI():
  resource directory /home/tyilo/.cache/paru/clone/cling/src/build/lib/clang/13.0.0 not found!

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ int a = 3;
[cling]$ a + 3
In file included from input_line_5:1:
In file included from /opt/cling/include/cling/Interpreter/RuntimePrintValue.h:19:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/memory:80:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/shared_ptr.h:52:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/iosfwd:42:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/postypes.h:40:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
         ^~~~~~~~~~
 #0 0x000062409aeab4cb (/usr/bin/cling+0x8d34cb)
 #1 0x000062409aea8ebb (/usr/bin/cling+0x8d0ebb)
 #2 0x00000cde7e165ae0 (/usr/lib/libc.so.6+0x3cae0)
 #3 0x000062409ce0959f clang::DeclContext::removeDecl(clang::Decl*) (/usr/bin/cling+0x283159f)
 #4 0x000062409ad286fc cling::DeclUnloader::VisitNamedDecl(clang::NamedDecl*) (/usr/bin/cling+0x7506fc)
 #5 0x000062409ad2bb1c cling::DeclUnloader::VisitNamespaceDecl(clang::NamespaceDecl*) (/usr/bin/cling+0x753b1c)
 #6 0x000062409ad2b74b cling::DeclUnloader::VisitDeclContext(clang::DeclContext*) (/usr/bin/cling+0x75374b)
 #7 0x000062409ad2b889 cling::DeclUnloader::VisitLinkageSpecDecl(clang::LinkageSpecDecl*) (/usr/bin/cling+0x753889)
 #8 0x000062409adbc8ae cling::TransactionUnloader::unloadDeclarations(cling::Transaction*, cling::DeclUnloader&) (/usr/bin/cling+0x7e48ae)
 #9 0x000062409adbcd2d cling::TransactionUnloader::RevertTransaction(cling::Transaction*) (/usr/bin/cling+0x7e4d2d)
#10 0x000062409ad90f69 cling::Interpreter::unload(cling::Transaction&) (/usr/bin/cling+0x7b8f69)
#11 0x000062409ad868ca cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*>>>&, bool) (/usr/bin/cling+0x7ae8ca)
#12 0x000062409ad89df3 cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) (/usr/bin/cling+0x7b1df3)
#13 0x000062409ad8d952 cling::Interpreter::declare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, cling::Transaction**) (/usr/bin/cling+0x7b5952)
#14 0x000062409adcf5da cling::valuePrinterInternal::printValueInternal[abi:cxx11](cling::Value const&) (/usr/bin/cling+0x7f75da)
#15 0x000062409adc698d cling::Value::print(llvm::raw_ostream&, bool) const (/usr/bin/cling+0x7ee98d)
#16 0x00000cde7e08704a 
#17 0x000062409ad71a07 cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (/usr/bin/cling+0x799a07)
#18 0x000062409ad8eeef cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (/usr/bin/cling+0x7b6eef)
#19 0x000062409ad8f6d6 cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (/usr/bin/cling+0x7b76d6)
#20 0x000062409ad8fa4e cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, cling::Value*, cling::Transaction**, bool) (/usr/bin/cling+0x7b7a4e)
#21 0x000062409ade23a1 cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (/usr/bin/cling+0x80a3a1)
#22 0x000062409aed1992 cling::UserInterface::runInteractively(bool) (/usr/bin/cling+0x8f9992)
#23 0x000062409abf67c9 main (/usr/bin/cling+0x61e7c9)
#24 0x00000cde7e14ec88 (/usr/lib/libc.so.6+0x25c88)
#25 0x00000cde7e14ed4c __libc_start_main (/usr/lib/libc.so.6+0x25d4c)
#26 0x000062409ac8ad55 _start (/usr/bin/cling+0x6b2d55)
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /usr/bin/cling
fish: Job 1, '/usr/bin/cling' terminated by signal SIGSEGV (Address boundary error)

carlosal1015 commented on 2024-05-11 14:47 (UTC)

Nice, thanks for the trick.

archibald869 commented on 2024-05-10 06:55 (UTC) (edited on 2024-05-10 06:56 (UTC) by archibald869)

@carlosal1015: Sorry for the late reply! I prefer to leave the default configuration as it is. If you want to allow redefinition of variables, functions etc., you can enter the following statement in the interactive shell: cling::runtime::gClingOpts->AllowRedefinition = 1;

archibald869 commented on 2024-05-10 06:49 (UTC) (edited on 2024-05-10 06:50 (UTC) by archibald869)

@kaelingre: Many thanks for your helpful preparatory work! I updated the PKGBUILD for v1.0. In the course of this, I also added !debug to the options.

kaelingre commented on 2024-05-06 10:25 (UTC)

It would be useful to disable the debug option by default (i.e. add !debug to the options). The debug package that is produced is huge, 6.4GiB+.

kaelingre commented on 2024-03-24 10:09 (UTC)

I created a PKGBUILD for v1.0. Note that I hard-coded a specific llvm version (cling-llvm13-20240318-01) to build against:

pkgname=cling
pkgver=1.0
pkgrel=1
pkgdesc="Interactive C++ interpreter, built on the top of LLVM and Clang libraries"
arch=("i686" "x86_64")
url="https://root.cern.ch/cling"
license=("custom:Cling Release License")
provides=("cling")
conflicts=("cling")
depends=("libxml2")
makedepends=("git" "cmake" "ninja" "python")
optdepends=(
    "perl: support for scan-build, ccc-analyzer and c++-analyzer"
    "python: support for scan-view and Jupyter"
    "python-pygments: support for opt-viewer"
    "python-yaml: support for opt-viewer"
)
source=(
    "cling-llvm-$pkgver.tar.gz::https://github.com/root-project/llvm-project/archive/refs/tags/cling-llvm13-20240318-01.tar.gz"
    "$pkgname-$pkgver.tar.gz::https://github.com/root-project/cling/archive/refs/tags/v$pkgver.tar.gz"
)
sha256sums=(
    "SKIP"
    "SKIP"
)

build() {
    mkdir -p "$srcdir/build"
    cd "$srcdir/build"
    cmake \
        -G Ninja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX="/opt/cling" \
        -DLLVM_TARGETS_TO_BUILD="host;NVPTX" \
        -DLLVM_BUILD_LLVM_DYLIB=OFF \
        -DLLVM_ENABLE_RTTI=ON \
        -DLLVM_ENABLE_FFI=ON \
        -DLLVM_BUILD_DOCS=OFF \
        -DLLVM_BUILD_TOOLS=OFF \
        -DLLVM_ENABLE_SPHINX=OFF \
        -DLLVM_ENABLE_DOXYGEN=OFF \
        -DLLVM_EXTERNAL_PROJECTS=cling \
        -DLLVM_EXTERNAL_CLING_SOURCE_DIR="$srcdir/cling-$pkgver/" \
        -DLLVM_ENABLE_PROJECTS="clang" \
        "$srcdir/llvm-project-cling-llvm13-20240318-01/llvm"

    ninja
}

package() {
    cd "$srcdir/build"

    DESTDIR="$pkgdir" ninja install

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

    install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE.TXT" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

    # include CMake target import file so that other packages are able to use
    # `find_package(Cling REQUIRED)`
    install -Dm644 "$srcdir/build/tools/cling/lib/cmake/cling/ClingTargets.cmake" \
        "$pkgdir/opt/cling/lib/cmake/cling"

    # adjust cling target locations
    sed -Ei 's#(IMPORTED_LOCATION_RELEASE) ".*/([^/]*)"#\1 "/opt/cling/lib/\2"#g' \
        "$pkgdir/opt/cling/lib/cmake/cling/ClingTargets.cmake"

    # omit man page for clang's scan-build
    rm -f "$pkgdir/opt/cling/share/man/man1/scan-build.1"

    # remove empty directories
    rmdir -p --ignore-fail-on-non-empty "$pkgdir/opt/cling/share/man/man1"
    rmdir -p --ignore-fail-on-non-empty "$pkgdir/opt/cling/include/cling/cint"
}

carlosal1015 commented on 2023-12-26 01:36 (UTC)

There are no tags v1.0 for llvm and clang. Compilation will give errors if bump version to 1.0.

studyinglover commented on 2023-10-12 10:09 (UTC)

meet a mistake

克隆到纯仓库 '/home/zjh/.cache/yay/cling/cling-llvm'...
remote: Enumerating objects: 2182000, done.
remote: Counting objects: 100% (2182000/2182000), done.
remote: Compressing objects: 100% (437621/437621), done.
错误:RPC 失败。curl 18 transfer closed with outstanding read data remaining
fetch-pack: unexpected disconnect while reading sideband packet
致命错误:过早的文件结束符(EOF)
致命错误:fetch-pack:无效的 index-pack 输出
==> 错误: 下载 cling-llvm git 仓库失败
    正在放弃...
 -> 下载源文件时出错: /home/zjh/.cache/yay/cling 
     context: exit status 1 


:: (1/1) 正在解析 SRCINFO: cling
==> 正在创建软件包:cling 0.9-5 (2023年10月12日 星期四 17时44分26秒)
==> 正在检查运行时依赖关系...
==> 正在检查编译时依赖关系
==> 获取源代码...
  -> 正在克隆 cling-llvm git 仓库...
克隆到纯仓库 '/home/zjh/.cache/yay/cling/cling-llvm'...
remote: Enumerating objects: 2182000, done.
remote: Counting objects: 100% (2182000/2182000), done.
remote: Compressing objects: 100% (437621/437621), done.
remote: Total 2182000 (delta 1777937), reused 2137347 (delta 1735682)
接收对象中: 100% (2182000/2182000), 814.02 MiB | 772.00 KiB/s, 完成.
处理 delta 中: 100% (1777937/1777937), 完成.
  -> 正在克隆 cling-clang git 仓库...
克隆到纯仓库 '/home/zjh/.cache/yay/cling/cling-clang'...
致命错误:无法访问 'http://root.cern/git/clang.git/':Empty reply from server
==> 错误: 下载 cling-clang git 仓库失败
    正在放弃...
 -> 生成时出错: cling-exit status 1
 -> 无法安装以下软件包, 需要手动介入处理:
cling - exit status 1

carlosal1015 commented on 2023-08-08 17:37 (UTC) (edited on 2023-08-21 15:33 (UTC) by carlosal1015)

Hi @archibald869, could you please add this patch enable-redefinition-allowed.patch, this feature comes from cling-0.7.0, to disable this behaviour. Many thanks, I will really appreciate it, especially for the xeus-cling package.

This patch works from my side.

archibald869 commented on 2023-07-19 09:48 (UTC)

Thanks for your hints! I updated the PKGBUILD accordingly.