Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 27, 2014 Building SDC from source | ||||
---|---|---|---|---|
| ||||
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 |
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joseph Rushton Wakeling | do you use gdc ? then you have to use -lgphobos2 |
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On Sunday, 27 July 2014 at 12:12:08 UTC, Stefan Koch wrote:
> do you use gdc ?
> then you have to use -lgphobos2
scratch that I wasn't looking :)
sdc itself should not use phobos at all as far as I can tell.
libsdrt should be selfcontaint.
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | 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:
>> do you use gdc ?
>> then you have to use -lgphobos2
>
> scratch that I wasn't looking :)
>
> sdc itself should not use phobos at all as far as I can tell.
> libsdrt should be selfcontaint.
your LD_PATH seems to not have the lib in it
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | 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:
>> On Sunday, 27 July 2014 at 12:12:08 UTC, Stefan Koch wrote:
>>> do you use gdc ?
>>> then you have to use -lgphobos2
>>
>> scratch that I wasn't looking :)
>>
>> sdc itself should not use phobos at all as far as I can tell.
>> libsdrt should be selfcontaint.
>
> your LD_PATH seems to not have the lib in it
you have to envoke manualy "bin/sdc" with your modified LD_PATH.
or change the makefile
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On 27/07/14 14:22, Stefan Koch via Digitalmars-d-learn wrote:
> your LD_PATH seems to not have the lib in it
From 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.
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | 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.
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joseph Rushton Wakeling | Is shared Phobos library in /opt/dmd known do ldconfig? Can you build a sample hello world program with -defaultlib=libphobos.so ? |
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | 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?
|
July 27, 2014 Re: Building SDC from source | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joseph Rushton Wakeling | 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:
>> Is shared Phobos library in /opt/dmd known do ldconfig?
>
> No, but isn't that what the -L flag should be passing to gcc?
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).
|
Copyright © 1999-2021 by the D Language Foundation