8 ms·
LLVM and Clang 3.2 released
- ronnix 14y agoAre they?
- mitchty 14y agoYes. http://llvm.org/releases/download.html#3.2 http://llvm.org/releases/download.html#3.2
- dochtman 14y agoRead the actual, complete release notes here: LLVM, http://llvm.org/releases/3.2/docs/ReleaseNotes.html http://llvm.org/releases/3.2/docs/ReleaseNotes.html Clang: http://llvm.org/releases/3.2/docs/ClangReleaseNotes.html http://llvm.org/releases/3.2/docs/ClangReleaseNotes.html The project has recently moved to Sphinx, and the transition was only completed after branching for 3.2. It looks like the release notes have gotten out of sync and need to be merged, which is a little more work than usual. The link from the homepage points to docs that are always generated from trunk, so it only has old, incomplete notes.
- jonpaul 14y agoAdmittedly, I don't write much C/C++ anymore, but for a recent project, I need to use C. I decided to try clang instead of gcc. When clang showed me exactly what the source (via colors and indicators) of my compilation error I immediately knew that clang is the way forward.
- corresation 14y agoIt went largely unnoticed, but one of the biggest changes of the November Android NDK release was the addition of LLVM/clang to the toolchain. This was primarily added to reduce issues when cross-compiling iOS apps to Android.
- zbowling 14y agounfortunately it ships with older 3.1 version and not 3.2 so for porting it's not the greatest. You can use clang without google's changes just fine though (just have to get the PIC and pie flags right). A few bugs fixed with C++ on android in google's version but nothing major. Or better yet, you can wait until the Apportable SDK is publicly released so your objective-c apps can run on Android. :-)
- richdougherty 14y agoUse this link instead: http://llvm.org/releases/3.2/docs/ReleaseNotes.html http://llvm.org/releases/3.2/docs/ReleaseNotes.html The original link points to some draft version with lots of placeholder text throughout.
- jws 14y agoDoxygen users will be glad to know that Clang now can syntax check your Doxygen comments.
- jevinskie 14y ago-Wdocumentation, FYI
- mikevm 14y agoWhy would one prefer to use LLVM over GCC?
- msutherl 14y agohttp://clang.llvm.org/comparison.html http://clang.llvm.org/comparison.html
- jetti 14y agoAs somebody who is learning C++ and decided to go with clang, the error reporting is absolutely phenomenal. It tells me not only what line errors are on but also makes suggestions as to how to fix it. I don't ever recall GCC having very helpful error messages.
- pooriaazimi 14y agoAgree. Clang vs. GCC is like PostgreSQL vs. MySQL (regarding usefulness of error messages).
- belorn 14y agoHowever, in C language features GCC becomes PostgreSQL and Clang becomes MySQL (Things like nested functions to name one).
- eliben 14y agoIs that C language features or compiler-specific extensions? Arguably, sticking to the standard is actually the better alternative here in terms of portability.
- pooriaazimi 14y agoYou're right - it's a compiler extension to a language (apparently) called "GNU C"[1]: http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html Seems like a very nice feature though. [1]: First time I've heard this term. I'm not sure how I feel about it.
- ditoa 14y agoAnyone using LLVM/Clang on Windows? If so did you have to do anything special to get it to work? I have not really looked into it much myself as the last time I did Windows was basically a no go. Any advice would be great thanks!
- simfoo 14y agoIt would be a tremendous gain for the project if someone zipped up an all-in-one, ready to use package for Windows consisting of Clang and working standard libraries for C and C++. It doesnt (yet) need to be the new libc++ STL, a copy of the GCC libstdc++ libs would be enough.
- ditoa 14y agoIt appears someone has done some work on it. See http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/ http://sourceforge.net/projects/mingw-w64/files/Toolchains%2... I gave it a very quick look however got missing DLL messages (pthreadGC2) when trying to compile. I don't have the time to look into it today, hopefully over the Christmas break I will be able to get it working. If I do I will look at how sensible it is to maintain a similar Windows build. A standard Windows build available as an archive or an installer would be great. EDIT: The error messages look like they may be related to Cygwin although I could be totally wrong on that, it is just the readme mentions Cygwin but nothing else :)
- japaget 14y agoThe solution is to install a very specific build of MinGW. See http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056818.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056..., where the recommended MinGW installation is "mingw-get-inst-20120426.exe". Then you must remove any other C compilers from your path and include this MinGW and llvm. On my Windows 7 x64 system I have three versions of Visual Studio and 2 other installations of MinGW, so I was careful to remove them all from my path. I created a pathclang.bat containing the following set PATH=C:\Windows\system32;c:\MinGW32\bin;c:\llvm\bin set CPATH=C:\MinGW32\include and got clang 3.2 to work in 32-bit mode: pathclang.bat clang -m32 -o hello.exe hello.c hello.exe Alas, it appears that 64-bit mode is currently unsupported on Windows.
- msutherl 14y agoI love the community of languages that have adopted LLVM as a back-end: http://llvm.org/docs/ReleaseNotes.html#external-open-source-projects-using-llvm-3-2 http://llvm.org/docs/ReleaseNotes.html#external-open-source-... Pure, FAUST, Julia, Clay are all very promising and I didn't know about Open Shading Language or Portable OpenCL. [1] http://code.google.com/p/pure-lang/ http://code.google.com/p/pure-lang/ [2] http://faust.grame.fr/ http://faust.grame.fr/ [3] http://julialang.org/ http://julialang.org/ [4] http://claylabs.com/clay/ http://claylabs.com/clay/ [5] https://github.com/imageworks/OpenShadingLanguage/ https://github.com/imageworks/OpenShadingLanguage/ [6] http://pocl.sourceforge.net/ http://pocl.sourceforge.net/
- pohl 14y agoHaskell and Rust are also worthy of mention here.
- ch0wn 14y agoDoes GHC use the LLVM backend by default or do you have to manually enable that?
- ionfish 14y agoNo, the default backend is the native code generator. You need to use the -fllvm flag to enable the LLVM backend. http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/code-generators.html http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/code-... "[The LLVM backend] is an alternative backend that uses the LLVM compiler to produce executable code. It generally produces code as with performance as good as the native code generator but for some cases can produce much faster code. This is especially true for numeric, array heavy code using packages like vector. The penalty is a significant increase in compilation times."
- erichocean 14y agoYou missed my favorite LLVM-based project, ispc[1]. In a nutshell, it brings nVidia's SPMD programming model to normal SIMD-capable processors. Any CUDA code out there is almost trivial to convert. [1] http://ispc.github.com/ http://ispc.github.com/
- benbjohnson 14y agoAnother great LLVM tool that I don't see much press about is scan-build. It does static analysis and lets you navigate the results in your web browser. I believe Xcode builds this in but it's nice for anyone not using an IDE. http://clang-analyzer.llvm.org/scan-build.html http://clang-analyzer.llvm.org/scan-build.html
- Arjuna 14y agoFor those that follow game development, John Carmack had this to say at QuakeCon 2012: "But, one of my pushes on the greater use of static analysis and verification technologies, is I pretty strongly suspect that the Clang LLVM sort of ecosystem that's living on OS X is going to be, I hope, fertile ground for a whole lot of analysis tools and we'll wind up benefiting by moving more of our platform continuously onto OS X just for that ability to take advantage of additional tools there." [1] [1] https://www.youtube.com/watch?v=wt-iVFxgFWk#t=45m4s https://www.youtube.com/watch?v=wt-iVFxgFWk#t=45m4s
- jrajav 14y agoThe highlight of this release for me: built-in support for the ObjFW Objective-C runtime. https://webkeks.org/blog/?5f https://webkeks.org/blog/?5f
- joshavant 14y agoSo an Apple engineer spent time adding support for more 'liberal', non-Apple-based Objective-C runtimes? Wow! That seems unusual of Apple, but very cool. EDIT - Looking at the clang source, it looks like GNUstep and and ObjFW (with the exception of old GCC) are the only alternative Objective-C runtimes currently supported by clang: http://clang.llvm.org/doxygen/ObjCRuntime_8h_source.html http://clang.llvm.org/doxygen/ObjCRuntime_8h_source.html
- nhutchinson 14y agoIt looks like the Clang binaries for 32-bit Ubuntu try to produce 64-bit executables by default: # clang -v clang version 3.2 (tags/RELEASE_32/final) Target: x86_64-unknown-linux-gnu Thread model: posix # clang hello_world.c /usr/include/features.h:324:10: fatal error: 'bits/predefs.h' file not found # clang -m32 hello_world.c # (No error) That's not right, surely?
- azakai 14y agoSure you didn't download the 64-bit binaries? The 32-bit ones look fine to me. If you see that on 32-bit ones, file a bug.
- marshray 14y agoThis is what bit me when compiling g++ on Ubuntu: http://wiki.debian.org/Multiarch http://wiki.debian.org/Multiarch There seemed to be some special magic in the gcc build for Debian-derived distros. It wasn't all controllable with command-line options. You and Clang may be encountering similar fun.
- nhutchinson 14y agoThis has now been fixed.
- eli_gottlieb 14y agoWelp, now I had better go update jllvm to 3.2.