www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dmd.conf... again

reply "Atila Neves" <atila.neves gmail.com> writes:
I'm trying to use dmd on a VM where I don't have root privileges 
(don't ask). I can't copy dmd.conf to /etc. According to the 
docs, I should be able to use a dmd.conf that's in the same dir 
as dmd itself, or in my home directory, or even specifying 
-conf=. None of these seems to tell dmd where to find phobos.

I've also tried setting DFLAGS myself, but under no circumstances 
is dmd passing the -L where phobos is to ld, so I can compile but 
not link (well, I can if I use gcc!). Also tried dmd 
-L-L/path/to/phobos.

Does anyone have a clue why this doesn't work? My dmd.conf looks 
like this:

[Environment]
DFLAGS=-I/nobackup/dlang/phobos/ 
-I/nobackup/dlang/druntime/import 
-L-L/nobackup/dlang/download/dmd2/linux/lib64

Atila
Aug 12 2015
next sibling parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 13/08/2015 12:16 a.m., Atila Neves wrote:
 I'm trying to use dmd on a VM where I don't have root privileges (don't
 ask). I can't copy dmd.conf to /etc. According to the docs, I should be
 able to use a dmd.conf that's in the same dir as dmd itself, or in my
 home directory, or even specifying -conf=. None of these seems to tell
 dmd where to find phobos.

 I've also tried setting DFLAGS myself, but under no circumstances is dmd
 passing the -L where phobos is to ld, so I can compile but not link
 (well, I can if I use gcc!). Also tried dmd -L-L/path/to/phobos.

 Does anyone have a clue why this doesn't work? My dmd.conf looks like this:

 [Environment]
 DFLAGS=-I/nobackup/dlang/phobos/ -I/nobackup/dlang/druntime/import
 -L-L/nobackup/dlang/download/dmd2/linux/lib64

 Atila
Perhaps this small snippet from my Windows install might shred some light. Specifically the LIB property. [Environment32] LIB="% P%\..\lib" LINKCMD=% P%\link.exe [Environment64] LIB="% P%\..\lib64"
Aug 12 2015
parent "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 12:21:14 UTC, Rikki Cattermole 
wrote:
 On 13/08/2015 12:16 a.m., Atila Neves wrote:
 [...]
Perhaps this small snippet from my Windows install might shred some light. Specifically the LIB property. [Environment32] LIB="% P%\..\lib" LINKCMD=% P%\link.exe [Environment64] LIB="% P%\..\lib64"
Tried setting LIB, still doesn't work. Sigh. Atila
Aug 12 2015
prev sibling next sibling parent reply "Dicebot" <public dicebot.lv> writes:
More info about what gets placed where please.

I have special dev layout on my system that co-exists with 
system-wide installation of dmd. It is as simple as having 
~/dlang/{dmd|druntime|phobos}, linking ~/dlang/dmd/src/dmd to 
~/bin/dmd-dev and placing dmd.conf in ~/bin which adds all those 
paths as -I and -L flags. Works just fine.
Aug 12 2015
parent reply "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 12:29:46 UTC, Dicebot wrote:
 More info about what gets placed where please.

 I have special dev layout on my system that co-exists with 
 system-wide installation of dmd. It is as simple as having 
 ~/dlang/{dmd|druntime|phobos}, linking ~/dlang/dmd/src/dmd to 
 ~/bin/dmd-dev and placing dmd.conf in ~/bin which adds all 
 those paths as -I and -L flags. Works just fine.
There's no system-wide installation (since I don't have root), I just downloaded the zip for 2.068 and added dmd2/linux/bin64 to my PATH. Atila
Aug 12 2015
parent "Dicebot" <public dicebot.lv> writes:
On Wednesday, 12 August 2015 at 13:04:25 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 12:29:46 UTC, Dicebot wrote:
 More info about what gets placed where please.

 I have special dev layout on my system that co-exists with 
 system-wide installation of dmd. It is as simple as having 
 ~/dlang/{dmd|druntime|phobos}, linking ~/dlang/dmd/src/dmd to 
 ~/bin/dmd-dev and placing dmd.conf in ~/bin which adds all 
 those paths as -I and -L flags. Works just fine.
There's no system-wide installation (since I don't have root), I just downloaded the zip for 2.068 and added dmd2/linux/bin64 to my PATH. Atila
Yeah I have meant that it works _even_ if you also have system-wide installation. No idea what dmd.conf they put into zip - I never use it.
Aug 12 2015
prev sibling next sibling parent "Joakim =?UTF-8?B?QnLDpG5uc3Ryw7ZtIg==?= <notfornow dev.null.com> writes:
On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote:
 I'm trying to use dmd on a VM where I don't have root 
 privileges (don't ask). I can't copy dmd.conf to /etc. 
 According to the docs, I should be able to use a dmd.conf 
 that's in the same dir as dmd itself, or in my home directory, 
 or even specifying -conf=. None of these seems to tell dmd 
 where to find phobos.

 I've also tried setting DFLAGS myself, but under no 
 circumstances is dmd passing the -L where phobos is to ld, so I 
 can compile but not link (well, I can if I use gcc!). Also 
 tried dmd -L-L/path/to/phobos.

 Does anyone have a clue why this doesn't work? My dmd.conf 
 looks like this:

 [Environment]
 DFLAGS=-I/nobackup/dlang/phobos/ 
 -I/nobackup/dlang/druntime/import 
 -L-L/nobackup/dlang/download/dmd2/linux/lib64

 Atila
Hmm, for me the dmd zip works out of the box. Unzip, add ...dmd2/linux/bin64 to PATH. Done. (The following is a stupid workaround that may be employed for libs that don't follow the normal naming convention. Phobos shouldn't be one of them but...) But lets say you want to force it to link to a specific lib that is in a lookup path you could use the full filename: -L-l:libphobos2.so
Aug 12 2015
prev sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote:
 I'm trying to use dmd on a VM where I don't have root 
 privileges (don't ask). I can't copy dmd.conf to /etc.
If you use the dmd zip, everything just works when you just unzip it and use it all in-place. No need to move or copy files anywhere, no need for root.
Aug 12 2015
parent reply "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe wrote:
 On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote:
 I'm trying to use dmd on a VM where I don't have root 
 privileges (don't ask). I can't copy dmd.conf to /etc.
If you use the dmd zip, everything just works when you just unzip it and use it all in-place. No need to move or copy files anywhere, no need for root.
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Aug 12 2015
parent reply "wobbles" <grogan.colin gmail.com> writes:
On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe 
 wrote:
 On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves 
 wrote:
 I'm trying to use dmd on a VM where I don't have root 
 privileges (don't ask). I can't copy dmd.conf to /etc.
If you use the dmd zip, everything just works when you just unzip it and use it all in-place. No need to move or copy files anywhere, no need for root.
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Have you run dmd from the directory you unzipped it to? libphobos2.a is in there I think, so ld wouldn't be able to find it.
Aug 12 2015
parent reply "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe 
 wrote:
 On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves 
 wrote:
 [...]
If you use the dmd zip, everything just works when you just unzip it and use it all in-place. No need to move or copy files anywhere, no need for root.
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Have you run dmd from the directory you unzipped it to? libphobos2.a is in there I think, so ld wouldn't be able to find it.
Just did, didn't work. Tried it from lib64 and lib32 as well, nothing. Atila
Aug 12 2015
parent reply "wobbles" <grogan.colin gmail.com> writes:
On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves 
 wrote:
 On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe 
 wrote:
 [...]
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Have you run dmd from the directory you unzipped it to? libphobos2.a is in there I think, so ld wouldn't be able to find it.
Just did, didn't work. Tried it from lib64 and lib32 as well, nothing. Atila
Hmm, I'll setup a VM later this evening to test, see if I can figure it out. This really should be easier.
Aug 12 2015
parent reply "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 15:22:39 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves 
 wrote:
 On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe 
 wrote:
 [...]
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Have you run dmd from the directory you unzipped it to? libphobos2.a is in there I think, so ld wouldn't be able to find it.
Just did, didn't work. Tried it from lib64 and lib32 as well, nothing. Atila
Hmm, I'll setup a VM later this evening to test, see if I can figure it out. This really should be easier.
It really should. I straced it and it's trying to link to phobos with `-l:libphobos2.a`. I've never seen a colon in library options before and the (ancient) gcc on the system doesn't seem to like it one bit. I added a hand-compiled gcc 4.9 to my PATH and... it worked. Atila
Aug 12 2015
next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote:
 I've never seen a colon in library options before and the 
 (ancient) gcc on the system doesn't seem to like it one bit.
ooooohhh, I have seen that before, I was on a CentOS 5 VM and it didn't like that colon either. It was added to dmd about two or three years ago, I remember it breaking my thing. I think I 'fixed' it by just linking manually in the makefile for that vm.
Aug 12 2015
parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 08/12/2015 08:38 AM, Adam D. Ruppe wrote:
 On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote:
 I've never seen a colon in library options before and the (ancient)
 gcc on the system doesn't seem to like it one bit.
ooooohhh, I have seen that before, I was on a CentOS 5 VM and it didn't like that colon either. It was added to dmd about two or three years ago, I remember it breaking my thing. I think I 'fixed' it by just linking manually in the makefile for that vm.
This thread explains the same problem I've been having on my Scientific Linux 6.1 even though my 'man ld' talks about :filename. Ali
Aug 12 2015
prev sibling parent reply "Joakim =?UTF-8?B?QnLDpG5uc3Ryw7ZtIg==?= <notfornow dev.null.com> writes:
On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote:
 On Wednesday, 12 August 2015 at 15:22:39 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves 
 wrote:
 On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote:
 On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves 
 wrote:
 On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe 
 wrote:
 [...]
I downloaded the zip, added linux/bin64 to PATH, tried compiling a hello world and got: usr/bin/ld: cannot find -l:libphobos2.a That's when I started trying to set the configuration but nothing seems to work. Atila
Have you run dmd from the directory you unzipped it to? libphobos2.a is in there I think, so ld wouldn't be able to find it.
Just did, didn't work. Tried it from lib64 and lib32 as well, nothing. Atila
Hmm, I'll setup a VM later this evening to test, see if I can figure it out. This really should be easier.
It really should. I straced it and it's trying to link to phobos with `-l:libphobos2.a`. I've never seen a colon in library options before and the (ancient) gcc on the system doesn't seem to like it one bit. I added a hand-compiled gcc 4.9 to my PATH and... it worked. Atila
From man ld :) -l namespec Add the archive or object file specified by namespec to the list of files to link. This option may be used any number of times. If namespec is of the form :filename, ld will search the library path for a file called filename, otherwise it will search the library path for a file called libnamespec.a. On systems which support shared libraries, ld may also search for files other than libnamespec.a. Specifically, on ELF and SunOS systems, ld will search a directory for a library called libnamespec.so before searching for one called libnamespec.a. (By convention, a ".so" extension indicates a shared library.) Note that this behavior does not apply to :filename, which always specifies a file called filename. So in this case it could probably work with -lphobos2. Maybe -L-l:libphobos2.a was chosen to force the linking with the static lib (as can be seen in the second paragraph for systems that supports both). // Joakim
Aug 12 2015
next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
On Wednesday, 12 August 2015 at 15:49:37 UTC, Joakim Brännström 
wrote:
 On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote:
 [...]
From man ld :) -l namespec Add the archive or object file specified by namespec to the list of files to link. This option may be used any number of times. If namespec is of the form :filename, ld will search the library path for a file called filename, otherwise it will search the library path for a file called libnamespec.a. On systems which support shared libraries, ld may also search for files other than libnamespec.a. Specifically, on ELF and SunOS systems, ld will search a directory for a library called libnamespec.so before searching for one called libnamespec.a. (By convention, a ".so" extension indicates a shared library.) Note that this behavior does not apply to :filename, which always specifies a file called filename. So in this case it could probably work with -lphobos2. Maybe -L-l:libphobos2.a was chosen to force the linking with the static lib (as can be seen in the second paragraph for systems that supports both).
Yeah, pretty sure that was it: when I called gcc myself it linked to the shared version. Maybe I should file a bug report for at least a proper error message when using it on ancient systems. Atila
Aug 12 2015
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wednesday, 12 August 2015 at 15:49:37 UTC, Joakim Brännström 
wrote:
 From man ld :)
It's only there if you have a new enough ld for the feature to be supported! One of the work CentOS VMs I have to use sometimes doesn't have it. $ ld --version GNU ld version 2.17.50.0.6-14.el5 20061020 Copyright 2005 Free Software Foundation, Inc. lol $ man ld -larchive --library=archive Add archive file archive to the list of files to link. This option may be used any number of times. ld will search its path-list for occurrences of "libarchive.a" for every archive specified. On systems which support shared libraries, ld may also search for libraries with extensions other than ".a". Specifically, on ELF and SunOS systems, ld will search a directory for a library with an extension of ".so" before searching for one with an extension of ".a". By convention, a ".so" extension indicates a shared library.
Aug 12 2015