Getting started with LLVM - Windows/Linux - llvm

I would like to download and try out LLVM, before that I wanted to know:
(a) What are the factors to consider before finalizing a LLVM platform (Windows/Linux)?
(b) What is the best way to learn LLVM? I would like to get involved in one of the projects there. So I want to get overall idea about it. In the process I got overwhelmed by the sheer size of LLVM, its sub-projects, its tools, the support, etc.
FYI: I have gone through the basics of LLVM from the llvm.org
Also have worked on the compiler related development, static code analysis.
Please help.
Thank you.

LLVM doesn't run on just one platform. As a contributor, your patches will be expected to work on many platforms. If you're not setup to test on more than one, then you'll be reliant on the interest of others in your patches for them to test them for you on other platforms. Your best bet is to use virtual machines (via VMWare or VirtualBox or whatever) to provide you with multiple platforms to work with. You'll find the most stability on OS X (Darwin), with Linux a close 2nd, owing primarily to the large number of buildbot slaves that test these configurations.
Your best bet is to pick a smaller project that is relatively contained. For example, you might choose something that is contained within a single pass, a single target, etc. The modularity of the code should make a lot of projects possible without understanding the entire source base. Pick an area to understand deeply first and then move on to others. It is not expected that somebody who can work on the testsuite is also capable of understanding the nuances of LiveIntervals.
Use the mailing lists and IRC to seek help. Few LLVM contributors seem to regularly visit StackOverflow. As is said frequently within the project, "patches welcome."

Related

how to make apps fast as c++ and as crossplatform as web apps?

As a personal project I would like to write a large, computationally expensive simulation with some graphics and user inputs at runtime. For that reason it was clear to me that I will be using C++ as my main language. (I also have a personal preference to use C++.)
Then I realized I would like the simulation to be as broadly available (crossplatfrom) as it can be. I guess it might be tedious for potential inexperienced users to use build instructions. For example, as far as I know, a windows user would have to install Make, Git, and a C++ compiler to run all the necessary commands in the terminal.
I have searched for a bit and now I think my only choices are:
assuming the user is skilled enough to follow c++ build instructions
pasting the whole .exe file to OneDrive
compile to .wasm (but that would require me to learn it and probably
set up a server right?)
ignore C++ assume javascript can handle the computation and host it
on github.io
My experience is pretty narrow and (I think) I would like to keep it as close to C++ as I can.
I also plan to make similiar projects in the future (with crossplatform and computationally expensive requirenments.)
Maybe I am missing something? Any input is highly appreciated :)
Your best bet here is to either use WebAssembly (.wasm) as you yourself suggested, or distributing a binary executable for each platform you want it to be available to. This way, users don't have to recompile the code on each platform. Github provides a way to distribute these precompiled binaries, though I personally have not tried it. If you want to go the wasm way, take a look at Emscripten (https://emscripten.org/), I believe that project provides an extensive toolset that will recompile a many apps from C++ to wasm without too much work. I know it's not a complete answer but hope it helps.

VM for scripted languages

I'm currently looking at different virtual machines to run a host of different scripted languages (in an embedded manner).
Two VMs that have caught my eye are:
LLVM: While I have seen posts that suggest not using LLVM as an VM, it does seem to have a lot going for it. It can do optimization, JIT, has a nice debugger already, etc. While there doesn't seem to be too much documentation on using LLVM in this manner, there is Cling which is capable of running c++11 as an interpreted language (which is pretty impressive), as well as the command-line tool 'lli'.
libJIT: Technically this isn't a VM, but provides the necessary tools to create one.
So my questions are:
Does anyone have experience with either of these VMs and can give negative/positive experiences.
I've gone through a lot of the documentation for both LLVM and libJIT, but wanted to check if anyone had any recommendations for other resources (esp. for LLVM).
Are there other VMs out there that I should consider? I've done some fairly extensive searches, so this not a question of what VMs are out there, but rather one of software that people have used and would recommend.
As for actual use of the VM I'm intending to embed the VM within a c++ program to provide a scriptable user environment. I'm already using Lua for some of the stuff, but for various reasons I want to be able to support other languages as well.
Finally, I've looked at Parrot, but I am a little hesitant to use it from some of the things I've read about it (maybe someone can convince me otherwise?).
update
I came across http://vmkit.llvm.org, which looks like it uses LLVM to create a full-fledged VM.

Building Zimbra

I want to know why in the Zimbra Wiki only specific platforms are listed for build process. This means that building Zimbra on other for example Linux distributions is impossible?
What is the real reason behind the choice of a special Linux distribution for building Zimbra by the Zimbra community?
I'm currently trying to set up Zimbra on Arch Linux and I'm getting behind those reasons.
Imho Zimbra is a nice piece of work on the outside, useful webmail client, integrates various stuff nicely, etc. BUT the whole package violates every assumption you ever had about server software on linux by bundling and compiling nearly all libraries and third party software into it, this goes as far as basic stuff like popt.
The stated requirement is that you set up Zimbra on a machine on its own and don't you dare to run something else on there.
Since everything is so tightly integrated it's a huge thing to compile and since each bundled software may need to be compiled differently on any distro or anything might break anywhere, the effort must be huge to maintain a sane build for more than a handful of platforms.
It also boggles my mind how anyone could ever think this bundling a good idea. If any security issues arise in a single piece of it, everything must be rebuilt. Instead of the admin relying on the security updates of their distro, they must patch Zimbra themselves, etc.
It seems that building Zimbra on any platform is quite the adventure, to put it mildly. The only platform documented nicely and up to date is FreeBSD which is largely due to a single person not associated with Zimbra, as far as I can see.
I was the build engineer of a Zimbra based project for about a year. We were building it using CentOS. Building Zimbra almost on every platform is possible. It's just a matter of experience and proficiency, since too many programming languages and related technologies are involved in build process and you need to install the exact required version. Thus you might be forced to compile and build some extra packages as well.
I remember that first time that I tried to build Zimbra, It took about 2 weeks for a successful build. However I documented the process completely and clearly. Later on, it took about a night to build Zimbra.

OpenHMPP in GCC

The gist of the question is:
Do you know any projects that aim to bring OpenHMPP support to GCC? I could also possibly live with affordable commercial compilers, but it's very unlikely, because I prefer Linux, and I would like the compiler to support non-x86 architectures as well.
And the background story:
I know OpenCL and CUDA people will bash me, but here goes my experience/opinion: I've been pursuing some toy projects to get into many core processing using CUDA and OpenCL. I feel that it's such a mess to set up those development environments (especially under linux and especially if you've the slightest bit of irregularity in your system). Even when you set them up, it's still a mess to run them anywhere other than your development environment. Finally (and probably the most importantly) these languages are very verbose and tiresome. I feel like they're the assembler of many-core processing. Compare them to OpenMP, and you see how they could actually be.
At this point, OpenHMPP comes into the scene. It uses #pragma statements like OpenMP and it seems to be a very good step in the right direction. However, it's very hard to find compilers for it. CAPS Enterprize and Pathscale do have OpenHMPP support, but they're very expensive (€4000 for CAPS, I couldn't find the price for Pathscale). And correct me if I'm wrong, but CAPS seems to support C, not C++.
So, we return to the gist. It would be like a dream, to have OpenHMPP support in GCC. Do you know of any open-source projects or any affordable alternatives? Maybe even, do you know of alternatives to OpenHMPP that are easier to find support for.
If I understand you correctly, you are looking for ways to simplify access to accelerator devices, which may be GPUs as well as multi-core CPUs.
This is a field with a lot of academic work happening right now, resulting in many publications describing such frameworks, however only few are actually available.
In fact, the reasons you are stating are the basis of my research, which is also far from complete or in a state usable by anyone else...
The only thing I know, that comes close to what you seek (using #pragmas to access accelerators), would be MGP from the Virtual OpenCL package.
All other solutions are more intrusive by requiring the use of their API.
I have not yet had a closer look to AMP for C++, but it might be interesting if it picks up some pace.

Learning C++, questions about environment

I am asking this here because I think my last question was more than one question so creating another question seemed appropriate. However, you can close it if it does not adhere to the SO policies.
In this comment on my last question , I was given a nice advice by Michael Aaron Safyan (at least I liked it):
Once you feel somewhat comfortable in the language, then I would recommend taking a look at Google Code and seeing if there are any C++ projects that are in need of some help.
I am going to be developing on XCode on Mac. My question is that do I have to take that into consideration when developing for C++ projects. Is environment consideration project based or can a generic OS/Env be used like Mac/Xcode or Ubuntu/Anjuta?
Thanks.
In theory, no; in practice, yes.
For core algorithms, the environment wouldn't matter.
For UI, the platform matters termendously.
Unfortunately, UI drives most applications. Usually, the core algorithms are trivial.
Even in the rare cases where UI doesn't matter, you would still have the problem of common libraries.
When it comes to C++ development there are two major camps: MSVC, and gcc. Porting a project between them is not always easy, so since Xcode is gcc-based as long as you stick to gcc projects (typical filenames to look for are configure and Makefile) you should not have a problem.
If a project has been ported, or is portable, to your platform of choice, of course you can work on it.
But if a project is specific to a certain platform, and that's not your chosen one (e.g., a Windows application), you will have a hard time working on that project as you cannot compile the source, let alone have a test run.
Of course, today there are many virtualization solutions available that allow you to run a different OS in a virtual machine. In my opinion, though, that just adds another layer of problems, especially for a novice programmer.