cling
cling copied to clipboard
Cannot compile cling on windows
tried with both msvc2019
and mingw-w64 8
but I cannot compile it.
- using msvc after about one or two minutes I got some errors I think with linking and ...
- using mingw it spent more than 3 hours!!! 87% was completed but an error occurred and ... Ahhhhh, that's not justice :/
using mingw I'm getting following error:
[ 87%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicLookup.cpp.obj
[ 87%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/DynamicExprInfo.cpp.obj
[ 87%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/Exception.cpp.obj
D:\ClingWin\src\tools\cling\lib\Interpreter\Exception.cpp: In function 'void* cling_runtime_internal_throwIfInvalidPointer(void*, void*, const void*)':
D:\ClingWin\src\tools\cling\lib\Interpreter\Exception.cpp:54:62: error: exception handling disabled, use -fexceptions to enable
cling::InvalidDerefException::DerefType::NULL_DEREF);
^
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-local-typedef'
cc1plus.exe: warning: unrecognized command line option '-Wno-covered-switch-default'
cc1plus.exe: warning: unrecognized command line option '-Wno-nested-anon-types'
mingw32-make.exe[2]: *** [tools\cling\lib\Interpreter\CMakeFiles\obj.clingInterpreter.dir\build.make:351: tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/Exception.cpp.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:59001: tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2
mingw32-make.exe: *** [Makefile:155: all] Error 2
any way... I think using wsl won't kill anyone...
MSVC should work, we build with it, too. What's the error? We don't build with mingw, I'm not surprised that it doesn't work.
That's about one month ago... I don't have the error messages anymore.
could you please tell me where can I download cling for windows? I think that would be better :)
We don't seem to offer windows binaries: https://root.cern/download/cling/ - let me find out why :-)
Quick comment, might be late for you guys.
I built cling under Win32, x86, didn't work. Then I tried x64 release build, it works like a miracle (VS2017). But the problem is that after I run cling, a simple #include statement can cause it to crash: #include
But if I run cling in the VS2017 command prompt, then everything seems to work fine. I guess some mislink to wrong dynamic libraries.
We don't seem to offer windows binaries: https://root.cern/download/cling/ - let me find out why :-)
so why?
Man, I wish cling worked on Windows.
Man, I wish cling worked on Windows.
It does
Could you explain how? I looked at cling's official repository, and there's no setup file for cling on windows.
You have to build it from source. See the Cling Build Instructions. On Windows, in a x64 Native Tools Command Prompt for VS 2022
:
git clone http://root.cern/git/llvm.git src
cd src
git checkout cling-patches
cd tools
git clone http://root.cern/git/cling.git
git clone http://root.cern/git/clang.git
cd clang
git checkout cling-patches
cd ../..
And then build:
mkdir build
cd build
cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX=[Install Path] ..\src
cmake --build . --config Release
cmake --build . --target install
Listen,
Most people don't want to download Microsoft's clunky Visual Studio just in order to build a compiler. Can you please release some binaries so people can just install this easily?
You can even setup a GitHub Action to automatically build the binaries from this repository. https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
You have binaries here that include Cling (and other stuff): https://root.cern/install/all_releases/ It's an up-to-date workaround at the moment if you need it.
The standalone Cling binaries and CI is broken at the moment: see https://github.com/root-project/cling/issues/447 https://github.com/root-project/web/issues/951
I am low on storage space. I'd really prefer not installing other stuff. I just want cling.
If the CI for building Cling binaries for Windows is broken, are there any immediate plans to fix it? I know this is an open-source project, but some communication on this topic would be appreciated.
@Welding-Torch I'll check what can be done. BTW, is Cling working without Visual Studio installed on the system? I thought the headers were needed... But I'll check nevertheless
No that's the thing, I don't want to install Visual Studio on my system. Hence, I haven't tried Cling yet.
Well, AFAIK, Cling (the JIT) needs the header files, as any other compiler
Maybe related: https://www.reddit.com/r/cpp_questions/comments/txipit/using_clang_on_windows_without_visual_studio/
They claim to show how to use LLVM Clang on Windows with CMake. You'll still need the Windows SDK and MSVC support libraries installed, but you don't have to use MSVC.
I don't think the Windows SDK is enough, but I'll check. And BTW, the Windows SDK comes with Visual Studio, last time I checked it was not possible to install the Windows SDK alone
Hence, I haven't tried Cling yet.
Consider also trying https://clang.llvm.org/docs/ClangRepl.html
So you're saying that even if I build cling with Visual Studio IDE on a different PC and then transfer the binary to my PC, I won't be able to run it on my PC without Visual Studio IDE installed?
Well that's not ideal. Is it possible to run cling standalone?
Well, just try (I don't have any PC without Visual Studio installed...)