Cannot build dmd due to sc.ini issue
I decided to wipe my dmd directory (too messy), and replaced it with the latest one (http://downloads.dlang.org/releases/2.x/2.067.1/dmd.2.067.1.windows.zip). After that, I adjusted the bin directory, and sc.ini as well:; environment for both 32/64 bit [Environment] DFLAGS=-I%@P%\..\src\phobos -I%@P%\..\src\druntime\import FYI, my dmd root directory is C:\dmd. All of my D code examples can be compiled successfully. No problem so far. Now the problem is compiling the D compiler itself. Running make -f win32.mak release gives: make -fwin32.mak C=backend TK=tk ROOT=root HOST_DC=dmd reldmd make -fwin32.mak C=backend TK=tk ROOT=root HOST_DC=dmd OPT=-o DEBUG= DDEBUG= DOPT=-inline -O LFLAGS=-L/delexe/la dmd.exe dmd -run idgen Error: cannot find source code for runtime library file 'object.d' dmd might not be correctly installed. Run 'dmd -man' for installation instructions. config file: C:\Users\CSL-NB-064\Downloads\Software\d-lang\d-git\dmd\src\sc.ini Specify path to file 'object.d' with -I switch Indeed there's no sc.ini on that directory. But there's one in C:\dmd\bin. Why can't dmd find that file?
What exactly module in D means?
I've been reading the newsgroup for a while, and it seems that one of the reason folks like D is because it supports module. My question is: what does module mean? A quick google pointed my this page: http://dlang.org/module.html. Still cannot understand it, though :) How does it differ from the old C's #include? For example, consider the hello world in C. #include stdio.h int main(void){ printf(%s\n, Hello world...); return 0; } The C preprocessor while replace the line #include stdio.h with the content of stdio.h itself. While in D: import std.stdio; void main(){ writeln(Hello world...); } Does that mean the compiler take the definition of writeln itself from stdio.d and paste it into my program? Pardon my ignorance, because I'm not versed in compiler theory.
Re: Just me? Compiling chmgen head on DMD master vs 2.063.2
On Friday, 30 August 2013 at 01:00:47 UTC, Nick Sabalausky wrote: Can anyone see whether or not they're able to reproduce this, because I'm not sure if it's some weird bug or just something wrong on my system: Hi Nick, http://d.puremagic.com/issues/show_bug.cgi?id=10729 Maybe we're facing the same issue?
Re: Cannot build ws2_32.lib
Actually I just solved the problem, by copying all the libs from dmd.2.0.59.zip into C:\dm\lib\ And this is my sc.ini: [Environment] LIB=C:\dmd\lib DFLAGS=-IC:\dmd\import -IC:\dmd\phobos LINKCMD=link.exe On 8/3/2012 12:31 AM, Regan Heath wrote: Have you downloaded and extracted a normal dmd 2.0 installation/zip? If so, you should have: some path\dmd2\windows\lib\ws2_32.lib and your some path\dmd2\windows\bin\sc.ini
Cannot build ws2_32.lib
I found this code from this page: http://rosettacode.org/wiki/Category:D import std.stdio, std.socket; void main(){ writefln(%s, Socket.hostName()); } When I tried to build it (I'm on Windows, anyway), I got this: C:\Users\CSL-NB-064\Codes\Ddmd hostname.d OPTLINK (R) for Win32 Release 8.00.5 Copyright (C) Digital Mars 1989-2009 All rights reserved. http://www.digitalmars.com/ctg/optlink.html ws2_32.lib Warning 2: File Not Found ws2_32.lib C:\dmd\lib\phobos.lib(socket) Error 42: Symbol Undefined _WSAIoctl@36 --- errorlevel 1 I did some Googling, and I found this http://www.digitalmars.com/d/archives/c++/2519.html. It looked interesting because MinGW, instead of DMC was used. So I downloaded Jan Knepper's implib, and extracted it into C:\dm\bin. This is my implib.ini: http://pastebin.com/iusxakcj The next part is to build ws2_32.lib I copied ws2_32.dll from C:\Windows\System32 into C:\dmd\lib, and ran this command: C:\dm\libimplib /v /system /IC:\mingw\include /suffix ws2_32.dll ws2_32.dll The output was: Digital Mars Import Library Manager Version 7.5B4n Copyright (C) Digital Mars 1999-2002. All Rights Reserved. Modified by Jan Knepper Include Path : 'C:\mingw\include' Suffix::Include ( C:\mingw\include ) ws2_32.dll Input is a Windows NT DLL file 'WS2_32.dll'. cpp.exe: error: unrecognized command line option '-EL' cpp.exe: error: unrecognized command line option '-EL' cpp.exe: error: unrecognized command line option '-EL' cpp.exe: error: unrecognized command line option '-EL' cpp.exe: error: unrecognized command line option '-EL' Output is a Windows NT import library. Digital Mars Import Library Creator complete. Then I tried to compile once again, and the same error still happened. Is there an easier way to get the importants libs?
Re: Cannot build ws2_32.lib
I just remembered that the official dmd build has those libs. So I grab them and put them into C:\dmd\lib. Still, the same error still happens. Maybe because I build dmd, druntime, and phobos from git? On 8/2/2012 10:59 PM, Andre Tampubolon wrote: When I tried to build it (I'm on Windows, anyway), I got this: C:\Users\CSL-NB-064\Codes\Ddmd hostname.d OPTLINK (R) for Win32 Release 8.00.5 Copyright (C) Digital Mars 1989-2009 All rights reserved. http://www.digitalmars.com/ctg/optlink.html ws2_32.lib Warning 2: File Not Found ws2_32.lib C:\dmd\lib\phobos.lib(socket) Error 42: Symbol Undefined _WSAIoctl@36 --- errorlevel 1
Re: Detector for unused variables
The Go compiler is able to detect unused variables, and strangely they are regarded as an error. On 8/1/2012 5:38 PM, bearophile wrote: Detecting unused variables is a core feature, it belongs in the compiler, like compile-time array bound tests and other errors currently detected by DMD. This allows everyone to use it with minimum work, so everyone enjoys it, and it requires less work to be implemented because the compiler already does lot of analysis. Bye, bearophile
Re: [OT] Windows users: Are you happy with git?
Me too. BTW, I heard that mercurial has better Windows support. On 5/31/2012 6:09 PM, Don Clugston wrote: I still can't avoid the feeling that if you're on Windows, you're a second-class citizen in the git world.
Re: [OT] Windows users: Are you happy with git?
On Windows, I use msysgit http://code.google.com/p/msysgit/ Somehow it's slower than the Linux counterpart, but I guess it works pretty well. On 5/18/2012 2:58 PM, Lars T. Kyllingstad wrote: I remember back when we were considering whether to move DMD, Phobos and druntime from SVN on DSource to Git on GitHub, there were some concerns about using Git on Windows. People claimed that Git was a very Linux-centric tool, and that Windows support was buggy at best. Still, we made the switch, and I haven't really registered that many complaints since. So now I'm curious: Windows users, have you just resigned, or did Git actually turn out to work well on Windows? Specifically, is it usable from the CMD command line, and are graphical front-ends such as TortoiseGit any good? (I know running it through Cygwin works well, but that doesn't count.) -Lars
Re: Can't run 'masm386'
minit.obj is still there. I commented this part: src\rt\minit.obj : src\rt\minit.asm $(CC) -c $(CFLAGS) src\rt\minit.asm That works. On 5/17/2012 11:35 AM, Nick Sabalausky wrote: Andre Tampubolon an...@lc.vlsm.org wrote in message news:jp1kld$15mj$1...@digitalmars.com... I was trying to build druntime. I got this error: dmd -c -d -o- -Isrc -Iimport -Hfimport\core\sys\windows\windows.di src\core\sys\windows\windows.d dmc -c src\core\stdc\errno.c -oerrno_c.obj dmc -c src\rt\complex.c dmc -c src\rt\minit.asm masm386 -DM_I386=1 -D_WIN32 -Mx src\rt\minit.asm; Can't run 'masm386', check PATH masm386 -DM_I386=1 -D_WIN32 -Mx src\rt\minit.asm; Can't run 'masm386', check PATH Error: 'dmc' not found Strange. This thing never happened before. I've hit that before. Druntime comes with minit.obj already compiled. Apperently, minit.asm isn't expected to change, so it's not expected that minit.obj will need to be rebuilt. At least that's what I was told. So what must have happened is the same as what happened to me: The timestamp on minit.asm was updated (or the file was inadvertantly changed). Or maybe minit.obj accidentally got deleted. Either way, make thinks minit needs to be rebuilt (which is not normally expected of minit), so it tries to, and it can't find masm386 (which doesn't come with DMD or DMC), so the error. So just: 1. Check that minit.obj still exists, and if not, grab it again. 2. Make sure the timestamp on minit.asm isn't newer than minit.obj 3. Make sure minit.asm didn't get changed.
Do not write object file?
Every time I compile a D code, an .obj file is generated. Is there any to prevent that? I tried dmd -o- hello.d. Indeed there's no obj file. And no executable, too. Maybe this is a bug?
Re: Do not write object file?
Actually what I mean is once the compilation is done, the object file will be automatically removed. So I guess this is my misunderstanding of dmd -o-. No problem, then. On 5/17/2012 6:09 PM, Aleksandar Ružičić aleksan...@ruzicic.info wrote: On Thursday, 17 May 2012 at 10:16:38 UTC, Andre Tampubolon wrote: Every time I compile a D code, an .obj file is generated. Is there any to prevent that? I tried dmd -o- hello.d. Indeed there's no obj file. And no executable, too. Maybe this is a bug? If you don't want object files to be generated (actually they must be generated in order for linker to build exe) compile with rdmd (it will put object files in a temp directory so your project folder is kept clean): rdmd --build-only (dmd parameter here) main.d also rdmd will take care of your dependencies so you just have to pass it your main file.
Can't run 'masm386'
I was trying to build druntime. I got this error: dmd -c -d -o- -Isrc -Iimport -Hfimport\core\sys\windows\windows.di src\core\sys\windows\windows.d dmc -c src\core\stdc\errno.c -oerrno_c.obj dmc -c src\rt\complex.c dmc -c src\rt\minit.asm masm386 -DM_I386=1 -D_WIN32 -Mx src\rt\minit.asm; Can't run 'masm386', check PATH masm386 -DM_I386=1 -D_WIN32 -Mx src\rt\minit.asm; Can't run 'masm386', check PATH Error: 'dmc' not found Strange. This thing never happened before.
Re: Is it possible to build DMD using Windows SDK?
On 4/28/2012 9:01 PM, Rainer Schuetze wrote: On 4/27/2012 7:30 AM, Andre Tampubolon wrote: On 4/27/2012 1:30 AM, Rainer Schuetze wrote: On 4/26/2012 2:40 PM, Andre Tampubolon wrote: Rainer Schuetzer.sagita...@gmx.de wrote: On 4/24/2012 6:43 PM, David Nadlinger wrote: On Tuesday, 24 April 2012 at 13:47:30 UTC, Andre Tampubolon wrote: Any suggestions? In case he doesn't read your message here anyway, you might want to ping Rainer Schuetze directly, as he is the one who worked on VC support. David Unfortunately some changes to the makefile have been reverted, but I don't know why. This is the version that should work: https://github.com/D-Programming-Language/dmd/blob/965d831df554fe14c793ce0d6a1dc9f0b2956911/src/win32.mak But that one is still using dmc, right? I tried to use CC=cl (of course MS' cl), and got a bunch of errors. You should still use vcbuild\builddmd.bat which replaces dmc with dmc_cl, a batch that replaces dmc's options with the respective cl options. Well I used vcbuild\builddmd.bat (see my first post), and it failed. You have to use vcbuild\builddmd.bat with the older win32.mak. I actually tried it and it worked for me a few days ago with the compiler that comes with VS2008. Ah, OK. I guess I messed with the batch files up, and then I tried once again. The compilation worked, but then I got these linker errors. http://pastebin.com/Ech3RNLV
Re: Is it possible to build DMD using Windows SDK?
On 4/27/2012 1:30 AM, Rainer Schuetze wrote: On 4/26/2012 2:40 PM, Andre Tampubolon wrote: Rainer Schuetzer.sagita...@gmx.de wrote: On 4/24/2012 6:43 PM, David Nadlinger wrote: On Tuesday, 24 April 2012 at 13:47:30 UTC, Andre Tampubolon wrote: Any suggestions? In case he doesn't read your message here anyway, you might want to ping Rainer Schuetze directly, as he is the one who worked on VC support. David Unfortunately some changes to the makefile have been reverted, but I don't know why. This is the version that should work: https://github.com/D-Programming-Language/dmd/blob/965d831df554fe14c793ce0d6a1dc9f0b2956911/src/win32.mak But that one is still using dmc, right? I tried to use CC=cl (of course MS' cl), and got a bunch of errors. You should still use vcbuild\builddmd.bat which replaces dmc with dmc_cl, a batch that replaces dmc's options with the respective cl options. Well I used vcbuild\builddmd.bat (see my first post), and it failed.
Re: Is it possible to build DMD using Windows SDK?
Rainer Schuetze r.sagita...@gmx.de wrote: On 4/24/2012 6:43 PM, David Nadlinger wrote: On Tuesday, 24 April 2012 at 13:47:30 UTC, Andre Tampubolon wrote: Any suggestions? In case he doesn't read your message here anyway, you might want to ping Rainer Schuetze directly, as he is the one who worked on VC support. David Unfortunately some changes to the makefile have been reverted, but I don't know why. This is the version that should work: https://github.com/D-Programming-Language/dmd/blob/965d831df554fe14c793ce0d6a1dc9f0b2956911/src/win32.mak But that one is still using dmc, right? I tried to use CC=cl (of course MS' cl), and got a bunch of errors.
Is it possible to build DMD using Windows SDK?
Hi folks, Now I'm using Win 7 64 (for work). It don't have MSVC installed, but Win 7 SDK. I tried to built DMD using it, but failed: C:\Downloads\Software\DigitalMars\d-git\dmd\srcvcbuild\builddmd.bat vcbuild\dmc_cl -c -Iroot;vcbuild /Zi -cpp mars -Ae cl : Command line warning D9026 : options apply to entire command line vcbuild.c c1xx : fatal error C1083: Cannot open source file: 'vcbuild.c': No such file or directory mars.c C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE\winnt.h(480) : warning C400 5: 'TEXT' : macro redefinition c:\downloads\software\digitalmars\d-git\dmd\src\root\dchar.h(148) : see previous definition of 'TEXT' Generating Code... --- errorlevel 2 Any suggestions?
Re: D1, D2, Tango, Phobos, Std, Runtime
On 04/07/2012 07:28 PM, Jacob Carlborg wrote: Tango is fully ported to D2. It has some advantages over Phobos, like a faster XML parser, cryptographic related modules and some other modules that Phobos still doesn't have. Tango is fully ported to D2? Really? You are talking about https://github.com/SiegeLord/Tango-D2, right?
no matching function for call to ‘Type::defaultInitLiteral()’?
I just fetched the latest source code, and when I was trying to build dmd, I got this: func.c: In member function ‘MATCH FuncDeclaration::leastAsSpecialized(FuncDeclaration*)’: func.c:2493:45: error: no matching function for call to ‘Type::defaultInitLiteral()’ func.c:2493:45: note: candidate is: mtype.h:304:25: note: virtual Expression* Type::defaultInitLiteral(Loc) mtype.h:304:25: note: candidate expects 1 argument, 0 provided make: *** [func.o] Error 1 Any help?
Re: no matching function for call to ‘Type::d efaultInitLiteral()’?
kennytm kenn...@gmail.com wrote: Andre Tampubolon an...@lc.vlsm.org wrote: I just fetched the latest source code, and when I was trying to build dmd, I got this: func.c: In member function ‘MATCH FuncDeclaration::leastAsSpecialized(FuncDeclaration*)’: func.c:2493:45: error: no matching function for call to ‘Type::defaultInitLiteral()’ func.c:2493:45: note: candidate is: mtype.h:304:25: note: virtual Expression* Type::defaultInitLiteral(Loc) mtype.h:304:25: note: candidate expects 1 argument, 0 provided make: *** [func.o] Error 1 Any help? Modify func.c as described in https://github.com/D-Programming-Language/dmd/commit/907c94d#diff-2 Hopefully this will be fixed by tonight. Ah yes, it has been fixed already.
-m64 doesn't work?
When I was looking at dmd's options, I found this: m64 generate 64 bit code I guessed it behaves like gcc (m64 for 64 bit code and m32 for 32 bit code, assuming you have the multilibs), so I did a rebuild. This is the structure of my /opt/dmd-dev |-bin (64-bit version of dmd, impcnvgen, idgen, optabgen, plus dmd.conf) |-import |---core |-stdc |-sync |-sys |---osx |-mach |---posix |-arpa |-net |-netinet |-sys |---windows |-lib32 (libdruntime-linux32.a and libphobos.a) |-lib64 (libdruntime-linux64.a and libphobos.a) |-phobos |---std |-c |---freebsd |---linux |---osx |---windows |-internal |---math |---windows |-net |-windows And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64 dmd -32 works fine. But either dmd or dmd -m64 doesn't work, e.g: $ dmd -m64 einstein2b.d /usr/bin/ld: skipping incompatible /opt/dmd-dev/lib32//libphobos2.a when searching for -lphobos2 /usr/bin/ld: cannot find -lphobos2 collect2: ld returned 1 exit status --- errorlevel 1 I wonder why ld searches at /opt/dmd-dev/lib32, whereas it should be /opt/dmd-dev/lib64 ?
Re: -m64 doesn't work?
Uhmm OK. But what does it do with dmd? I mean, dmd -m64 still doesn't work. Anyway, I used to build both versions and put this on my ~/.bashrc: alias dmd32='/opt/dmd-dev/bin32/dmd' alias dmd64='/opt/dmd-dev/bin64/dmd' But if a single dmd can generate both 32 and 64 bit code, it will be very convenient. On 02/12/2012 06:58 PM, Trass3r wrote: |-bin (64-bit version of dmd, impcnvgen, idgen, optabgen, plus dmd.conf) ^^ You don't need impcnvgen, idgen and optabgen.
Re: -m64 doesn't work?
Hmm doesn't work. The same error still applies. On 02/12/2012 08:36 PM, Mike Wey wrote: On 02/12/2012 09:26 AM, Andre Tampubolon wrote: And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64 Try adding -L--no-warn-search-mismatch
Re: -m64 doesn't work?
This is the log: http://pastebin.com/bGt7MVd2 Anyway, I found the culprit, which is ~/dmd.conf. The content is: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32/ That's why dmd couldn't locate the 64 bit libs. I should use only 1 dmd.conf, which is located in /opt/dmd-dev/bin. Now -m64 works fine :) On 02/12/2012 09:45 PM, Mike Wey wrote: On 02/12/2012 03:21 PM, Andre Tampubolon wrote: Hmm doesn't work. The same error still applies. On 02/12/2012 08:36 PM, Mike Wey wrote: On 02/12/2012 09:26 AM, Andre Tampubolon wrote: And this is my dmd.conf: [Environment] DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 -L-L/opt/dmd-dev/lib64 Try adding -L--no-warn-search-mismatch Can you post the output of dmd when compiling with: -v ?
Re: -m64 doesn't work?
Sorry, libphobos.a is a typo :) On 02/12/2012 09:42 PM, Michel Fortin wrote: On Sunday, 12 February 2012 at 08:26:07 UTC, Andre Tampubolon wrote: |-lib32 (libdruntime-linux32.a and libphobos.a) |-lib64 (libdruntime-linux64.a and libphobos.a) ... Are you sure it's libphobos.a and not libphobos2.a? dmd -32 works fine. But either dmd or dmd -m64 doesn't work, e.g: $ dmd -m64 einstein2b.d /usr/bin/ld: skipping incompatible /opt/dmd-dev/lib32//libphobos2.a when searching for -lphobos2 /usr/bin/ld: cannot find -lphobos2 collect2: ld returned 1 exit status --- errorlevel 1 I wonder why ld searches at /opt/dmd-dev/lib32, whereas it should be /opt/dmd-dev/lib64 ? Actually it searches both directories all the time because dmd.conf adds the two to the link path. The theory is that the linker should just discard the wrong one. -- Michel Fortin michel.for...@michelf.com http://michelf.com
Re: SIMD benchmark
I just built 32 64 bit DMD (latest commit on git tree is f800f6e342e2d9ab1ec9a6275b8239463aa1cee8) Using the 32-bit version, I got this error: Internal error: backend/cg87.c 1702 The 64-bit version went fine. Previously, both 32 and 64 bit version had no problem. On 01/15/2012 01:56 PM, Walter Bright wrote: I get a 2 to 2.5 speedup with the vector instructions on 64 bit Linux. Anyhow, it's good enough now to play around with. Consider it alpha quality. Expect bugs - but make bug reports, as there's a serious lack of source code to test it with. --- import core.simd; void test1a(float[4] a) { } void test1() { float[4] a = 1.2; a[] = a[] * 3 + 7; test1a(a); } void test2a(float4 a) { } void test2() { float4 a = 1.2; a = a * 3 + 7; test2a(a); } import std.stdio; import std.datetime; int main() { test1(); test2(); auto b = comparingBenchmark!(test1, test2, 100); writeln(b.point); return 0; }
Re: SIMD benchmark
Well I only have 1 machine, a laptop running 64 bit Arch Linux. Yesterday I did a git pull, built both 32 64 bit DMD, and this code compiled fine using those. But now, the 32 bit version fails. Walter Bright newshou...@digitalmars.com wrote: On 1/16/2012 12:59 AM, Andre Tampubolon wrote: I just built 32 64 bit DMD (latest commit on git tree is f800f6e342e2d9ab1ec9a6275b8239463aa1cee8) Using the 32-bit version, I got this error: Internal error: backend/cg87.c 1702 The 64-bit version went fine. Previously, both 32 and 64 bit version had no problem. Which machine?
Re: Cannot find libphobos2.a ?
Yes, I already figured it out. I have to specify the full path manually, like this: -L-L/home/anta40/Digital-Mars/dmd-dev/lib64 Previously I used -L-L~/Digital-Mars/dmd-dev/lib64 and this didn't work. On 01/03/2012 11:32 AM, Jesse Phillips wrote: On Tue, 27 Dec 2011 21:29:26 +0700, Andre Tampubolon wrote: I just successfully built dmd, druntime, and phobos from the git tree. Later I tried using this command to build a simple D program, and failed: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/DigitalMars/phobos -L-L~/Digital-Mars/phobos/generated/linux/release/32/lib/libphobos2.a test.d The error is: collect2: ld returned 1 exit status --- errorlevel 1 Yet it's obvious that libphobos2.a is in ~/Digital-Mars/phobos/generated/linux/release/32. But if I didn't use the linker flag, and instead put libphobos2.a in /usr/lib, that command would work. So how to use specify the linker flag correctly? Maybe you are through with this, as your more recent message might suggest. A few more statements from ld would be nice. And be sure dmd is compiling a 32 bit binary (you likely built a 32bit binary so probably not the case).
Re: Incompatible libphobos2.a?
Ah OK. After I built druntime (both for 32 64), dmd works fine. But previously I didn't build druntime, only dmd and phobos, yet it worked (32 only though). I am confused. On 01/03/2012 05:10 PM, mta`chrono wrote: I just built both 32 64 bit DMD. The 32 bit works fine, but the 64 bit not. I always get this: /usr/bin/ld: skipping incompatible /home/anta40/Digital-Mars/dmd-dev/lib64/libphobos2.a when searching for -lphobos2 Did you compile druntime for 64 bit, too? As libphobos2.a is just an archive file, you're able to extract it and check if all containing objs are 64 bit. have a look at the linux file command.
Incompatible libphobos2.a?
I just built both 32 64 bit DMD. The 32 bit works fine, but the 64 bit not. I always get this: /usr/bin/ld: skipping incompatible /home/anta40/Digital-Mars/dmd-dev/lib64/libphobos2.a when searching for -lphobos2 Every time I build 64 bit phobos, I always make sure that it is the 64 bit dmd that is being invoked, and I use this command to build: make -f posix.mak MODEL=64 The strange thing is if I just grab 64 bit libphobos2.a from the official DMD distribution, then it'll go fine.
Cannot find object.d ?
I have 2 dmd.confs, which are in ~/Digital-Mars/dmd/src (the dmd executable also located in here) and /etc/. Both are identical, and the content is: DFLAGS=-I~/Digital-Mars/druntime/import -I~/Digital-Mars/phobos Every time I compile a D program (e.g dmd helloworld.d), I always get this error: object.d: Error: module object is in file 'object.d' which cannot be read Specify path to file 'object.d' with -I switch But when I use this script: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/Digital-Mars/phobos $1 The D program compiled fine. I already take a look at http://www.d-programming-language.org/dmd-linux.html. I guess my dmd.conf should be correct, no?
Re: Cannot find object.d ?
Andre Tampubolon an...@lc.vlsm.org wrote: I have 2 dmd.confs, which are in ~/Digital-Mars/dmd/src (the dmd executable also located in here) and /etc/. Both are identical, and the content is: DFLAGS=-I~/Digital-Mars/druntime/import -I~/Digital-Mars/phobos Every time I compile a D program (e.g dmd helloworld.d), I always get this error: object.d: Error: module object is in file 'object.d' which cannot be read Specify path to file 'object.d' with -I switch But when I use this script: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/Digital-Mars/phobos $1 The D program compiled fine. I already take a look at http://www.d-programming-language.org/dmd-linux.html. I guess my dmd.conf should be correct, no? Ah nevermind. I forgot to put [Environment] in dmd.conf.
Cannot find libphobos2.a ?
I just successfully built dmd, druntime, and phobos from the git tree. Later I tried using this command to build a simple D program, and failed: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/DigitalMars/phobos -L-L~/Digital-Mars/phobos/generated/linux/release/32/lib/libphobos2.a test.d The error is: collect2: ld returned 1 exit status --- errorlevel 1 Yet it's obvious that libphobos2.a is in ~/Digital-Mars/phobos/generated/linux/release/32. But if I didn't use the linker flag, and instead put libphobos2.a in /usr/lib, that command would work. So how to use specify the linker flag correctly?
Re: Cannot find libphobos2.a ?
Sorry, there was a typo. The actuall full path is: ~/Digital-Mars/phobos/generated/linux/release/32/libphobos2.a So I changed to command into: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/Digital-Mars/phobos -L-L~/Digital-Mars/phobos/generated/linux/release/32 test.d And the same error still happens On 12/27/2011 10:08 PM, Lars T. Kyllingstad wrote: On Tue, 27 Dec 2011 21:29:26 +0700, Andre Tampubolon wrote: I just successfully built dmd, druntime, and phobos from the git tree. Later I tried using this command to build a simple D program, and failed: ~/Digital-Mars/dmd/src/dmd -I~/Digital-Mars/druntime/import -I~/DigitalMars/phobos -L-L~/Digital-Mars/phobos/generated/linux/release/32/lib/libphobos2.a test.d The error is: collect2: ld returned 1 exit status --- errorlevel 1 Yet it's obvious that libphobos2.a is in ~/Digital-Mars/phobos/generated/linux/release/32. But if I didn't use the linker flag, and instead put libphobos2.a in /usr/lib, that command would work. So how to use specify the linker flag correctly? I think the -L option should only be used to specify a directory in which to search for libraries, while you put the full path to the library there. DMD already knows it should look for a file named libphobos2.a, so try -L-L~/Digital-Mars/phobos/generated/linux/release/32/lib Lars
Re: Still cannot build Phobos from git
On 27-Jul-11 10:23 PM, Dmitry Olshansky wrote: My recipe on Windows: 1. Get the latest release zip you can find, unzip to some drive root(! otherwise get's trickier) 2. Delete all within src subfolder 3. Get a Git console in \dmd2\src, then the usual: git clone https://github.com/D-Programming-Language/dmd.git git clone https://github.com/D-Programming-Language/druntime.git git clone https://github.com/D-Programming-Language/phobos.git 4. Build dmd cd dmd\src make -f win32.mak release copy dmd.exe ..\..\..\windows\bin cd .. (to build dmd you'd need DMC, also extracted to the same drive root) 5. cd druntime make -f win32.mak 6. cd phobos make -f win32.mak unittest copy phobos.lib ..\..\windows\lib If anywhere of the above it fails to find dmd, make sure dmd2\windows\bin is in your path. That's it, no additional tweaking required. On the PC I'm working now, there were no git installed, so I decided to grab the latest tarballs: D-Programming-Language-dmd-v2.054-211-g1dac08b.tar.gz D-Programming-Language-druntime-v2.054-28-gd14a1a9.tar.gz D-Programming-Language-phobos-v2.054-119-gcd5d266.tar.gz Anyway, these were what I did: 1. Extracted the latest release (dmd.2.054.zip) to C:\dmd2-dev. There were also C:\dmd2, and C:\dm (the Digital Mars C compiler). 2. set PATH=C:\dm\bin 3. cd C:\dmd2-dev\src\dmd. 4. Verified whether DMC worked properly or not, by building DMD: make -f win32.mak release The output was: ... ... 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 It was a success. 5. Deleted all the contents of C:\dmd2-dev\src\dmd, and replaced it with the latest version (from the tarball), and build it again: \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx -I. backend\var \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx backend\el \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx backend\newman Fatal error: unable to open input file 'parser.h' --- errorlevel 1 Hmm unable to open parser.h? I checked C:\dmd2-dev\src\dmd\backend. Yep, no parser.h there (someone forgot to commit it)? So I cleared C:\dmd2-dev\src\dmd\ again. First extracted the original one from the latest release (2.054), then replaced it with the latest from git, and built it again: \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx -I. backend\var \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx backend\el \dm\bin\dmc -c -Ibackend;tk -DMARS -cpp -e -wx backend\newman void ^ backend\parser.h(215) : Error: ';' expected following declaration of struct member --- errorlevel 1 At least the error was different. I did a quick glance on C:\dmd2-dev\src\dmd\backend\parser.h around line 215, and found these lines: TARGET_structBLKLST void print(); What is this TARGET_structBLKLST? -- - Andre Tampubolon -
Still cannot build Phobos from git
I still cannot build Phobos from git properly :( I tried to edit the win32.mak, changed the DFLAGS part into this: DFLAGS=-O -release -nofloat -w -d -I%@P%\..\druntime\src\ -I%@P%\.. druntime\import\ Issuing make -f win32.mak DRUNTIME=\druntime\lib, the output was: dmd -c -O -release -nofloat -w -d -I%@P%\..\druntime\src\ -I%@P%\..\druntime\import etc\c\zlib .d -ofCzlib.obj DMD v2.055 DEBUG object.d: Error: module object is in file 'object.d' which cannot be read import path[0] = %@P%\..\druntime\src\ import path[1] = %@P%\..\druntime\import --- errorlevel 1 Now I'm totally confused. Maybe someone would like to write a tutorial on how to build the latest DMD from git?
Re: Windows GDC and libgcc_s_sjlj-1.dll
-static-libgcc didn't work gdc dhello.d -o dhello -static-libgcc c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh collect2: ld returned 1 exit status :( On 22-Jul-11 5:55 AM, Daniel Green wrote: On 7/21/2011 6:52 PM, Daniel Green wrote: On 7/21/2011 6:44 AM, Kagamin wrote: Andre Tampubolon Wrote: I just tried GDC on Windows, and I found out that the executables created are linked into libgcc_s_sjlj-1.dll. Will it be possible to get rid of the dependency on this DLL? Yes, there's a static version of libgcc, you should play with ld a bit. GCC has a command line option -static. That should remove the dependency. Sorry, -static-libgcc is the option. http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Link-Options.html#Link-Options -- - Andre Tampubolon -
Windows GDC and libgcc_s_sjlj-1.dll
I just tried GDC on Windows, and I found out that the executables created are linked into libgcc_s_sjlj-1.dll. Will it be possible to get rid of the dependency on this DLL?
Re: How to build the druntime (Windows)?
Thanks. Now I managed to succesfully build dmd and druntime. The next is phobos. I got this: make -f win32.mak dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj object.d: Error: module object is in file 'object.d' which cannot be read Specify path to file 'object.d' with -I switch --- errorlevel 1 On 04-Feb-11 6:11 AM, Sean Kelly wrote: Don Wrote: Andre Tampubolon wrote: This is my situation: I put all the git stuffs in C:\dmd-dev. There are 2 subdirectories in it: dmd and druntime I managed to build dmd by make -f win32.mak Trying the same thing for druntime: dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di src\core\dll_helper.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di src\core\exception.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d src\core\thread.d(1601): Error: undefined identifier malloc --- errorlevel 1 Any idea? You're not doing anything wrong. It fails on the autotester as well: http://d.puremagic.com/test-results/index.ghtml This commit broke it: https://github.com/D-Programming-Language/druntime/commit/1449d7bd75c656cb0215d73077549c896c10163f Sorry about that. It should be fixed now. -- - Andre Tampubolon -
Re: How to build the druntime (Windows)?
Well previously phobos and druntime directories were in the same directory. So I move druntime directory into phobos', and the layout looks like this: 04-Feb-11 09:22 PMDIR . 04-Feb-11 09:22 PMDIR .. 04-Feb-11 08:28 AM 3,918 crc32.d 04-Feb-11 09:22 PM 0 dirr.txt 04-Feb-11 03:20 PMDIR druntime 04-Feb-11 08:28 AMDIR etc 04-Feb-11 08:28 AM 8,400 index.d 04-Feb-11 08:28 AM 1,361 LICENSE_1_0.txt 04-Feb-11 08:28 AM 9,523 posix.mak 04-Feb-11 08:28 AMDIR std 04-Feb-11 08:28 AM14,464 std.ddoc 04-Feb-11 08:28 AM 3,498 unittest.d 04-Feb-11 08:28 AM30,394 win32.mak Still fail to build, though... On 04-Feb-11 3:33 PM, Jonathan M Davis wrote: On Friday 04 February 2011 00:23:05 Andre Tampubolon wrote: Thanks. Now I managed to succesfully build dmd and druntime. The next is phobos. I got this: make -f win32.mak dmd -c -O -release -nofloat -w -d etc\c\zlib.d -ofCzlib.obj object.d: Error: module object is in file 'object.d' which cannot be read Specify path to file 'object.d' with -I switch Is druntime one directory below Phobos? That is, are the phobos and druntime directories in the same directory? If not, the phobos build will fail to find druntime - which would include object.d - and then it can't build. - Jonathan M Davis -- - Andre Tampubolon -
How to build the druntime (Windows)?
This is my situation: I put all the git stuffs in C:\dmd-dev. There are 2 subdirectories in it: dmd and druntime I managed to build dmd by make -f win32.mak Trying the same thing for druntime: dmd -c -d -o- -Isrc -Iimport -Hfimport\core\atomic.di src\core\atomic.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\bitop.di src\core\bitop.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\cpuid.di src\core\cpuid.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\demangle.di src\core\demangle.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\dll_helper.di src\core\dll_helper.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\exception.di src\core\exception.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\memory.di src\core\memory.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\runtime.di src\core\runtime.d dmd -c -d -o- -Isrc -Iimport -Hfimport\core\thread.di src\core\thread.d src\core\thread.d(1601): Error: undefined identifier malloc --- errorlevel 1 Any idea? -- - Andre Tampubolon -
Re: Android development using D
But the native code still need the VM to run, right? On 31-Dec-10 7:09 AM, Klaim wrote: Nope. There is a native SDK too. And it have been recently enhanced to allow native-only application (no java). On Thu, Dec 30, 2010 at 15:50, Michel Fortin michel.for...@michelf.com mailto:michel.for...@michelf.com wrote: On 2010-12-30 09:44:46 -0500, Trass3r u...@known.com mailto:u...@known.com said: Well you can always compile to native ARM code with gdc for example. But has the runtime been ported to ARM? -- Michel Fortin michel.for...@michelf.com mailto:michel.for...@michelf.com http://michelf.com/ -- - Andre Tampubolon -
Bleeding edge DMD2?
Is the source code of bleeding edge DMD2 available on svn or something? I tried http://svn.dsource.org/projects, but that didn't work...
Re: Bleeding edge DMD2?
On 12/13/2010 7:27 PM, Lars T. Kyllingstad wrote: On Mon, 13 Dec 2010 16:56:48 +0700, Andre Tampubolon wrote: Is the source code of bleeding edge DMD2 available on svn or something? I tried http://svn.dsource.org/projects, but that didn't work... Yes. The project page, including a code browser, is at http://www.dsource.org/projects/dmd and you can get the code by running svn co http://svn.dsource.org/projects/dmd/trunk -Lars Ah that worked. Thanks -- - Andre Tampubolon -
Re: cheers to gdc team
On 11/24/2010 8:06 AM, Iain Buclaw wrote: == Quote from Don (nos...@nospam.com)'s article g g wrote: I just want to say cheers to the GDC team for making D. 2.50(2.49 in the wiki) work in GCC. Great work Awesome! Does it pass the Phobos unit tests? Priorities! Currently working on passing the DMD testsuite first, that is more important in my eyes. Regards Iain Is the binary version available? -- - Andre Tampubolon -
Big executable?
Hi, I just started learning D (my background is C, anyway). I compiled this simple code using DMD 2.049 (dmd -O -release test1.d) : import std.stdio; void main() { writefln(%s World, Hello); } The final executable size is about 300 KB. Isn't that a bit huge, considering the same code compiled using C or Pascal compiler will give smaller executable? So I tried to look at the *.map, and apparently the D runtime pulls a lot of stuff. I am just wondering, anyway.
Re: Big executable?
On 10/6/2010 2:14 PM, Jonathan M Davis wrote: On Tuesday 05 October 2010 23:12:08 Andre Tampubolon wrote: Hi, I just started learning D (my background is C, anyway). I compiled this simple code using DMD 2.049 (dmd -O -release test1.d) : import std.stdio; void main() { writefln(%s World, Hello); } The final executable size is about 300 KB. Isn't that a bit huge, considering the same code compiled using C or Pascal compiler will give smaller executable? So I tried to look at the *.map, and apparently the D runtime pulls a lot of stuff. I am just wondering, anyway. People complain about that from time to time, and I believe that some work has been done to reduce the executable size, but the reality of the manner is that the plumbing that comes with druntime and the GC is going to take up some space, even if you don't use much of it. However, it will likely get dwarfed by the rest of your code if you write a decent size program, so it really won't matter much with real programs. It's just that the minimum size is a bit larger than some would like. - Jonathan M Davis OK. Thanks for the input. I can live with that :)