How to install clang compiler ?
-
wrote on 4 Jun 2013, 01:12 last edited by
Hi
I like to install clang compiler but i haven't any idea about steps which i want to do that ,please any one have better idea about that please describe.
Thanks
-
What OS are we talking about here? On Mac, it's enough to install Xcode. On most linuxes, clang is included in the repository. On Windows, it gets tricky, but there are ways to compile the beast with MSVC11.
For example, on Kubuntu:
@
sudo apt-get install clang
@
should do the trick. -
wrote on 4 Jun 2013, 16:57 last edited by
Thanks for your reply i like to know How clang install in Windows version
-
Never done that, but it definitely is possible. Visit "llvm.org":http://llvm.org/ for more info.
-
wrote on 26 Aug 2013, 12:20 last edited by
@Dlluka
hai,,
I am stuck completely why llvm and why clang. And How to use it -
wrote on 26 Aug 2013, 17:08 last edited by
Hi
clang is a objective C compiler for the Qt If you like to use Objective C for your Qt project its better compiler .
Thanks
Diluka -
Woah, not really. clang works with ISO C, ISO C++, Objective C and Objective C++. So there is bit more to this than just obj. C ;)
vishu clang is a drop-in replacement for GCC/ g++. There is a huge amount of advantages that it brings:
- better code optimisation
- better introspection (debugging)
- smaller binaries
- it compiles faster than GCC (not to mention MSVC). In my case, Qt5 compiles in about 23 minutes with GCC, and in about 15 minutes using clang
- much better error and warning detection and phrasing: clang tells you exactly where the error is, why it's an error and very often recommends a fix
- plus a myriad of other avanced features
-
wrote on 27 Aug 2013, 05:02 last edited by
Thanks slerdzlo ,
I have Qt 5.0.2 and Windows 7 32 bit,
Qt 5.0.2 have gcc 4.7, Still do we need to use it , if yes I am not getting how to create tool chain for it. Please suggest any idea....Thanks
-
OK Windows is a different thing. There I would recommend MSVC compiler.
You can compile clang on Windows, but it's not easy. Consult the llvm web page I've linked to earlier.
-
wrote on 27 Aug 2013, 05:29 last edited by
Okay Today i will try out with windows itself if I don't get anything by the evening i ll install Linux and contact you.
Thanku
-
wrote on 28 Aug 2013, 11:48 last edited by
Hi slerdzlo,
It became Headache to me, i am switching to linux.
But i have one important question to you, We have one application which is developed in Qt 4.7 and we have cross compiled it and its running on ARM, Question is by using clang+llvm does it reduce memory size and increases the performance of the application????Thanks
-
In many cases, the answer is yes, but you need to check yourself. It's not a magic do-it-all for you tool. If your code is badly written, it won't make it ultra fast all of a sudden.
-
wrote on 28 Aug 2013, 15:51 last edited by
Hi sierdzio
Good introduction thanks for your information i also new to clang but feel it very powerful rather than GCC. :)
-
wrote on 30 Aug 2013, 04:55 last edited by
Hii slerdzlo,
Its very easy to install clang+llvm if we have linux like system and if we follow http://clang.llvm.org/get_started.html this Thanks for your guidence,
i got clang 3.4 and executed my qt(4.8.1) project and in GCC 4.6 tooComparison between GCC 4.6 , clang 3.4
- Debug Time 37 seconds , 1 min 15 sec
- Warnings 23 , 43
- size of binary file 5.1 MB , 4.5 MB
-
I'm happy it worked for you. Happy coding!
-
wrote on 30 Aug 2013, 06:55 last edited by
hi slerdzlo,
I have one more question, I think we can set the GCC optimization level manually, Can you give any idea to set ?
-
There are various optimisation settings available and many ways to turn them on. Most common settings are: -O2, -Od, -O3. They are well documented by both gcc and clang.
If you mean to ask how to set this up in a qmake project, then the answer is that you need to use QMAKE_CXX_FLAGSvariable. -
wrote on 30 Aug 2013, 07:15 last edited by
Thanks,
This is where we get still better knowledge,
http://doc.qt.digia.com/4.7/qmake-variable-reference.html#qmake-cxxThanks,
-
wrote on 3 Sept 2013, 12:18 last edited by
Hi slerdzlo,
I have one more task to do,
Our target is to run the Qt Project in Arm board, We can directly compile using arm tool chain but our target is i have to run the code which is compiled with clang + llvm on Arm board,
Any Idea Please.... -
If you clang installation supports that architecture, you can compile and it should work. If it's some special custom chip, it may be that GCC is your only option. But that is not a place I have much experience in, so I can't say for sure.