www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - how to build LDC2 on linux x86_64

Let's add any comments to this protocol on this, it's own thread, rather
than on the old thread, to encapsulate and localize -- so as to make it
easier to find and replicate installion.

Thanks.

- Jason

On Tue, Mar 8, 2011 at 2:15 AM, Jens Mueller <jens.k.mueller gmx.de> wrote,
on the old thread titled "LLVM 3.0 type system changes"

 Can you talk me through the building process? I tried it a week ago but
 with no success. Can you post the necessary steps on this list or to me
 in private?
I can try to sketch the important aspects, but obviously this protocol hasn't been tested very widely, so feel free to post back any refinements. Even better if you want to patch the repositories. Some of these may be out of order, especially the CMakeCache.txt edits, so if anything goes wrong, check the variables mentioned below in CMakeCache.txt, and that your ldc2.conf is correct. Those are the most important two control files. I'll start a new thread with a new title to make this easy to find, and more on topic. I. Acknowledgements Heavy credit for this is due to mrmonday on #ldc who guided me and graciously offered assistance. Errors and typos are mine alone. II. Protocol: Building LDC2 on Linux x86_64 Version: 07 March 2011 Prereqs: cmake, git, hg, llvm2.8 from source already installed (package installs of llvm2.8 might work too, I don't know). $ hg clone https://bitbucket.org/prokhin_alexey/ldc2 $ cd ldc2 $ git clone https://github.com/AlexeyProkhin/druntime $ git clone https://github.com/AlexeyProkhin/phobos didn't)$ cmake . these two lines: ... //D language version - will originally be set to 1, change it to 2 like this: D_VERSION:STRING=2 ... they will be present yet, but if they aren't, it can't hurt to fix them now as well. $ make now I think) and fix these two variables: ... //runtime source dir RUNTIME_DIR:PATH=/home/jaten/pkg/ldc2/ldc2/druntime ... //phobos2 source dir PHOBOS2_DIR:PATH=/home/jaten/pkg/ldc2/ldc2/phobos ... everything else echo "export PATH=`pwd`/bin:\$PATH" >> ~/.bashrc . ~/.bashrc $ make phobos2 a copy of mine that seems to work. The point of the editing is to make sure that paths are correct, especially the third -I (Include line), which was often wrong out of the box when I was working with it. jaten dfw:~$ cat ldc2.conf // This configuration file uses libconfig. // See http://www.hyperrealm.com/libconfig/ for syntax details. // The default group is required default: { // 'switches' holds array of string that are appends to the command line // arguments before they are parsed. switches = [ "-I/home/jaten/pkg/llvm+lldb+ldc/prokhin_alexeys_ldc2/ldc2/druntime/import", "-I/home/jaten/pkg/llvm+lldb+ldc/prokhin_alexeys_ldc2/ldc2/druntime/src", "-I/home/jaten/pkg/llvm+lldb+ldc/prokhin_alexeys_ldc2/ldc2/phobos/", "-L-L/home/jaten/pkg/llvm+lldb+ldc/prokhin_alexeys_ldc2/ldc2/runtime/../lib", "-defaultlib=phobos2", "-debuglib=phobos2" ]; }; jaten dfw:~$ III. Appendix: Troubleshooting notes If anything goes wrong, in my experience it was due to the settings in either CMakeCache.txt, or in ./bin/ldc2.conf Those are the two places I would look at first when troubleshooting. A) When you edit the CMakeCache.txt, be sure to check that PHOBOS2_DIR gets set to ./phobos and not ../druntime jaten dfw:~$ cat CMakeCache.txt.afarm_works_ldc2 | grep PHOBOS2_DIR PHOBOS2_DIR:PATH=/home/jaten/pkg/llvm+lldb+ldc/prokhin_alexeys_ldc2/ldc2/phobos jaten dfw:~$ cat CMakeCache.txt.dfw_notwork_ldc2 | grep PHOBOS2_DIR PHOBOS2_DIR:PATH=/home/jaten/pkg/ldc2/ldc2/../druntime B) Be sure in CMakeCache.txt you have these three variables set correctly, with obvious edits for your paths, not mine: ... //D language version D_VERSION:STRING=2 ... //runtime source dir RUNTIME_DIR:PATH=/home/jaten/pkg/ldc2/ldc2/druntime ... //phobos2 source dir PHOBOS2_DIR:PATH=/home/jaten/pkg/ldc2/ldc2/phobos Good luck!
Mar 08 2011