root-project / cling

The cling C++ interpreter
Other
3.53k stars 269 forks source link

Update build-from-source instruction #515

Closed lackhole closed 4 months ago

lackhole commented 9 months ago

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?

ferdymercury commented 7 months ago

Should I open a PR?

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

gabemorris12 commented 6 months ago

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

ferdymercury commented 6 months ago

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

sunflower-knight commented 5 months ago

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 ;

ferdymercury commented 5 months ago

Try maybe with cling git master branch

shel1kest0learn commented 5 months ago

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.

https://github.com/root-project/cling/pull/518

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