User forums > Using Code::Blocks
To use Clang-cl.exe with Codeblocks on Windows 10 needs a new compiler type
pabristow:
Sorry, message was in a box that you can't just copy'n'paste, so I mistyped it :-(
the message was from Line 268 in function cppExceptions
ShowWarning(_T("This wizard doesn't know how to setup exception flags for this compiler.\n"));
I am using mingw-w64
"C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0"
So does this need uncommenting this line for clang to get it to add -fexceptions ? ( will check that this is needed)
// || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("clang"))
or have I messed up something else?
Probably - as adding -fexceptions to the build options still does not produce an .exe :(
I'll try deleting my appdata stuff (after saving some files) and report back.
Thanks for help so far.
Paul
PS I was suggesting that supporting the most recent compiler version would be most useful, at least on nightly builds.
oBFusCATed:
--- Quote from: pabristow on October 20, 2019, 03:51:39 pm ---So does this need uncommenting this line for clang to get it to add -fexceptions ? ( will check that this is needed)
// || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("clang"))
or have I messed up something else?
--- End quote ---
The latest version of this file has this line uncommented, so it seems exceptions for clang are supported.
--- Quote from: pabristow on October 20, 2019, 03:51:39 pm ---Probably - as adding -fexceptions to the build options still does not produce an .exe :(
--- End quote ---
Does it work on the command line?
Can you post a full rebuild log?
Have you read our FAQ at http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors) ?
BTW: The wizard just creates the project file with initial settings. You can later add or remove most of the compiler and linker flags.
pabristow:
I shot my myself in the foot by adding --version to try to record the linker version (useful when you are trying to confirm that all the available linkers (clang++, clang-cl, ld, lld and gold all work as expected) :-[
I forgot, if I ever knew, that the undocumented side effect of adding --version is to ignore all other commands!
So I am pleased to confirm that Clang version 8.1.0 and 9.0.0 works nicely for the latest draft C++ standard, building a sample of Boost.Math and Boost.Multiprecision.
using the default clang++.exe dynamic linker uses the MSVC linker., but i have also used the new LLD linker.
I have the compiler unzipped to Compiler executable directory : C:\LLVM\clang-900\LLVM
and copied an existing antique Clang version renaming it to clang900 with these new executables:
C compiler clang.exe
C++ compiler clang++.exe
Linker for dynamic links clang++.exe
Linker for static libs : lld-link.exe
Compiler options- "std=c++2a" for latest C++ standard
-------------- Build: Debug_clang900 in numeric_limits_snips (compiler: LLVM Clang 900 Compiler)---------------
clang++.exe -Wall -fexceptions -g -std=c++2a --verbose -I..\..\..\boost -c I:\boost\libs\multiprecision\example\numeric_limits_snips.cpp -o obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o
clang++.exe -o bin\Debug\numeric_limits_snips.exe obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o -v
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.24.28207 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name numeric_limits_snips.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -v -coverage-notes-file "I:\\Cpp\\hello_boost\\numeric_limits_snips\\obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.gcno" -resource-dir "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0" -I "..\\..\\..\\boost" -internal-isystem "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -Wall -std=c++2a -fdeprecated-macro -fdebug-compilation-dir "I:\\Cpp\\hello_boost\\numeric_limits_snips" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.24.28207 -fdelayed-template-parsing -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o" -x c++ "I:\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.cpp"
clang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
..\..\..\boost
C:\LLVM\clang-900\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28207\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\bin\\Hostx64\\x64\\link.exe" "-out:bin\\Debug\\numeric_limits_snips.exe" -defaultlib:libcmt "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\ucrt\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\um\\x64" -nologo "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o"
(optionally to use the new lld linker, one can use the lld.linker by adding linker option
Other linker options "-fuse-ld=lld"
and the compiler option -flto=thin to ensure the .o file is of the right type.
(but NOT if using default MS linker or get fatal error LNK1136: invalid or corrupt file)
)
-------------- Build: Debug_clang900 in numeric_limits_snips (compiler: LLVM Clang 900 Compiler)---------------
clang++.exe -Wall -fexceptions -g -std=c++2a --verbose -flto=thin -I..\..\..\boost -c I:\boost\libs\multiprecision\example\numeric_limits_snips.cpp -o obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o
clang++.exe -o bin\Debug\numeric_limits_snips.exe obj\Debug\boost\libs\multiprecision\example\numeric_limits_snips.o -v -fuse-ld=lld
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.24.28207 -emit-llvm-bc -flto=thin -flto-unit -disable-free -disable-llvm-verifier -discard-value-names -main-file-name numeric_limits_snips.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -v -coverage-notes-file "I:\\Cpp\\hello_boost\\numeric_limits_snips\\obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.gcno" -resource-dir "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0" -I "..\\..\\..\\boost" -internal-isystem "C:\\LLVM\\clang-900\\LLVM\\lib\\clang\\9.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" -Wall -std=c++2a -fdeprecated-macro -fdebug-compilation-dir "I:\\Cpp\\hello_boost\\numeric_limits_snips" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.24.28207 -fdelayed-template-parsing -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o" -x c++ "I:\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.cpp"
clang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
..\..\..\boost
C:\LLVM\clang-900\LLVM\lib\clang\9.0.0\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28207\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt
End of search list.
lang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\clang-900\LLVM\bin
"C:\\LLVM\\clang-900\\LLVM\\bin\\lld-link" "-out:bin\\Debug\\numeric_limits_snips.exe" -defaultlib:libcmt "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.24.28207\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\ucrt\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\um\\x64" -nologo "obj\\Debug\\boost\\libs\\multiprecision\\example\\numeric_limits_snips.o"
in case these are helpful to others.
This latest version, with many bug fixes, and many new features available, including exciting constexpr compile-time computations, will be be over interest to many users and I'd like to see it in the next release.
(The only feature Clang lacks is the 128-bit floating-point option available as quadmath assembler-coded with gcc. This permits much faster 128-bit FP computation compared to the Boost.Multiprecision C++ software implementation. You can still get the same ~36 decimal digit precision :) )
Thanks for your helpful suggestions. Paul
oBFusCATed:
--- Quote from: pabristow on October 21, 2019, 01:29:55 pm ---This latest version, with many bug fixes, and many new features available, including exciting constexpr compile-time computations, will be be over interest to many users and I'd like to see it in the next release.
--- End quote ---
Offtopic: Haha, I don't understand why people find constexpr, consteval, constwhatever to be exciting. It is pathetic. (pathetic in this case is really mild word) :)
Ontopic: What do you really want integrated in C::B? Can you clarify? Most compilers are defined using xml files. I think even the auto-detection is done with xml files.
p.s. Please use code or quote tags (the # or the text-bubble buttons in the UI for posting on the forum). It will make your posts a lot more readable.
pabristow:
--- Quote ---Offtopic: Haha, I don't understand why people find constexpr, consteval, constwhatever to be exciting. It is pathetic. (pathetic in this case is really mild word) :)
--- End quote ---
Well I am proud to be pathetically excited with constexpr, consteval and everything const :)
And moreover, I can confirm that GCC 9.2 kindly provided by Brecht Sanders at winlibs.com standalone build of GCC and mingw-w64 for Windows works very nicely with Codeblocks 17 on Windows 10 and this version of GCC provides some exciting (to those constexpressionable) new features for compile-time computation.
Navigation
[0] Message Index
[*] Previous page
Go to full version