www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Error by building druntime

reply "Namespace" <rswhite4 googlemail.com> writes:
I tried to fork and build dmd, druntime and phobos. With dmd it 
works fine but if I try "make -f win32.mak" on druntime I get:
[code]
src\core\sys\windows\windows.d(81): Warning: else is dangling, 
add { } after con
dition at src\core\sys\windows\windows.d(17)
src\core\sys\windows\windows.d(164): Warning: else is dangling, 
add { } after co
ndition at src\core\sys\windows\windows.d(17)
src\core\sys\windows\windows.d(1286): Warning: else is dangling, 
add { } after c
ondition at src\core\sys\windows\windows.d(17)
src\rt\arraycast.d(33): Error: object.Error is thrown but not 
caught
src\rt\arraycast.d(26): Error: function rt.arraycast._d_arraycast 
'_d_arraycast'
  is nothrow yet may throw
src\rt\arraycat.d(36): Error: object.Error is thrown but not 
caught
src\rt\arraycat.d(45): Error: object.Error is thrown but not 
caught
src\rt\arraycat.d(25): Error: function rt.arraycat._d_arraycopy 
'_d_arraycopy' i
s nothrow yet may throw
[/code]

Is that my fault? :o
Is there any official manual for building dmd, druntime and 
phobos?
Dec 23 2012
next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/23/12, Namespace <rswhite4 googlemail.com> wrote:
 Is that my fault? :o
 Is there any official manual for building dmd, druntime and
 phobos?
You're probably building druntime 2.061 with dmd 2.060. First you need to build dmd git-head, then druntime (*with* the newly built DMD), then phobos. There are some guides written here, see if that helps: http://wiki.dlang.org/Building_DMD or http://wiki.dlang.org/Using_Git_on_Windows
Dec 23 2012
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Sunday, 23 December 2012 at 23:01:37 UTC, Andrej Mitrovic 
wrote:
 On 12/23/12, Namespace <rswhite4 googlemail.com> wrote:
 Is that my fault? :o
 Is there any official manual for building dmd, druntime and
 phobos?
You're probably building druntime 2.061 with dmd 2.060. First you need to build dmd git-head, then druntime (*with* the newly built DMD), then phobos. There are some guides written here, see if that helps: http://wiki.dlang.org/Building_DMD or http://wiki.dlang.org/Using_Git_on_Windows
Yeah that was my fault. Thanks a lot. And thanks Jonathan M Davis for your detailed answer. Is it possible, that, even if I use " -release", dmd is build in debug mode (on windows)?
Dec 23 2012
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
12/24/2012 3:33 AM, Namespace пишет:
 On Sunday, 23 December 2012 at 23:01:37 UTC, Andrej Mitrovic wrote:
 On 12/23/12, Namespace <rswhite4 googlemail.com> wrote:
 Is that my fault? :o
 Is there any official manual for building dmd, druntime and
 phobos?
You're probably building druntime 2.061 with dmd 2.060. First you need to build dmd git-head, then druntime (*with* the newly built DMD), then phobos. There are some guides written here, see if that helps: http://wiki.dlang.org/Building_DMD or http://wiki.dlang.org/Using_Git_on_Windows
Yeah that was my fault. Thanks a lot. And thanks Jonathan M Davis for your detailed answer. Is it possible, that, even if I use " -release", dmd is build in debug mode (on windows)?
make -fwin32.mak release So release is a make target. -- Dmitry Olshansky
Dec 24 2012
next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Dmitry Olshansky:

 make -fwin32.mak release
I think there's a space between -f and win32. Bye, bearophile
Dec 24 2012
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, December 24, 2012 09:38:43 bearophile wrote:
 Dmitry Olshansky:
 make -fwin32.mak release
I think there's a space between -f and win32.
There's a good chance that it doesn't matter one way or the other. - Jonathan M Davis
Dec 24 2012
prev sibling parent reply "Namespace" <rswhite4 googlemail.com> writes:
 make -fwin32.mak release

 So release is a make target.
Then I get: D:\D\dmd2\src\dmd>make -fwin32.mak release make -fwin32.mak C=backend TK=tk ROOT=root clean del *.obj del total.sym del msgs.h msgs.c del elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c del impcnvtab.c cd cppunit-1.12.1\src\cppunit --- errorlevel 1 --- errorlevel 1 What's wrong? o.O
Jan 01 2013
parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 1 January 2013 at 14:45:09 UTC, Namespace wrote:
 make -fwin32.mak release

 So release is a make target.
Then I get: D:\D\dmd2\src\dmd>make -fwin32.mak release
Strange... wind32.mak is supposed to be inside "somepath"/dmd/src, but you are calling it from "somepath"/dmd. Did you move the makefile? you should be calling: D:\D\dmd2\src\dmd\src>make -fwin32.mak release
 cd cppunit-1.12.1\src\cppunit
 --- errorlevel 1

 --- errorlevel 1

 What's wrong? o.O
Because you are in the worng dir the cd fails.
Jan 01 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
The path is D:\D\dmd2\src\dmd, there is the make file.
But I did not move anything. I'm using windows.
Jan 01 2013
parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday, January 01, 2013 23:10:15 Namespace wrote:
 The path is D:\D\dmd2\src\dmd, there is the make file.
 But I did not move anything. I'm using windows.
It looks like you're trying to build dmd from where it's installed rather from the repo. I have no idea if that even works. AFAIK, no one does that. So, even if it's supposed to work, most of us will have no more of a clue what to do about it than you will. Sorting it out would require understanding the makefile that's there. If you want to build dmd, grab it from the repo, and build it from its src directory. Either that or use DVM: https://github.com/jacob-carlborg/dvm - Jonathan M Davis
Jan 01 2013
parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
On Wednesday, 2 January 2013 at 00:20:55 UTC, Jonathan M Davis 
wrote:
 On Tuesday, January 01, 2013 23:10:15 Namespace wrote:
 The path is D:\D\dmd2\src\dmd, there is the make file.
 But I did not move anything. I'm using windows.
It looks like you're trying to build dmd from where it's installed rather from the repo. I have no idea if that even works. AFAIK, no one does that. So, even if it's supposed to work, most of us will have no more of a clue what to do about it than you will. Sorting it out would require understanding the makefile that's there. If you want to build dmd, grab it from the repo, and build it from its src directory. Either that or use DVM: https://github.com/jacob-carlborg/dvm - Jonathan M Davis
Namespace: OK: That explains it then. Anyways, if you want to rebuild the packaged dmd, it is possible. There's just a little bug in the "clean" target, because it tries to cd into a folder that doesn't exist. Comment around the lines 300-301 in the clean target: 294 clean: 295 $(DEL) *.obj 296 $(DEL) total.sym 297 $(DEL) msgs.h msgs.c 298 $(DEL) elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c 299 $(DEL) impcnvtab.c And it should work. Again, don't forget to copy the generated .exe's. That said, there is very little point to rebuilding the packaged dmd (AFAIK). The "poor man's" or "easy way" to build the entire DMD chain from source is to keep DMD 2.060 files, but delete the src/* directory. Then, you copy the sources from git, and re-compile with that. Doing it that way is easier, because it pre-writes your sc.init, it has a lot of libs and tools pre-generated etc. BTW: http://wiki.dlang.org/Building_DMD
Jan 02 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
Hey, me again.
I cloned dmd from git head and try to build it with: make 
-fwin32.mak release
But I get these errors:

dmc -c -Ibackend;tk  -DMARS -cpp -D -g -DUNITTEST -e -wx 
-DDM_TARGET_CPU_X86=1 -
I. backend\cgelem
         elerr,
              ^
elxxx.c(3) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         eladd,
              ^
elxxx.c(4) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         elmin,
              ^
elxxx.c(5) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         elmul,
              ^
elxxx.c(6) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         eldiv,
              ^
elxxx.c(7) : Error: need explicit cast to convert
Fatal error: too many errors
--- errorlevel 1

--- errorlevel 1

--- errorlevel 1

I see them for the first time, so can someone explain me what is 
going on there? o.O
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
Hm, has really no one an idea what's wrong? I'm followed strict 
the steps that are described in the wiki.
Jan 22 2013
parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
 Hm, has really no one an idea what's wrong? I'm followed strict 
 the steps that are described in the wiki.
Do you have the latest github dmd? Could just be that you pulled the code at the exact moment it wasn't compiling.
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 22 January 2013 at 14:58:50 UTC, monarch_dodra wrote:
 On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
 Hm, has really no one an idea what's wrong? I'm followed 
 strict the steps that are described in the wiki.
Do you have the latest github dmd? Could just be that you pulled the code at the exact moment it wasn't compiling.
Yes, I pulled several times and dmd is last updated before 6 hours. So I don't believe that I catched this moment.
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 22 January 2013 at 15:10:14 UTC, Namespace wrote:
 On Tuesday, 22 January 2013 at 14:58:50 UTC, monarch_dodra 
 wrote:
 On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
 Hm, has really no one an idea what's wrong? I'm followed 
 strict the steps that are described in the wiki.
Do you have the latest github dmd? Could just be that you pulled the code at the exact moment it wasn't compiling.
Yes, I pulled several times and dmd is last updated before 6 hours. So I don't believe that I catched this moment.
I have cloned again, but the error is still there.
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
Maybe I should describe _exactly_ what I did to earn help.
I make a new directory with:
mkdir d
then I wrote
git clone git://github.com/D-Programming-Language/dmd.git
git clone git://github.com/D-Programming-Language/druntime.git
git clone git://github.com/D-Programming-Language/phobos.git
dir
and get the following directory structure:
dmd
druntime
phobos

I changed to dmd/src (where all files are, also win32.mak) and 
wrote:
make -fwin32.mak clean
and then
make -fwin32.mak release (I tried also -release)
It runs a few seconds and generates these executables:
idgen.exe
impcnvgen.exe
optabgen.exe
vergen.exe
but I get still these errors:
[code]
dmc -c -Ibackend;tk  -DMARS -cpp -D -g -DUNITTEST -e -wx 
-DDM_TARGET_CPU_X86=1 -
I. backend\cgelem
         elerr,
              ^
elxxx.c(3) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         eladd,
              ^
elxxx.c(4) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         elmin,
              ^
elxxx.c(5) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         elmul,
              ^
elxxx.c(6) : Error: need explicit cast to convert
from: elem*(*C func)(elem*,unsigned )
to  : elem*(*C func)(elem*)
         eldiv,
              ^
elxxx.c(7) : Error: need explicit cast to convert
Fatal error: too many errors
--- errorlevel 1

--- errorlevel 1

--- errorlevel 1
[/code]

So what is wrong now? A few days ago it works fine. I don't 
understand that. :/
Jan 22 2013
parent reply "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 22 January 2013 at 20:47:46 UTC, Namespace wrote:
 So what is wrong now? A few days ago it works fine. I don't 
 understand that. :/
Strange. That's what I do (verbatim), so it should work. Which "make" is being called? What is your DMC? Could you try it with *only* "X/dm/bin" in you path? It know it should work with 8.56, that's the one I use. http://www.digitalmars.com/download/freecompiler.html
Jan 22 2013
next sibling parent reply Philippe Sigaud <philippe.sigaud gmail.com> writes:
FWIW, my own rebuilding of DMD fails since yesterday. I does a GCC
error from json.c and then dies.
Jan 22 2013
parent "monarch_dodra" <monarchdodra gmail.com> writes:
No idea.

Just updated my own dmd sources.

I rebuilt it fine with both dmc 852c and 856c, in both release 
non-release :/
Jan 22 2013
prev sibling parent reply "Namespace" <rswhite4 googlemail.com> writes:
dmc prints before
Digital Mars Compiler Version 8.42n
and also after I replaced it with your version.
Have I forget something?

And still the same error. That weird. oO
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 22 January 2013 at 21:35:48 UTC, Namespace wrote:
 dmc prints before
 Digital Mars Compiler Version 8.42n
 and also after I replaced it with your version.
 Have I forget something?

 And still the same error. That weird. oO
Ah, I forgot, sorry. I'm using: Digital Mars Make Version 5.06
Jan 22 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
In my distress I have now tried with dmd_msc_vs10.
I get no such error but others:

1>cl : Befehlszeile warning D9025: "/TC" wird durch "/TP" 
überschrieben
1>mars.c(905): warning C4805: '!=': unsichere Kombination von Typ 
'char' mit Typ 'bool' in einer Operation
1>c1xx : fatal error C1083: Datei (Quelle) kann nicht geöffnet 
werden: "ph.c": No such file or directory
1>c1xx : fatal error C1083: Datei (Quelle) kann nicht geöffnet 
werden: "util.c": No such file or directory

I didn't tried dmd_msc_vs10 before, so I have no comparison.
Jan 22 2013
parent "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 22 January 2013 at 22:15:13 UTC, Namespace wrote:
 In my distress I have now tried with dmd_msc_vs10.
 I get no such error but others:

 1>cl : Befehlszeile warning D9025: "/TC" wird durch "/TP" 
 überschrieben
 1>mars.c(905): warning C4805: '!=': unsichere Kombination von 
 Typ 'char' mit Typ 'bool' in einer Operation
 1>c1xx : fatal error C1083: Datei (Quelle) kann nicht geöffnet 
 werden: "ph.c": No such file or directory
 1>c1xx : fatal error C1083: Datei (Quelle) kann nicht geöffnet 
 werden: "util.c": No such file or directory

 I didn't tried dmd_msc_vs10 before, so I have no comparison.
Strange but interest: If I build with Visual Studio I get the error messages above. But when I try then make -fwin32.mak it works without errors and I get a dmd.exe. Could someone explain me this? o.O
Jan 22 2013
prev sibling parent "monarch_dodra" <monarchdodra gmail.com> writes:
On Sunday, 23 December 2012 at 23:33:34 UTC, Namespace wrote:
 On Sunday, 23 December 2012 at 23:01:37 UTC, Andrej Mitrovic 
 wrote:
 On 12/23/12, Namespace <rswhite4 googlemail.com> wrote:
 Is that my fault? :o
 Is there any official manual for building dmd, druntime and
 phobos?
You're probably building druntime 2.061 with dmd 2.060. First you need to build dmd git-head, then druntime (*with* the newly built DMD), then phobos. There are some guides written here, see if that helps: http://wiki.dlang.org/Building_DMD or http://wiki.dlang.org/Using_Git_on_Windows
Yeah that was my fault. Thanks a lot. And thanks Jonathan M Davis for your detailed answer. Is it possible, that, even if I use " -release", dmd is build in debug mode (on windows)?
Remember after building dmd.exe, to copy it in your path(usually,*\dmd2\windows\bin), or else you'll be using your old dmd.exe
Dec 24 2012
prev sibling next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Sunday, December 23, 2012 23:53:16 Namespace wrote:
 I tried to fork and build dmd, druntime and phobos. With dmd it
 works fine but if I try "make -f win32.mak" on druntime I get:
 [code]
 src\core\sys\windows\windows.d(81): Warning: else is dangling,
 add { } after con
 dition at src\core\sys\windows\windows.d(17)
 src\core\sys\windows\windows.d(164): Warning: else is dangling,
 add { } after co
 ndition at src\core\sys\windows\windows.d(17)
 src\core\sys\windows\windows.d(1286): Warning: else is dangling,
 add { } after c
 ondition at src\core\sys\windows\windows.d(17)
 src\rt\arraycast.d(33): Error: object.Error is thrown but not
 caught
 src\rt\arraycast.d(26): Error: function rt.arraycast._d_arraycast
 '_d_arraycast'
   is nothrow yet may throw
 src\rt\arraycat.d(36): Error: object.Error is thrown but not
 caught
 src\rt\arraycat.d(45): Error: object.Error is thrown but not
 caught
 src\rt\arraycat.d(25): Error: function rt.arraycat._d_arraycopy
 '_d_arraycopy' i
 s nothrow yet may throw
 [/code]
 
 Is that my fault? :o
 Is there any official manual for building dmd, druntime and
 phobos?
You need to build the current versions of druntime and Phobos with the current version of dmd, and you need to build the current version of Phobos with the current version of druntime. Mixing and matching versions will inevitably result in compilation errors. I'm sure that someone has instructions for it somewhere, but I don't know where. This page on the wiki explains some but not enough: http://wiki.dlang.org/Pull_Requests I'd expect fuller instructions to end up on the wiki at some point though. I wrote this up a while ago, but I don't know if it needs any tweaking at this point or not.: -------------------- * Download dmc from dlang.org. Unzip it in C:\ * Download dmd from dlang.org. Unzip it in C:\ * Add this to your path: C:\dm\bin;C:\dmd2\windows\bin * Download libcurl from dlang.org. Unzip it in C:\ so that the files in its dmd2 directory go in C:\dmd2 * Build a test program to make sure that dmd works properly. * Create a directory to hold your git repositories. (I'm assuming C:\github) * Setup your dmd, druntime, and phobos repositories in C:\github per the instructions on github for setting up repositories * Change C:\dmd2\windows\bin\sc.ini to this: ------------- [Version] version=7.51 Build 020 [Environment] LIB="c:\github\druntime\lib";"c:\github\phobos\";"c:\dmd2\windows\lib";c: \dm\lib DFLAGS="-Ic:\github\phobos\";"c:\github\druntime\import" LINKCMD=% P%\link.exe ------------- * Go to C:\github\dmd\src and run make -f win32.mak clean make -f win32.mak Make sure that you run a clean for every build of dmd. It's makefiles don't always work correctly when you do partial builds. * Copy C:\github\dmd\src\dmd.exe to C:\dmd2\windows\bin * Run dmd without any arguments and check its version number to make sure that it's one greater than the latest release. * Go to C:\github\druntime and run make -f win32.mak clean make -f win32.mak You may see errors from the clean about files which didn't exist. They happen because the makefile is trying to delete stuff that won't exist until you've run a build. * Go to C:\github\phobos and run make -f win32.mak clean make -f win32.mak * dmd should now work properly with the latest druntime and Phobos. * If you wish to run the unit tests for either druntime or Phobos, then go to that repository and run make -f win32.mak clean make -f win32.mak unittest make -f win32.mak unittest.exe If you build druntime's unit tests, make sure that you build it normally again afterwards, or your druntime may not be setup correctly for normal usage. -------------------- Since I wrote it primarily for myself, it may make assumptions about how you want to set things up that aren't necessary (e.g. using C:\github), and there may be ways to do things better. But it should at least help you along. - Jonathan M Davis
Dec 23 2012
prev sibling parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 12/23/2012 02:53 PM, Namespace wrote:
 I tried to fork and build dmd, druntime and phobos.
There is also the following project by Nathan M. Swan: http://forum.dlang.org/thread/ygwzndxbwzrxzlhuooty forum.dlang.org It worked flawlessly for me. Ali
Dec 23 2012