www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linux installation: search path for dmd.conf

reply Norbert Nemec <Norbert Nemec-online.de> writes:
Hi there,

playing with my DMD installation, I notice that the
D-installation-web-page gives the instruction to place dmd.conf in
/etc/dmd.conf

This is a real problem if you are not administrator yourself. The
compiler should fist look for a file in the home directory, (e.g.
~/.dmd.conf) before falling back to the system-wide location /etc/dmd.conf.

In case a solution like this is already in place, it should be
documented in the installation page.

Greetings,
Norbert Nemec
Apr 23 2006
parent reply Norbert Nemec <Norbert Nemec-online.de> writes:
Just after complaining about dmd.conf, I noticed that libphobos.a is
also expected in the fixed location: /usr/lib/libphobos.a

I guess there is a way to configure this path (in dmd.conf?) which
should definitely be described on the installation web-page.

Currently, a user without root access is completely out of luck in
trying out D on a Linux system.


Norbert Nemec wrote:
 Hi there,
 
 playing with my DMD installation, I notice that the
 D-installation-web-page gives the instruction to place dmd.conf in
 /etc/dmd.conf
 
 This is a real problem if you are not administrator yourself. The
 compiler should fist look for a file in the home directory, (e.g.
 ~/.dmd.conf) before falling back to the system-wide location /etc/dmd.conf.
 
 In case a solution like this is already in place, it should be
 documented in the installation page.
 
 Greetings,
 Norbert Nemec

Apr 23 2006
next sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Norbert Nemec schrieb am 2006-04-23:
 Just after complaining about dmd.conf, I noticed that libphobos.a is
 also expected in the fixed location: /usr/lib/libphobos.a

 I guess there is a way to configure this path (in dmd.conf?) which
 should definitely be described on the installation web-page.

 Currently, a user without root access is completely out of luck in
 trying out D on a Linux system.

cd /some/path/you/like unzip dmd.zip chmod guo=rx dmd/bin/dmd And put the following shell script somewhere in your path #!/bin/bash A=/some/path/you/like $A/bin/dmd -I$A/src/phobos -L-L$A/lib $* Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFES0zl3w+/yD4P9tIRAig+AJ9+ii4xvWJsc/vhI5ofZoZpTCj0ZwCfZ7fv yW+4KnWlSY4zgSVAhElOlB4= =WARA -----END PGP SIGNATURE-----
Apr 23 2006
next sibling parent Norbert Nemec <Norbert Nemec-online.de> writes:
Thomas Kuehne wrote:
 Norbert Nemec schrieb am 2006-04-23:
 Just after complaining about dmd.conf, I noticed that libphobos.a is
 also expected in the fixed location: /usr/lib/libphobos.a

 I guess there is a way to configure this path (in dmd.conf?) which
 should definitely be described on the installation web-page.

 Currently, a user without root access is completely out of luck in
 trying out D on a Linux system.


cd /some/path/you/like unzip dmd.zip chmod guo=rx dmd/bin/dmd And put the following shell script somewhere in your path #!/bin/bash A=/some/path/you/like $A/bin/dmd -I$A/src/phobos -L-L$A/lib $*

OK, that's indeed a workaround. This, or an alternative solution should be mentioned on the official D page with installation instructions.
Apr 23 2006
prev sibling parent Norbert Nemec <Norbert Nemec-online.de> writes:
Thomas Kuehne wrote:
 Norbert Nemec schrieb am 2006-04-23:
 Just after complaining about dmd.conf, I noticed that libphobos.a is
 also expected in the fixed location: /usr/lib/libphobos.a

 I guess there is a way to configure this path (in dmd.conf?) which
 should definitely be described on the installation web-page.

 Currently, a user without root access is completely out of luck in
 trying out D on a Linux system.


cd /some/path/you/like unzip dmd.zip chmod guo=rx dmd/bin/dmd And put the following shell script somewhere in your path #!/bin/bash A=/some/path/you/like $A/bin/dmd -I$A/src/phobos -L-L$A/lib $*

Thanks! A slightly improved version: ----------------------- #!/bin/sh A=$HOME/wherever/you/installed/dmd exec $A/bin/dmd -I$A/src/phobos -L$A/lib "$ " -----------------------
Apr 23 2006
prev sibling next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Norbert Nemec wrote:

playing with my DMD installation, I notice that the D-installation-
web-page gives the instruction to place dmd.conf in /etc/dmd.conf


 Just after complaining about dmd.conf, I noticed that libphobos.a is
 also expected in the fixed location: /usr/lib/libphobos.a

You can find the DMD install instructions for non-root users on Wiki4D: http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/InstallingDCompiler There's two "methods" described there, method One installs in your home dir and requires setting PATHs, method Two in system dirs and doesn't require setting PATH variables - but does require root/admin access... There is also an RPM for DMD, that installs it into the /usr hierarchy (normally you would install it into /usr/local, if doing it manually ?) http://www.algonet.se/~afb/d/dmd.spec (soon to be updated, but 146 now) I would "recommend" using the following locations, but as far as I know there is no universal agreements on where these should go under Linux ? Method DMD (compiler) Phobos (library) One /home/yourname/dmd/bin/dmd /home/yourname/dmd/lib/libphobos.a Two /usr/local/bin/dmd /usr/local/lib/libphobos.a The RPM package will install the D import modules under /usr/lib/phobos, but when doing it manually you can just link directly to dmd/src/phobos. --anders
Apr 23 2006
parent reply Norbert Nemec <Norbert Nemec-online.de> writes:
Anders F Bj=F6rklund wrote:
 Norbert Nemec wrote:
=20
 playing with my DMD installation, I notice that the D-installation-
 web-page gives the instruction to place dmd.conf in /etc/dmd.conf


 Just after complaining about dmd.conf, I noticed that libphobos.a is
 also expected in the fixed location: /usr/lib/libphobos.a

You can find the DMD install instructions for non-root users on Wiki4D:=

=20
 http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/InstallingDCompiler

Nice, but this info should be found on the very official site at digitalmars: that's the first place a new user would search for it, and it should cover the common question of non-root installation.
 I would "recommend" using the following locations, but as far as I know=

 there is no universal agreements on where these should go under Linux ?=

There is indeed no universial agreement for binaries, but there is a canonical place for configuration files: /etc/dmd.conf and $HOME/.dmd.conf The second one should definitely be searched first by the compiler, and the template of this file (dmd.zip//dmd/bin/dmd.conf) should contain not only the path to the phobos sources but also that to libphobos.a
Apr 23 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Norbert Nemec wrote:

You can find the DMD install instructions for non-root users on Wiki4D:
http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/InstallingDCompiler

Nice, but this info should be found on the very official site at digitalmars: that's the first place a new user would search for it, and it should cover the common question of non-root installation.

Agreed, but those pages are managed only by Digital Mars and Walter. All us mortals could do was to report the issue, and write the docs. Maybe now with the new Bugzilla, one could make another attempt at it... I wouldn't hold my breath though, haven't this been an issue for years ? But if this is finally fixed one day, I would also like to see: - a tarball with UNIX linefeeds, and the proper permissions set - a "make install" for the DMD makefile, to install *all* of it And EXE and RPM installers of course, but that's been discussed before. I think that any packaging effort is better spent with GDC, than DMD...
I would "recommend" using the following locations, but as far as I know
there is no universal agreements on where these should go under Linux ?

There is indeed no universial agreement for binaries, but there is a canonical place for configuration files: /etc/dmd.conf and $HOME/.dmd.conf The second one should definitely be searched first by the compiler, and the template of this file (dmd.zip//dmd/bin/dmd.conf) should contain not only the path to the phobos sources but also that to libphobos.a

I agree that DMD should search ~/.dmd.conf before /etc/dmd.conf. But as a workaround you can set the DFLAGS environment variable, and the DMD compiler *will* pick up on those settings instead... (putting such an export in your profile is almost like a config?) This should also be reported as a bone fide *bug*, against DMD... --anders
Apr 23 2006
prev sibling parent BCS <BCS_member pathlink.com> writes:
I get around that with a set of aliases in my .profile. I aliased DMD with a -c
and the path to the Phobos and made up "dlnk" to call gcc with the needed stuff
(explicitly link in libphobos.a)


In article <e2fddh$1r1i$1 digitaldaemon.com>, Norbert Nemec says...
Just after complaining about dmd.conf, I noticed that libphobos.a is
also expected in the fixed location: /usr/lib/libphobos.a

I guess there is a way to configure this path (in dmd.conf?) which
should definitely be described on the installation web-page.

Currently, a user without root access is completely out of luck in
trying out D on a Linux system.


Norbert Nemec wrote:
 Hi there,
 
 playing with my DMD installation, I notice that the
 D-installation-web-page gives the instruction to place dmd.conf in
 /etc/dmd.conf
 
 This is a real problem if you are not administrator yourself. The
 compiler should fist look for a file in the home directory, (e.g.
 ~/.dmd.conf) before falling back to the system-wide location /etc/dmd.conf.
 
 In case a solution like this is already in place, it should be
 documented in the installation page.
 
 Greetings,
 Norbert Nemec


Apr 23 2006