FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trouble building DDMD on windows

 
Post new topic   Reply to topic     Forum Index -> ddmd
View previous topic :: View next topic  
Author Message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Fri Sep 17, 2010 12:26 am    Post subject: Trouble building DDMD on windows Reply with quote

I'm trying to follow the instructions here, but having some problems:
http://www.dsource.org/projects/ddmd/wiki/BuildInstructions/Windows

(Currently I have DMC and DMD 2.048 on the path, GNU patch installed, and I got DDMD b7b61140701d via Mercurial. And I also have the DMD 2.039 sources available.)

First of all, it says to "copy win32_lib.mak" Aside from that not being clear, I don't have anything by that name anywhere in the DMD or DDMD sources.

I proceeded anyway to "patch < dmdpatch.patch" on the DMD 2.039 sources (from the parent directory of "src", ie from the directory with "license.txt" and "README.TXT"), and it's giving me loads of problems:

========================
can't find file to patch at input line 11
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|# HG changeset patch
|# User trass3r
|# Date 1284418540 -7200
|# Node ID a4ec24e030fdda493d8d1249ef966e0beed13e1e
|# Parent 0ebf1721e4d32cfb38376c6688a767627aa63758
|t
|
|diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/class.c
|--- a/src/dmd/class.c Mon Sep 13 15:46:31 2010 +0200
|+++ b/src/dmd/class.c Tue Sep 14 00:55:40 2010 +0200
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 23
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|f1721e4d3 -r a4ec24e030fd src/dmd/dsymbol.c
|--- a/src/dmd/dsymbol.c Mon Sep 13 15:46:31 2010 +0200
|+++ b/src/dmd/dsymbol.c Tue Sep 14 00:55:40 2010 +0200
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 35
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
| -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/expression.c
|--- a/src/dmd/expression.c Mon Sep 13 15:46:31 2010 +0200
|+++ b/src/dmd/expression.c Tue Sep 14 00:55:40 2010 +0200
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 47
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
| -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/idgen.c
|--- a/src/dmd/idgen.c Mon Sep 13 15:46:31 2010 +0200
|+++ b/src/dmd/idgen.c Tue Sep 14 00:55:40 2010 +0200
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 61
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|
| { "tupleof" },
|diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/mtype.c
|--- a/src/dmd/mtype.c Mon Sep 13 15:46:31 2010 +0200
|+++ b/src/dmd/mtype.c Tue Sep 14 00:55:40 2010 +0200
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
missing header for unified diff at line 72 of patch
can't find file to patch at input line 72
Perhaps you should have used the -p or --strip option?
File to patch:
Skip this patch? [y]
Skipping patch.
missing header for unified diff at line 74 of patch
can't find file to patch at input line 74
Perhaps you should have used the -p or --strip option?
File to patch:
Skip this patch? [y]
Skipping patch.
missing header for unified diff at line 76 of patch
can't find file to patch at input line 76
Perhaps you should have used the -p or --strip option?
File to patch:
Skip this patch? [y]
Skipping patch.
missing header for unified diff at line 78 of patch
can't find file to patch at input line 78
Perhaps you should have used the -p or --strip option?
========================

That's not the entire thing, there's more...Much more...In fact the logfile I was piping the errors to reached 45MB before I killed the process.

Also, I don't know if this matters, but before I found the page with the Windows build instructions, I tried just running "build.bat" and got this error:

dmd\expression\Util.d(195): Error: is has no effect in expression (*pf is cast(FuncDeclaration)null)

I went back to the latest DDMD revision that didn't have that problem ( a43c65469219 ) and got some fatal warnings. So I went into commands.txt, removed the -w flag, and got a whole bunch of errors (I can do it again and post the results here if anyone wants.)

So, I kinda got tired of taking stabs in the dark and thought I'd check here.
Back to top
View user's profile Send private message
korDen



Joined: 12 Mar 2008
Posts: 11

PostPosted: Fri Sep 17, 2010 1:06 am    Post subject: Reply with quote

win32_lib.mak was recently replaced with a patch to win32.mak

I'm not a patch guru, but I found the following to work for me:
# patch -p1 < dmdpatch.patch

I'll look into other issues. It shouldn't cause any build errors of course.
Back to top
View user's profile Send private message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Fri Sep 17, 2010 2:13 am    Post subject: Reply with quote

Hmm, with that I just get an internal assertion failure from the patch program itself. The latest version of GNU patch I've found for windows is 2.5.9 which is what I already have. What version of patch do you have?

I'll see if I can find another way of applying a patch.

EDIT: Aha! This applied the patch successfully for me:
patch -p1 --binary < dmdpatch.patch
Back to top
View user's profile Send private message
korDen



Joined: 12 Mar 2008
Posts: 11

PostPosted: Fri Sep 17, 2010 4:37 am    Post subject: Reply with quote

Thanks for the info! I'll add it to the wiki.

Any other issues you came across?
Back to top
View user's profile Send private message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Fri Sep 17, 2010 4:40 am    Post subject: Reply with quote

Ok, this is where I am now:

I've compiled the patched DMD 2.039's phobos and druntime with:
make -fwin32.mak

...from their respective directories. And I compiled dmd.lib with:
make lib -fwin32.mak

And then I copied the newly-created dmd.lib, druntime.lib and phobos.lib to the main ddmd directory. Then I ran build.bat and got this:

==============================
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
D:\DevTool\dmd\bin\..\lib\SNN.lib(u64_ldbl) Offset FFE74H Record Type 0091
Error 1: Previous Definition Different : ___LDBLULLNG
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined __d_assertm
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined __moduleTlsCtor
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined __moduleTlsDtor
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D6object8opEqualsFC6ObjectC6ObjectZb
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D3std5stdio4File17LockingTextWriter8__cpctorMFKS3std5stdio4File17LockingTextWriterZv
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D3std9exception7bailOutFAyaixAaZv
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D3std9exception14ErrnoException7__ClassZ
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D3std9exception14ErrnoException6__ctorMFAyaAyakZC3std9exception14ErrnoException
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D3std9exception12__ModuleInfoZ
bin\ddmd.obj(ddmd)
Error 42: Symbol Undefined _D6object6Object8opEqualsMFC6ObjectC6ObjectZb
--- errorlevel 11
==============================

It's late and I can't think straight anymore, so maybe that'll make more sense to me later on after some sleep...
Back to top
View user's profile Send private message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Fri Sep 17, 2010 4:48 am    Post subject: Reply with quote

Oh, also I should mention that I ended up going back to the slightly older DDMD revision a43c65469219 because the lastest revision is still giving me that one compiler error in dmd\expression\Util.d(195).
Back to top
View user's profile Send private message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Fri Sep 17, 2010 5:31 am    Post subject: Reply with quote

Ok, I have it successfully building the debug version of ddmd now.

I realized I had changed something in one of my attempts to get it to build and didn't change it back, so I stared again from scratch, eliminated druntime.lib and phobos.lib (I couldn't get them to compile this time anyway), and compiled the debug version of dmd.lib with:

make deblib -fwin32.mak

That got it building ddmd in debug mode. When it tried to rebuild in release mode I got "Internal error: ..\ztc\blockopt.c 619", but I'm not particularly concerned about that right now.

Later on when I can think straight again I'll post a detailed from-scratch step-by-step of what I ended up needing to do.
Back to top
View user's profile Send private message
korDen



Joined: 12 Mar 2008
Posts: 11

PostPosted: Fri Sep 17, 2010 12:59 pm    Post subject: Reply with quote

You did it right, copying druntime/phobos is unnecessary. Only debug build is supposed at this moment (debug/release versions have some nasty #ifdef differences, mostly in backend) but we will look into supporting release in future, too, of course.
Back to top
View user's profile Send private message
korDen



Joined: 12 Mar 2008
Posts: 11

PostPosted: Sat Sep 18, 2010 8:40 pm    Post subject: Reply with quote

I've looked into the errors you got. It was a bad commit, I'm working on fixing the issues now. Sorry for inconvenience.

Edit: done.
Back to top
View user's profile Send private message
Abscissa



Joined: 23 Feb 2005
Posts: 40
Location: Cleveland, OH, US

PostPosted: Sun Sep 19, 2010 12:43 am    Post subject: Reply with quote

I've updated this page with the steps I had to take:

http://www.dsource.org/projects/ddmd/wiki/BuildInstructions/Windows
Back to top
View user's profile Send private message
korDen



Joined: 12 Mar 2008
Posts: 11

PostPosted: Sun Sep 19, 2010 4:54 am    Post subject: Reply with quote

Great, thanks! I think there is no more need in making mars.c copy and renaming main, the patch should take care of it. I'm not sure though.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ddmd All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group