digitalmars.D.learn - Building SDC from source
- Joseph Rushton Wakeling via Digitalmars-d-learn (21/21) Jul 27 2014 Hi all,
- Stefan Koch (2/2) Jul 27 2014 do you use gdc ?
- Stefan Koch (4/6) Jul 27 2014 scratch that I wasn't looking :)
- Stefan Koch (2/8) Jul 27 2014 your LD_PATH seems to not have the lib in it
- Stefan Koch (3/13) Jul 27 2014 you have to envoke manualy "bin/sdc" with your modified LD_PATH.
- Joseph Rushton Wakeling via Digitalmars-d-learn (4/5) Jul 27 2014 From the Makefile, I'd understood that LD_PATH was meant to point to th...
- Joseph Rushton Wakeling via Digitalmars-d-learn (4/6) Jul 27 2014 Yes, it's obviously being used to build the compiler, and supplying the ...
- Dicebot (2/2) Jul 27 2014 Is shared Phobos library in /opt/dmd known do ldconfig? Can you
- Joseph Rushton Wakeling via Digitalmars-d-learn (2/3) Jul 27 2014 No, but isn't that what the -L flag should be passing to gcc?
- Stefan Koch (8/11) Jul 27 2014 if gcc knows where the lib is it can compile agianst it.
- Joseph Rushton Wakeling via Digitalmars-d-learn (5/9) Jul 27 2014 Damn, I just realized I was misreading the messages. The gcc build is n...
- Dicebot (4/6) Jul 27 2014 One of many reasons why you don't usually want to circumvent
- Stefan Koch (4/10) Jul 27 2014 yeah
- Stefan Koch (5/16) Aug 02 2014 UPDATE my fork https://github.com/UplinkCoder/sdc32-experimental
Hi all, I'm running into a little trouble trying to build SDC. The first problem was that the makefile does not auto-detect the appropriate llvm-config, or the libphobos2 location, but that's simply enough fixed by doing (in my case): make LLVM_CONFIG=llvm-config-3.4 LD_PATH=/opt/dmd/lib64 It also needs libncurses5-dev to be installed (Debian/Ubuntu package name, may vary on other distros). However, even allowing for this, the build still falls over when it reaches this stage: gcc -o bin/sdc obj/sdc.o -m64 -L/opt/dmd/lib64 -lphobos2 -Llib -ld-llvm -ld `llvm-config-3.4 --ldflags` `llvm-config-3.4 --libs` -lstdc++ -export-dynamic -ldl -lffi -lpthread -lm -lncurses bin/sdc -c -o obj/rt/dmain.o libsdrt/src/d/rt/dmain.d -Ilibsdrt/src bin/sdc: error while loading shared libraries: libphobos2.so.0.66: cannot open shared object file: No such file or directory This is a bit mysterious, as libphobos2.so.0.66 does indeed exist in the /opt/dmd/lib64 directory. Or is this just an incompatible library version, with SDC expecting 2.065 .... ? Can anyone advise? Thanks & best wishes, -- Joe
Jul 27 2014
do you use gdc ? then you have to use -lgphobos2
Jul 27 2014
On Sunday, 27 July 2014 at 12:12:08 UTC, Stefan Koch wrote:do you use gdc ? then you have to use -lgphobos2scratch that I wasn't looking :) sdc itself should not use phobos at all as far as I can tell. libsdrt should be selfcontaint.
Jul 27 2014
On Sunday, 27 July 2014 at 12:16:05 UTC, Stefan Koch wrote:On Sunday, 27 July 2014 at 12:12:08 UTC, Stefan Koch wrote:your LD_PATH seems to not have the lib in itdo you use gdc ? then you have to use -lgphobos2scratch that I wasn't looking :) sdc itself should not use phobos at all as far as I can tell. libsdrt should be selfcontaint.
Jul 27 2014
On Sunday, 27 July 2014 at 12:22:03 UTC, Stefan Koch wrote:On Sunday, 27 July 2014 at 12:16:05 UTC, Stefan Koch wrote:you have to envoke manualy "bin/sdc" with your modified LD_PATH. or change the makefileOn Sunday, 27 July 2014 at 12:12:08 UTC, Stefan Koch wrote:your LD_PATH seems to not have the lib in itdo you use gdc ? then you have to use -lgphobos2scratch that I wasn't looking :) sdc itself should not use phobos at all as far as I can tell. libsdrt should be selfcontaint.
Jul 27 2014
On 27/07/14 14:22, Stefan Koch via Digitalmars-d-learn wrote:your LD_PATH seems to not have the lib in itFrom the Makefile, I'd understood that LD_PATH was meant to point to the _directory_ where the libraries are contained, not the actual library itself ... ? After all, it's just mapped to a -L flag.
Jul 27 2014
On 27/07/14 14:16, Stefan Koch via Digitalmars-d-learn wrote:sdc itself should not use phobos at all as far as I can tell. libsdrt should be selfcontaint.Yes, it's obviously being used to build the compiler, and supplying the flag directly is clearly only necessary in this case for the gcc call that brings together the sdc frontend and the LLVM backend.
Jul 27 2014
Is shared Phobos library in /opt/dmd known do ldconfig? Can you build a sample hello world program with -defaultlib=libphobos.so ?
Jul 27 2014
On 27/07/14 15:10, Dicebot via Digitalmars-d-learn wrote:Is shared Phobos library in /opt/dmd known do ldconfig?No, but isn't that what the -L flag should be passing to gcc?
Jul 27 2014
On Sunday, 27 July 2014 at 14:08:42 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:On 27/07/14 15:10, Dicebot via Digitalmars-d-learn wrote:if gcc knows where the lib is it can compile agianst it. But the library beeing _shared_ will not be linked with the executable but the library will be loaded form the path's supplied as LD_PATH or in ldconfig. The -L flag does not change the library-loader in any way (I think).Is shared Phobos library in /opt/dmd known do ldconfig?No, but isn't that what the -L flag should be passing to gcc?
Jul 27 2014
On 27/07/14 16:20, Stefan Koch via Digitalmars-d-learn wrote:if gcc knows where the lib is it can compile agianst it. But the library beeing _shared_ will not be linked with the executable but the library will be loaded form the path's supplied as LD_PATH or in ldconfig. The -L flag does not change the library-loader in any way (I think).Damn, I just realized I was misreading the messages. The gcc build is now succeeding -- it's the calls to bin/sdc that are failing. Adding a dlang.conf file in /etc/ld.so.conf.d/ which adds the /opt/dmd/lib64 path solves things.
Jul 27 2014
On Sunday, 27 July 2014 at 14:44:29 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:Adding a dlang.conf file in /etc/ld.so.conf.d/ which adds the /opt/dmd/lib64 path solves things.One of many reasons why you don't usually want to circumvent package management system ;)
Jul 27 2014
On Sunday, 27 July 2014 at 15:00:26 UTC, Dicebot wrote:On Sunday, 27 July 2014 at 14:44:29 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:yeah dub.jsons for sdc,libd,and llvm-libd are nice but I don't really know how these submodule-thingy works with dubAdding a dlang.conf file in /etc/ld.so.conf.d/ which adds the /opt/dmd/lib64 path solves things.One of many reasons why you don't usually want to circumvent package management system ;)
Jul 27 2014
On Sunday, 27 July 2014 at 15:15:05 UTC, Stefan Koch wrote:On Sunday, 27 July 2014 at 15:00:26 UTC, Dicebot wrote:UPDATE my fork https://github.com/UplinkCoder/sdc32-experimental has weak support for beeing build with dub its much much faster then the makefiles though i still need to integrade libsdrt and polish itOn Sunday, 27 July 2014 at 14:44:29 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:yeah dub.jsons for sdc,libd,and llvm-libd are nice but I don't really know how these submodule-thingy works with dubAdding a dlang.conf file in /etc/ld.so.conf.d/ which adds the /opt/dmd/lib64 path solves things.One of many reasons why you don't usually want to circumvent package management system ;)
Aug 02 2014