www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - BSD Config

reply "Tyro[17]" <ridimz yahoo.com> writes:
What is the proper way to configure DMD for use on BSD systems?

There is no freebsd or openbsd folder in the zip file so the 
instructions on dlang.org/dmd-freebsd.html cannot be followed as 
written. I tried building from source but get the following errors:


*** Parse error in /root/dmd2/src/dmd: Missing dependency operator 
(posix.mak
*** Parse error: Need an operator in 'endif' (posix.mak:5)
*** Parse error: Missing dependency operator (posix.mak:6)
*** Parse error: Need an operator in 'endif' (posix.mak:8)
*** Parse error: Missing dependency operator (posix.mak:9)
*** Parse error: Need an operator in 'endif' (posix.mak:11)
*** Parse error: Missing dependency operator (posix.mak:12)
*** Parse error: Need an operator in 'endif' (posix.mak:14)
*** Parse error: Missing dependency operator (posix.mak:15)
*** Parse error: Need an operator in 'endif' (posix.mak:17)
*** Parse error: Missing dependency operator (posix.mak:18)
*** Parse error: Need an operator in 'endif' (posix.mak:20)
*** Parse error: Missing dependency operator (posix.mak:21)
*** Parse error: Need an operator in 'endif' (posix.mak:23)
*** Parse error: Missing dependency operator (posix.mak:25)
*** Parse error: Need an operator in '' (posix.mak:26)
*** Parse error: Need an operator in 'endif' (posix.mak:28)
*** Parse error: Missing dependency operator (posix.mak:30)
*** Parse error: Need an operator in 'else' (posix.mak:33)
*** Parse error: Missing dependency operator (posix.mak:34)
*** Parse error: Need an operator in 'else' (posix.mak:37)
Bad modifier:  '$(TARGET_CPU)')
Bad modifier:  '$(TARGET_CPU)')
*** Parse error: Need an operator in ')' (posix.mak:38)
*** Parse error: Need an operator in 'endif' (posix.mak:39)
*** Parse error: Need an operator in 'endif' (posix.mak:40)
*** Parse error: Missing dependency operator (posix.mak:49)
*** Parse error: Need an operator in 'endif' (posix.mak:51)
*** Parse error: Missing dependency operator (posix.mak:53)
*** Parse error: Need an operator in 'MACOSX_DEPLOYMENT_TARGET=10.3' 
(posix.mak:54)
*** Parse error: Need an operator in 'endif' (posix.mak:55)
*** Parse error: Unassociated shell command "  HOST_CC=g++" (posix.mak:61)
*** Parse error: Missing dependency operator (posix.mak:71)
*** Parse error: Need an operator in 'else' (posix.mak:73)
*** Parse error: Need an operator in 'endif' (posix.mak:75)
*** Parse error: Missing dependency operator (posix.mak:106)
*** Parse error: Need an operator in 'else' (posix.mak:108)
*** Parse error: Need an operator in 'endif' (posix.mak:110)
*** Parse error: Missing dependency operator (posix.mak:215)
*** Parse error: Need an operator in 'endif' (posix.mak:219)
*** Parse error: Need an operator in '' (posix.mak:221)
*** Parse error: Missing dependency operator (posix.mak:701)
*** Parse error: Need an operator in 'else' (posix.mak:703)
*** Parse error: Need an operator in 'endif' (posix.mak:705)

This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am running the 
64bit version of all these operating systems. Which actually might be 
the problem now that I think about it. Does DMD even support the 64bit 
version  of Free/OpenBSD?

-- 

Andrew Edwards
--------------------
http://www.akeron.co
auto getAddress() {
     string location = " ", period = ".";
     return ("info" ~ location ~ "afidem" ~ period ~ "org");
}
Nov 10 2013
next sibling parent reply "nazriel" <spam dzfl.pl> writes:
On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD systems?

 There is no freebsd or openbsd folder in the zip file so the 
 instructions on dlang.org/dmd-freebsd.html cannot be followed 
 as written. I tried building from source but get the following 
 errors:


 *** Parse error in /root/dmd2/src/dmd: Missing dependency 
 operator (posix.mak
 *** Parse error: Need an operator in 'endif' (posix.mak:5)
 *** Parse error: Missing dependency operator (posix.mak:6)
 *** Parse error: Need an operator in 'endif' (posix.mak:8)
 *** Parse error: Missing dependency operator (posix.mak:9)
 *** Parse error: Need an operator in 'endif' (posix.mak:11)
 *** Parse error: Missing dependency operator (posix.mak:12)
 *** Parse error: Need an operator in 'endif' (posix.mak:14)
 *** Parse error: Missing dependency operator (posix.mak:15)
 *** Parse error: Need an operator in 'endif' (posix.mak:17)
 *** Parse error: Missing dependency operator (posix.mak:18)
 *** Parse error: Need an operator in 'endif' (posix.mak:20)
 *** Parse error: Missing dependency operator (posix.mak:21)
 *** Parse error: Need an operator in 'endif' (posix.mak:23)
 *** Parse error: Missing dependency operator (posix.mak:25)
 *** Parse error: Need an operator in '' (posix.mak:26)
 *** Parse error: Need an operator in 'endif' (posix.mak:28)
 *** Parse error: Missing dependency operator (posix.mak:30)
 *** Parse error: Need an operator in 'else' (posix.mak:33)
 *** Parse error: Missing dependency operator (posix.mak:34)
 *** Parse error: Need an operator in 'else' (posix.mak:37)
 Bad modifier:  '$(TARGET_CPU)')
 Bad modifier:  '$(TARGET_CPU)')
 *** Parse error: Need an operator in ')' (posix.mak:38)
 *** Parse error: Need an operator in 'endif' (posix.mak:39)
 *** Parse error: Need an operator in 'endif' (posix.mak:40)
 *** Parse error: Missing dependency operator (posix.mak:49)
 *** Parse error: Need an operator in 'endif' (posix.mak:51)
 *** Parse error: Missing dependency operator (posix.mak:53)
 *** Parse error: Need an operator in 
 'MACOSX_DEPLOYMENT_TARGET=10.3' (posix.mak:54)
 *** Parse error: Need an operator in 'endif' (posix.mak:55)
 *** Parse error: Unassociated shell command "  HOST_CC=g++" 
 (posix.mak:61)
 *** Parse error: Missing dependency operator (posix.mak:71)
 *** Parse error: Need an operator in 'else' (posix.mak:73)
 *** Parse error: Need an operator in 'endif' (posix.mak:75)
 *** Parse error: Missing dependency operator (posix.mak:106)
 *** Parse error: Need an operator in 'else' (posix.mak:108)
 *** Parse error: Need an operator in 'endif' (posix.mak:110)
 *** Parse error: Missing dependency operator (posix.mak:215)
 *** Parse error: Need an operator in 'endif' (posix.mak:219)
 *** Parse error: Need an operator in '' (posix.mak:221)
 *** Parse error: Missing dependency operator (posix.mak:701)
 *** Parse error: Need an operator in 'else' (posix.mak:703)
 *** Parse error: Need an operator in 'endif' (posix.mak:705)

 This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am 
 running the 64bit version of all these operating systems. Which 
 actually might be the problem now that I think about it. Does 
 DMD even support the 64bit version  of Free/OpenBSD?
Try running it with gmake
Nov 10 2013
parent reply "Tyro[17]" <ridimz yahoo.com> writes:
On 11/10/13, 12:16 PM, nazriel wrote:
 On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD systems?
[Snip]
 Try running it with gmake
Ok... Thanks for the pointer. I tried it and got much further than before. Pays to use the right tool for the job. I still ran into problems though: g++ -c -Wno-deprecated -Wstrict-ailiasing -D__pascal= -fno-exceptions -O2 -Ibackend -Itk -Iroot -DMARS=1 -DTARGET_FREEBSD=1 -DDM_TARGET_CPU_X86=1 -DDMDV2=1 -I. backend/dwarf.c backend/dwarf.c: In function 'void dwarf_initfile(const char*)': backend/dwarf.c:658:9: error 'error' was not declared in this scope backend/dwarf.c:662:35: error 'getcwd' was not declared in this scope backend/dwarf.c:667:22: error 'ERANGE' was not declared in this scope gmake: *** [dwarf.o] Error 1 Any pointers? Thanks. -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = " ", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); }
Nov 10 2013
parent reply "Joakim" <joakim airpost.net> writes:
On Sunday, 10 November 2013 at 19:09:37 UTC, Tyro[17] wrote:
 On 11/10/13, 12:16 PM, nazriel wrote:
 On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD 
 systems?
[Snip]
 Try running it with gmake
Ok... Thanks for the pointer. I tried it and got much further than before. Pays to use the right tool for the job. I still ran into problems though: g++ -c -Wno-deprecated -Wstrict-ailiasing -D__pascal= -fno-exceptions -O2 -Ibackend -Itk -Iroot -DMARS=1 -DTARGET_FREEBSD=1 -DDM_TARGET_CPU_X86=1 -DDMDV2=1 -I. backend/dwarf.c backend/dwarf.c: In function 'void dwarf_initfile(const char*)': backend/dwarf.c:658:9: error 'error' was not declared in this scope backend/dwarf.c:662:35: error 'getcwd' was not declared in this scope backend/dwarf.c:667:22: error 'ERANGE' was not declared in this scope gmake: *** [dwarf.o] Error 1 Any pointers?
There exist FreeBSD ports for dmd1 and dmd2, which you can use to compile either one in 32- or 64-bit. Any reason you're not using them? They're a little stale, but they should work. At the very least, you should be able to figure out build requirements like this by looking at the port's makefile, if you prefer to build dmd yourself.
Nov 11 2013
parent reply "Tyro[17]" <ridimz yahoo.com> writes:
On 11/11/13, 11:05 AM, Joakim wrote:
 On Sunday, 10 November 2013 at 19:09:37 UTC, Tyro[17] wrote:
 On 11/10/13, 12:16 PM, nazriel wrote:
 On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD systems?
[Snip]
 Try running it with gmake
Ok... Thanks for the pointer. I tried it and got much further than before. Pays to use the right tool for the job. I still ran into problems though: g++ -c -Wno-deprecated -Wstrict-ailiasing -D__pascal= -fno-exceptions -O2 -Ibackend -Itk -Iroot -DMARS=1 -DTARGET_FREEBSD=1 -DDM_TARGET_CPU_X86=1 -DDMDV2=1 -I. backend/dwarf.c backend/dwarf.c: In function 'void dwarf_initfile(const char*)': backend/dwarf.c:658:9: error 'error' was not declared in this scope backend/dwarf.c:662:35: error 'getcwd' was not declared in this scope backend/dwarf.c:667:22: error 'ERANGE' was not declared in this scope gmake: *** [dwarf.o] Error 1 Any pointers?
There exist FreeBSD ports for dmd1 and dmd2, which you can use to compile either one in 32- or 64-bit. Any reason you're not using them? They're a little stale, but they should work. At the very least, you should be able to figure out build requirements like this by looking at the port's makefile, if you prefer to build dmd yourself.
Reason... I had every intention of volunteering to become the so called build master for DMD. I thought it a bit presumptuous to do such a thing without actually knowing how to build the compiler on the supported platforms. I'm using DragonFlyBSD but as far as I know it is 100% source/binary compatible with FreeBSD. Either way, I've progressed well beyond this point. My current problem is there are a number of undefined references to Port::'et al' in the following files (list abbreviated to remove eliminate all duplicates): lexer.c: Port::strtold(char const*, char**) lexer.c: Port::strtod(char const*, char**) lexer.c: Port::strtof(char const*, char**) mars.c: browse(char const*) mtype.c: Port::snan mtype.c: Port::ldbl_infinity mtype.c: Port::ldbl_nan mtype.c: Port::ldbl_max blockopt.c: util_progress() cgelem.c: util_progress() constfold.c: Port::fmodl(long double, long double) constfold.c: Port::ldbl_nan constfold.c: Port::isNan(long double) e2ir.c: Port::isSignallingNan(long double) expression.c: Port::isNan(long double) expression.c: Port::fequal(long double, long double) expression.c: Port::strtold(char const*, char**) expression.c: Port::isInfinity(double) go.c: util_progress() inifile.c: Port::strupr(char*) inifile.c: Port::memicmp(char const*, char const* int) doc.c: Port::memicmp(char const*, char const* int) ctfeexpr.c: Port::isNan(long double) I could start over with FreeBSD now that I know what the problem with that system was. But after installing, configuring and deleting three flavors of BSD for as many times as I did starting on Wednesday of last week, I have no desire to do it again. At least not right now. -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = " ", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); }
Nov 11 2013
parent "Joakim" <joakim airpost.net> writes:
On Monday, 11 November 2013 at 18:02:18 UTC, Tyro[17] wrote:
 Reason... I had every intention of volunteering to become the 
 so called build master for DMD. I thought it a bit presumptuous 
 to do such a thing without actually knowing how to build the 
 compiler on the supported platforms. I'm using DragonFlyBSD but 
 as far as I know it is 100% source/binary compatible with 
 FreeBSD.
As Walter said in that thread, you don't have to build everything yourself if you're the build master. You're just responsible for the end product, which may simply mean prodding those responsible for the OS builds that you're unfamiliar with (http://forum.dlang.org/thread/l5ec4p$18p2$1 digitalmars.com#post-l5edpl:241a8i:241:40digitalmars.com). DragonFly forked from FreeBSD 4 and the dmd2 FreeBSD port doesn't compile on anything less than FreeBSD 8. Also, the dmd codebase hardcodes for FreeBSD, so even if some source would compile on DragonFly also, it won't until you add in the DragonFly name into the all the appropriate ifdefs.
 Either way, I've progressed well beyond this point. My current 
 problem is there are a number of undefined references to 
 Port::'et al' in the following files (list abbreviated to 
 remove eliminate all duplicates):

     lexer.c: Port::strtold(char const*, char**)
     lexer.c: Port::strtod(char const*, char**)
     lexer.c: Port::strtof(char const*, char**)

     mars.c: browse(char const*)

     mtype.c: Port::snan
     mtype.c: Port::ldbl_infinity
     mtype.c: Port::ldbl_nan
     mtype.c: Port::ldbl_max

     blockopt.c: util_progress()

     cgelem.c: util_progress()

     constfold.c: Port::fmodl(long double, long double)
     constfold.c: Port::ldbl_nan
     constfold.c: Port::isNan(long double)

     e2ir.c: Port::isSignallingNan(long double)

     expression.c: Port::isNan(long double)
     expression.c: Port::fequal(long double, long double)
     expression.c: Port::strtold(char const*, char**)
     expression.c: Port::isInfinity(double)

     go.c: util_progress()

     inifile.c: Port::strupr(char*)
     inifile.c: Port::memicmp(char const*, char const* int)

     doc.c: Port::memicmp(char const*, char const* int)

     ctfeexpr.c: Port::isNan(long double)
This is because DragonFly is not included in the ifdefs. Look at dmd2/root/port.c. You'll see that all these Port::* functions are defined specifically for FreeBSD and the other supported platforms but DragonFly isn't mentioned anywhere. You have to go through and add DragonFly into all the appropriate source files for it to work on DragonFly, not just for dmd but especially in druntime and a little bit in Phobos too. It might make sense to add a general BSD define, but then you'll have to test that on all the other BSDs also. In any case, none of this is required to be build master, as dmd only supports FreeBSD officially and that already works.
 I could start over with FreeBSD now that I know what the 
 problem with that system was. But after installing, configuring 
 and deleting three flavors of BSD for as many times as I did 
 starting on Wednesday of last week, I have no desire to do it 
 again. At least not right now.
If you are interested in volunteering for build master, none of this was necessary, so I wouldn't let it put you off. I suggest you talk to Walter or Brad about what knowledge is required to do that job and figure out if you fit the bill. You will not have to do any of the above porting work as build master, simply keep the trains running on time AFAIK. :)
Nov 11 2013
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-11-10 17:49, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD systems?

 There is no freebsd or openbsd folder in the zip file so the
 instructions on dlang.org/dmd-freebsd.html cannot be followed as
 written. I tried building from source but get the following errors:
 This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am running the
 64bit version of all these operating systems. Which actually might be
 the problem now that I think about it. Does DMD even support the 64bit
 version  of Free/OpenBSD?
Yes, DMD works on FreeBSD, both 32bit and 64bit. I've sent pre-compiled binaries to Walter. I don't know if he wants to put them online. As nazriel said, you need to run it with gmake (GNU make). -- /Jacob Carlborg
Nov 10 2013
parent Walter Bright <newshound2 digitalmars.com> writes:
On 11/10/2013 10:01 AM, Jacob Carlborg wrote:
 I've sent pre-compiled binaries
 to Walter. I don't know if he wants to put them online.
I do, and want to include it with a couple other adjustments to 2.064.
Nov 10 2013
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2013-11-10 17:49, Tyro[17] wrote:
 What is the proper way to configure DMD for use on BSD systems?
If you want the pre-compiled binaries I have them here: https://dl.dropboxusercontent.com/u/18386187/dmd.2.064.2-freebsd.zip It's both for 32 and 64bit. Both stripped an unstripped executables. -- /Jacob Carlborg
Nov 10 2013
prev sibling parent reply "Joakim" <joakim airpost.net> writes:
On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am 
 running the 64bit version of all these operating systems. Which 
 actually might be the problem now that I think about it. Does 
 DMD even support the 64bit version  of Free/OpenBSD?
Oh, I should mention also, that there isn't general BSD support in D. Try grepping for freebsd in the source. I just tried it on the source in the 2.063.2 zip file and I got 510 hits for freebsd, 181 hits for openbsd, and 2 hits for dragonfly. By comparison, I got 685 hits for linux. That should give you a crude but reasonable idea of how well-supported each OS is. As for 64-bit, I believe it should work on FreeBSD, but likely isn't well-tested.
Nov 11 2013
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2013-11-11 17:15, Joakim wrote:

 Oh, I should mention also, that there isn't general BSD support in D.
 Try grepping for freebsd in the source.  I just tried it on the source
 in the 2.063.2 zip file and I got 510 hits for freebsd, 181 hits for
 openbsd, and 2 hits for dragonfly.  By comparison, I got 685 hits for
 linux.  That should give you a crude but reasonable idea of how
 well-supported each OS is.  As for 64-bit, I believe it should work on
 FreeBSD, but likely isn't well-tested.
FreeBSD is the only officially supported BSD system. The auto tester runs tests on both 32bit and 64bit FreeBSD so it should be well tested. http://d.puremagic.com/test-results/ -- /Jacob Carlborg
Nov 11 2013
prev sibling parent reply Brad Roberts <braddr puremagic.com> writes:
On 11/11/13 8:15 AM, Joakim wrote:
 On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am running the 64bit
version of all these
 operating systems. Which actually might be the problem now that I think about
it. Does DMD even
 support the 64bit version  of Free/OpenBSD?
Oh, I should mention also, that there isn't general BSD support in D. Try grepping for freebsd in the source. I just tried it on the source in the 2.063.2 zip file and I got 510 hits for freebsd, 181 hits for openbsd, and 2 hits for dragonfly. By comparison, I got 685 hits for linux. That should give you a crude but reasonable idea of how well-supported each OS is. As for 64-bit, I believe it should work on FreeBSD, but likely isn't well-tested.
https://d.puremagic.com/test-results/?projectid=1 FreeBSD/32 and FreeBSD/64 are both tested just as much as the rest of the platforms. That said, I'm sure that neither gets the same level of usage from the community as linux or win32.
Nov 11 2013
next sibling parent reply "Tyro[17]" <ridimz yahoo.com> writes:
On 11/11/13, 12:35 PM, Brad Roberts wrote:
 https://d.puremagic.com/test-results/?projectid=1

 FreeBSD/32 and FreeBSD/64 are both tested just as much as the rest of
 the platforms.  That said, I'm sure that neither gets the same level of
 usage from the community as linux or win32.
Any particular reason why the binaries omitted from the zip file? I'm not expecting an installer, although that would be nice, but if it is being tested, why not provide the binaries? -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = " ", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); }
Nov 11 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-11-11 18:49, Tyro[17] wrote:

 Any particular reason why the binaries omitted from the zip file? I'm
 not expecting an installer, although that would be nice, but if it is
 being tested, why not provide the binaries?
Walter said it was due to his FreeBSD machine was running out of memory when compiling DMD. Again he'll hopefully include the binaries I sent him. -- /Jacob Carlborg
Nov 11 2013
prev sibling parent reply "Joakim" <joakim airpost.net> writes:
On Monday, 11 November 2013 at 17:35:29 UTC, Brad Roberts wrote:
 On 11/11/13 8:15 AM, Joakim wrote:
 On Sunday, 10 November 2013 at 16:49:18 UTC, Tyro[17] wrote:
 This happened on OpenBSD, FreeBSD and DragonFlyBSD. I am 
 running the 64bit version of all these
 operating systems. Which actually might be the problem now 
 that I think about it. Does DMD even
 support the 64bit version  of Free/OpenBSD?
Oh, I should mention also, that there isn't general BSD support in D. Try grepping for freebsd in the source. I just tried it on the source in the 2.063.2 zip file and I got 510 hits for freebsd, 181 hits for openbsd, and 2 hits for dragonfly. By comparison, I got 685 hits for linux. That should give you a crude but reasonable idea of how well-supported each OS is. As for 64-bit, I believe it should work on FreeBSD, but likely isn't well-tested.
https://d.puremagic.com/test-results/?projectid=1 FreeBSD/32 and FreeBSD/64 are both tested just as much as the rest of the platforms. That said, I'm sure that neither gets the same level of usage from the community as linux or win32.
OK, good to know. It might help 64-bit usage on FreeBSD if the official dlang zip file shipped with the 64-bit builds of dmd also, just as it does for linux, though maybe that is already the plan for the upcoming versions.
Nov 11 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-11-11 18:55, Joakim wrote:

 OK, good to know.  It might help 64-bit usage on FreeBSD if the official
 dlang zip file shipped with the 64-bit builds of dmd also, just as it
 does for linux, though maybe that is already the plan for the upcoming
 versions.
I've sent pre-compiled binaries for FreeBSD 32bit and 64bit to Walter. Hopefully he'll add them soon to the zip and make an announcement. -- /Jacob Carlborg
Nov 11 2013