root-project / cling

The cling C++ interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update build-from-source instruction

lackhole opened this issue · comments

Explain what you would like to see improved

Update Building from source section of README.
LLVM has been updated

Optional: share how it could be improved

To Reproduce

Copy and paste current README

First error

CMake Error at CMakeLists.txt:90 (message):
  

  No build type selected.  You need to pass -DCMAKE_BUILD_TYPE=<type> in
  order to configure LLVM.

  Available options are:

    * -DCMAKE_BUILD_TYPE=Release - For an optimized build with no assertions or debug info.
    * -DCMAKE_BUILD_TYPE=Debug - For an unoptimized build with assertions and debug info.
    * -DCMAKE_BUILD_TYPE=RelWithDebInfo - For an optimized build with no assertions but with debug info.
    * -DCMAKE_BUILD_TYPE=MinSizeRel - For a build optimized for size instead of speed.

  Learn more about these options in our documentation at
  https://llvm.org/docs/CMake.html#cmake-build-type

Second error

(After providing CMAKE_BUILD_TYPE)

CMake Error at CMakeLists.txt:898 (message):
  The target `nvpts' is experimental and must be passed via
  LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.

It is hard to resolve this error only with the diagnostic message since the real reason is that target is case-sensitive, not because nvptx is experimental.

Setup

Additional context

Should I open a PR?

Should I open a PR?

Thanks for reporting, yes please, at https://github.com/root-project/root

This is still not fixed, and it's a single line in the readme.

Feel free to transfer this PR (#518) or (#523) to the upstream repo: https://github.com/root-project/root/pulls

I cant build cling from source ; download the clingv1.0 release source code from github release ; download root project's llvm code in branch cling-latest ;
When I compile ,it told me

 Building CXX object tools/cling/lib/Interpreter/....clingInterpreter.dir/DynamicLibraryManagerSymbol.cpp.o
FAILED: tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicLibraryManagerSymbol.cpp.o
/usr/bin/clang++-14 -DCLING_VERSION=1.0 -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/hyj/code/cling-ninja/tools/cling/lib/Interpreter -I/home/hyj/code/cling-1.0/lib/Interpreter -I/home/hyj/code/cling-1.0/include -I/home/hyj/code/cling-ninja/tools/cling/include -isystem /home/hyj/code/cling-ninja/tools/clang/include -isystem /home/hyj/code/llvm-project/llvm/../clang/include -isystem /home/hyj/code/cling-ninja/include -isystem /home/hyj/code/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -Wno-covered-switch-default -Wno-unused-local-typedef -fno-rtti -O3 -DNDEBUG -std=c++17 -fvisibility=default -fvisibility-inlines-hidden  -fno-exceptions -fno-rtti -MD -MT tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicLibraryManagerSymbol.cpp.o -MF tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicLibraryManagerSymbol.cpp.o.d -o tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicLibraryManagerSymbol.cpp.o -c /home/hyj/code/cling-1.0/lib/Interpreter/DynamicLibraryManagerSymbol.cpp
/home/hyj/code/cling-1.0/lib/Interpreter/DynamicLibraryManagerSymbol.cpp:387:16: error: 'set_size' is a private member of 'llvm::SmallVectorImpl<char>'
        result.set_size(old_size);
               ^
/home/hyj/code/llvm-project/llvm/include/llvm/ADT/SmallVector.h:621:21: note: declared private here
  using SuperClass::set_size;

as you can see when i compile clingv1.0 , it fail;

I also try the cling source code which release as January ;and use llvm in branch cling-llvm16 with a commit which was release as January too.
But it fail ;

Try maybe with cling git master branch

Hobbyist who went down 🐇🕳️.
Along the way learned cling history; also learned clang-repl already present so tested that successfully. Still curious to build cling from source. Found steps here, exactly as indicated, which built (took a while) cling successfully, Debian 12. Minimal (basic c++, not cern features) testing successful.

#518

https://github.com/Arcnor/cling/tree/8c65f199f1b116b4d33186886b162b36a3968d97