Re: A DUB Case Study: Compiling DMD as a Library

2017-12-21 Thread Jacob Carlborg via Digitalmars-d-learn

On 2017-12-21 05:12, Venkat wrote:
I did a fresh clone of dmd and added that as a dependency. That fixed 
it. Should've thought of it !! Thankyou.


Great that it works :)

--
/Jacob Carlborg


Re: A DUB Case Study: Compiling DMD as a Library

2017-12-20 Thread Venkat via Digitalmars-d-learn
I did a fresh clone of dmd and added that as a dependency. That 
fixed it. Should've thought of it !! Thankyou.


Re: A DUB Case Study: Compiling DMD as a Library

2017-12-20 Thread Jacob Carlborg via Digitalmars-d-learn

On 2017-12-20 05:52, Venkat wrote:


This is regarding the latest D blog post. Jacob Carlborg is here, so I 
figured I'd post it.


https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling-dmd-as-a-library/#comment-2922 



Simply changing the targetType from library to dynamicLibrary breaks the 
code. What is going on with it ?


--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "library"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

-- output --
venkat@venkat-U46E /d/Documents/NetbeansProjects/dmd-test $ dub build
Performing "debug" build using dmd for x86_64.
-- end output --

--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "dynamicLibrary"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

Performing "debug" build using dmd for x86_64.
dmd ~stable: building configuration "library"...
../DSource/dmd/src/ddmd/scanmscoff.d(180,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(181,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(182,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(183,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(184,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(188,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(189,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(190,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(196,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(197,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(198,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(199,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(200,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(201,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(202,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(225,24): Error: undefined 
identifier BYTE

dmd failed with exit code 1.


Looks like it's trying to build all files again, even though it 
shouldn't. I suggest you run "dub build --force --vverbose" to see the 
exact commands that Dub is executing.


For me it works both with "library" and "dynamicLibrary".

--
/Jacob Carlborg


Re: A DUB Case Study: Compiling DMD as a Library

2017-12-19 Thread Venkat via Digitalmars-d-learn


This is regarding the latest D blog post. Jacob Carlborg is here, 
so I figured I'd post it.


https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling-dmd-as-a-library/#comment-2922

Simply changing the targetType from library to dynamicLibrary 
breaks the code. What is going on with it ?


--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "library"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

-- output --
venkat@venkat-U46E /d/Documents/NetbeansProjects/dmd-test $ dub 
build

Performing "debug" build using dmd for x86_64.
-- end output --

--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "dynamicLibrary"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

Performing "debug" build using dmd for x86_64.
dmd ~stable: building configuration "library"...
../DSource/dmd/src/ddmd/scanmscoff.d(180,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(181,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(182,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(183,10): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(184,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined 
identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(188,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(189,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(190,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(196,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(197,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(198,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(199,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(200,11): Error: undefined 
identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(201,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(202,11): Error: undefined 
identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(225,24): Error: undefined 
identifier BYTE

dmd failed with exit code 1.


Re: Compiling dmd -m64 on windows?

2016-01-29 Thread Tofu Ninja via Digitalmars-d-learn

On Friday, 29 January 2016 at 18:26:15 UTC, Tofu Ninja wrote:
For some reason it complains that link.exe is missing. Anyone 
know what's up?



dmd test.d



dmd test.d -m64

Can't run '\bin\link.exe', check PATH


link.exe is definitely on PATH...


where link.exe

C:\D\dmd2\windows\bin\link.exe


Re: Compiling dmd -m64 on windows?

2016-01-29 Thread Adam D. Ruppe via Digitalmars-d-learn

On Friday, 29 January 2016 at 18:27:50 UTC, Tofu Ninja wrote:

where link.exe

C:\D\dmd2\windows\bin\link.exe


-m64 needs a different link.exe. It uses the Microsoft linker so 
you've gotta be sure that one is installed and the path of the VS 
bin is in there too.


The dmd install exe will do all this for you, but then you need 
to remember to run the "D2 64 bit command prompt" so the PATH is 
set rather than just any cmd.


Compiling dmd -m64 on windows?

2016-01-29 Thread Tofu Ninja via Digitalmars-d-learn
For some reason it complains that link.exe is missing. Anyone 
know what's up?



dmd test.d



dmd test.d -m64

Can't run '\bin\link.exe', check PATH


Error Compiling DMD

2015-05-11 Thread Manfred Nowak via Digitalmars-d-learn
 std.process.ProcessException@std\process.d(560):
   Failed to spawn new process

This is the error-message from the D-script from
http://wiki.dlang.org/Building_DMD

-manfred


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Meta
It seems that while pointing to the correct link got rid of the 
linker warning, I still can't compile druntime.


On Friday, 14 February 2014 at 02:50:04 UTC, Stanislav Blinov 
wrote:
Are you by chance trying to compile dirty druntime tree? (i.e. 
you've compiled it before?). If so, make clean first. I had an 
error along the lines of what you're describing after a recent 
pull, but I'm not 100% sure it's the same one.


It had been compiled before, so I went one further, deleting and 
re-cloning druntime. However, it still dies with the same 
assertion failure. Here's the relevant output before it dies:


dmd -lib -oflib\druntime.lib -Xfdruntime.json -m32 -O -release 
-inline -w -Isrc -Iimport src\object_.d   src\core\atomic.d  
src\core\bitop.d  src\core\cpuid.d  src\core\demangle.d  
src\core\exception.d  src\core\math.d  src\core\memory.d  
src\core\runtime.d  src\core\simd.d  src\core\thread.d  
src\core\time.d  src\core\vararg.d   src\core\internal\hash.d  
src\core\internal\convert.d   src\core\stdc\config.d  
src\core\stdc\ctype.d  src\core\stdc\errno.d  
src\core\stdc\math.d  src\core\stdc\signal.d  
src\core\stdc\stdarg.d  src\core\stdc\stdio.d  
src\core\stdc\stdlib.d  src\core\stdc\stdint.d  
src\core\stdc\stddef.d  src\core\stdc\string.d  
src\core\stdc\time.d  src\core\stdc\wchar_.d   
src\core\sync\barrier.d  src\core\sync\condition.d  
src\core\sync\config.d  src\core\sync\exception.d  
src\core\sync\mutex.d  src\core\sync\rwmutex.d  
src\core\sync\semaphore.d   src\core\sys\freebsd\execinfo.d  
src\core\sys\freebsd\sys\event.d   src\core\sys\posix\signal.d  
src\core\sys\posix\dirent.d  src\core\sys\posix\sys\resource.d  
src\core\sys\posix\sys\select.d  src\core\sys\posix\sys\socket.d  
src\core\sys\posix\sys\stat.d  src\core\sys\posix\sys\wait.d  
src\core\sys\posix\netdb.d  src\core\sys\posix\sys\ioctl.d  
src\core\sys\posix\sys\utsname.d  
src\core\sys\posix\netinet\in_.d   src\core\sys\windows\dbghelp.d 
 src\core\sys\windows\dll.d  src\core\sys\windows\stacktrace.d  
src\core\sys\windows\threadaux.d  src\core\sys\windows\windows.d  
 src\gc\gc.d  src\gc\os.d  src\gc\bits.d  src\gc\stats.d  
src\gc\proxy.d   src\rt\aApply.d  src\rt\aApplyR.d  src\rt\aaA.d  
src\rt\adi.d  src\rt\alloca.d  src\rt\arrayassign.d  
src\rt\arraybyte.d  src\rt\arraycast.d  src\rt\arraycat.d  
src\rt\arraydouble.d  src\rt\arrayfloat.d  src\rt\arrayint.d  
src\rt\arrayreal.d  src\rt\arrayshort.d  src\rt\cast_.d  
src\rt\cmath2.d  src\rt\cover.d  src\rt\critical_.d  src\rt\deh.d 
 src\rt\deh_win32.d  src\rt\deh_win64_posix.d  src\rt\dmain2.d  
src\rt\invariant.d  src\rt\lifetime.d  src\rt\llmath.d  
src\rt\memory.d  src\rt\memset.d  src\rt\minfo.d  
src\rt\monitor_.d  src\rt\obj.d  src\rt\qsort.d  
src\rt\sections.d  src\rt\sections_freebsd.d  
src\rt\sections_linux.d  src\rt\sections_osx.d  
src\rt\sections_solaris.d  src\rt\sections_win32.d  
src\rt\sections_win64.d  src\rt\switch_.d  src\rt\tlsgc.d  
src\rt\trace.d   src\rt\util\array.d  src\rt\util\container.d  
src\rt\util\hash.d  src\rt\util\string.d  src\rt\util\utf.d   
src\rt\typeinfo\ti_AC.d  src\rt\typeinfo\ti_Acdouble.d  
src\rt\typeinfo\ti_Acfloat.d  src\rt\typeinfo\ti_Acreal.d  
src\rt\typeinfo\ti_Adouble.d  src\rt\typeinfo\ti_Afloat.d  
src\rt\typeinfo\ti_Ag.d  src\rt\typeinfo\ti_Aint.d  
src\rt\typeinfo\ti_Along.d  src\rt\typeinfo\ti_Areal.d  
src\rt\typeinfo\ti_Ashort.d  src\rt\typeinfo\ti_byte.d  
src\rt\typeinfo\ti_C.d  src\rt\typeinfo\ti_cdouble.d  
src\rt\typeinfo\ti_cfloat.d  src\rt\typeinfo\ti_char.d  
src\rt\typeinfo\ti_creal.d  src\rt\typeinfo\ti_dchar.d  
src\rt\typeinfo\ti_delegate.d  src\rt\typeinfo\ti_double.d  
src\rt\typeinfo\ti_float.d  src\rt\typeinfo\ti_idouble.d  
src\rt\typeinfo\ti_ifloat.d  src\rt\typeinfo\ti_int.d  
src\rt\typeinfo\ti_ireal.d  src\rt\typeinfo\ti_long.d  
src\rt\typeinfo\ti_ptr.d  src\rt\typeinfo\ti_real.d  
src\rt\typeinfo\ti_short.d  src\rt\typeinfo\ti_ubyte.d  
src\rt\typeinfo\ti_uint.d  src\rt\typeinfo\ti_ulong.d  
src\rt\typeinfo\ti_ushort.d  src\rt\typeinfo\ti_void.d  
src\rt\typeinfo\ti_wchar.d   src\etc\linux\memoryerror.d 
errno_c.obj src\rt\minit.obj

Assertion failure: 'impl' on line 4930 in file 'mtype.c'

abnormal program termination

--- errorlevel 1


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Stanislav Blinov

On Saturday, 15 February 2014 at 19:24:23 UTC, Meta wrote:
It seems that while pointing to the correct link got rid of the 
linker warning, I still can't compile druntime.


On Friday, 14 February 2014 at 02:50:04 UTC, Stanislav Blinov 
wrote:

Are you by chance trying to compile dirty druntime tree?


It had been compiled before, so I went one further, deleting 
and re-cloning druntime. However, it still dies with the same 
assertion failure. Here's the relevant output before it dies:


What about dmd itself? Have you rebuilt it from scratch too?


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Meta
On Saturday, 15 February 2014 at 22:05:00 UTC, Stanislav Blinov 
wrote:

On Saturday, 15 February 2014 at 19:24:23 UTC, Meta wrote:
It seems that while pointing to the correct link got rid of 
the linker warning, I still can't compile druntime.


On Friday, 14 February 2014 at 02:50:04 UTC, Stanislav Blinov 
wrote:

Are you by chance trying to compile dirty druntime tree?


It had been compiled before, so I went one further, deleting 
and re-cloning druntime. However, it still dies with the same 
assertion failure. Here's the relevant output before it dies:


What about dmd itself? Have you rebuilt it from scratch too?


Yes, DMD builds fine, and I tried to build druntime from a fresh 
DMD compile.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Stanislav Blinov

On Saturday, 15 February 2014 at 23:04:26 UTC, Meta wrote:


What about dmd itself? Have you rebuilt it from scratch too?


Yes, DMD builds fine, and I tried to build druntime from a 
fresh DMD compile.


That is bizarre. Which git commits are you using for dmd and 
druntime?


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Meta
On Saturday, 15 February 2014 at 23:37:40 UTC, Stanislav Blinov 
wrote:

On Saturday, 15 February 2014 at 23:04:26 UTC, Meta wrote:


What about dmd itself? Have you rebuilt it from scratch too?


Yes, DMD builds fine, and I tried to build druntime from a 
fresh DMD compile.


That is bizarre. Which git commits are you using for dmd and 
druntime?


Whatever's currently in master for both DMD and druntime.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Stanislav Blinov

On Sunday, 16 February 2014 at 01:34:53 UTC, Meta wrote:

That is bizarre. Which git commits are you using for dmd and 
druntime?


Whatever's currently in master for both DMD and druntime.


win32.mak for druntime uses whatever dmd is in your PATH. My 
guess is on your machine it's not the same as dmd that's built in 
git working copy, i.e. it tries to use your installed dmd. I've 
just dusted off my Win7 VM, made pulls for dmd and druntime and 
built both, though I had to edit druntime's win32.mak so that DMD 
variable points to the dmd executable I've built.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Meta
On Sunday, 16 February 2014 at 03:11:00 UTC, Stanislav Blinov 
wrote:

On Sunday, 16 February 2014 at 01:34:53 UTC, Meta wrote:

That is bizarre. Which git commits are you using for dmd and 
druntime?


Whatever's currently in master for both DMD and druntime.


win32.mak for druntime uses whatever dmd is in your PATH. My 
guess is on your machine it's not the same as dmd that's built 
in git working copy, i.e. it tries to use your installed dmd. 
I've just dusted off my Win7 VM, made pulls for dmd and 
druntime and built both, though I had to edit druntime's 
win32.mak so that DMD variable points to the dmd executable 
I've built.


Ah, finally. That was it. Thanks for the tip.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-15 Thread Stanislav Blinov

On Sunday, 16 February 2014 at 03:16:20 UTC, Meta wrote:
On Sunday, 16 February 2014 at 03:11:00 UTC, Stanislav Blinov 
wrote:



win32.mak for druntime uses whatever dmd is in your PATH.


Ah, finally. That was it. Thanks for the tip.


Heh. Sorry that took so long. I knew the error looked familiar 
but you got me puzzled when a clean rebuild didn't help. In the 
end that was one more reason to install VirtualBox to revive my 
Windows VM which I've been putting off for a while now :)


Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-13 Thread Meta
I'm using Windows 7 x64, but compiling 32-bit DMD. DMD compiles 
fine, but the linker warns about a Warning 9: Unknown Option : 
LA. After that, when trying to compile Druntime, DMD chokes with 
this error:


Assertion Failure: 'impl' on line 4930 in file 'mtype.c'.

I looked in the file, but all I could find on line 4930 was:

int TypeAArray::isZeroInit(Loc loc)
{
return true;
}

So I'm not really sure what's going on here, though I obviously 
did something wrong compiling DMD.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-13 Thread Nick Sabalausky

On 2/13/2014 8:09 PM, Meta wrote:

I'm using Windows 7 x64, but compiling 32-bit DMD. DMD compiles fine,
but the linker warns about a Warning 9: Unknown Option : LA. After
that, when trying to compile Druntime, DMD chokes with this error:



Sounds like you're using an outdated OPTLINK. The /LA flag was added 
relatively recently and the newer DMD buildscripts use it.


Try updating your copy of DMC, maybe a newer one will have the 
up-to-date OPTLINK. Or just replace your DMC's OPTLINK with the one that 
comes with DMD 2.064.2:


http://downloads.dlang.org/releases/2013/dmd.2.064.2.zip



Assertion Failure: 'impl' on line 4930 in file 'mtype.c'.

I looked in the file, but all I could find on line 4930 was:

int TypeAArray::isZeroInit(Loc loc)
{
 return true;
}



Not sure what's up with that one, but I don't have any familiarity with 
mtype. Maybe it's just fallout from the earlier error?




Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-13 Thread Stanislav Blinov

On Friday, 14 February 2014 at 01:09:42 UTC, Meta wrote:
I'm using Windows 7 x64, but compiling 32-bit DMD. DMD compiles 
fine, but the linker warns about a Warning 9: Unknown Option : 
LA. After that, when trying to compile Druntime, DMD chokes 
with this error:


Assertion Failure: 'impl' on line 4930 in file 'mtype.c'.

I looked in the file, but all I could find on line 4930 was:

int TypeAArray::isZeroInit(Loc loc)
{
return true;
}

So I'm not really sure what's going on here, though I obviously 
did something wrong compiling DMD.


Are you by chance trying to compile dirty druntime tree? (i.e. 
you've compiled it before?). If so, make clean first. I had an 
error along the lines of what you're describing after a recent 
pull, but I'm not 100% sure it's the same one.


Re: Trouble Compiling DMD, Druntime, Phobos on Windows

2014-02-13 Thread Meta
On Friday, 14 February 2014 at 01:58:13 UTC, Nick Sabalausky 
wrote:

On 2/13/2014 8:09 PM, Meta wrote:
I'm using Windows 7 x64, but compiling 32-bit DMD. DMD 
compiles fine,
but the linker warns about a Warning 9: Unknown Option : LA. 
After
that, when trying to compile Druntime, DMD chokes with this 
error:




Sounds like you're using an outdated OPTLINK. The /LA flag was 
added relatively recently and the newer DMD buildscripts use it.


Try updating your copy of DMC, maybe a newer one will have the 
up-to-date OPTLINK. Or just replace your DMC's OPTLINK with the 
one that comes with DMD 2.064.2:


http://downloads.dlang.org/releases/2013/dmd.2.064.2.zip



Assertion Failure: 'impl' on line 4930 in file 'mtype.c'.

I looked in the file, but all I could find on line 4930 was:

int TypeAArray::isZeroInit(Loc loc)
{
return true;
}



Not sure what's up with that one, but I don't have any 
familiarity with mtype. Maybe it's just fallout from the 
earlier error?


Ah, yes, there's a rogue outdated OPTLINK hiding out somewhere in 
my path. That should fix it, I think.


Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Sun, 11 Aug 2013 22:11:26 +0200
Jacob Carlborg d...@me.com wrote:

 On 2013-08-11 03:57, Nick Sabalausky wrote:
  I'm familiar with building DMD/Phobos on linux32/64 (and I assume
  freebsd is much the same, aside from having to install GNU make),
  but I know OSX is different in that the 32/64-bits bins are
  combined. I don't have access to a modern OSX machine ATM, but I
  might have a little bit of time with one tomorrow (I'm pretty sure
  it's either 10.6 or 10.7
  - I know it's a Core i7 laptop FWIW).
 
 Both of these should be fine and are modern enough for developing
 using DMD.
 
  So I wanted to ask, is there anything I should know about doing a
  full build of DMD/Phobos on OSX? Is it just like doing a
  32-bit-only or 64-bit-only build on linux, but just without using
  -m32/-m64? Or do I do one arch and then the other? Or does it
  differ between the different components (dmd/druntime/phobos)? Etc.
 
 If you run make -f posix.mak it will build only build for the
 default architecture, that is most likely 64bit. Only 64bit binaries
 of DMD are distributed. For Phobos a universal (fat) binary is
 distributed. Search for lipo in the Phobos makefile. lipo is the
 tool used to combine multiple architectures to a single binary. You
 can verify the result by running file path/to/binary. It will tell
 which architectures are available in the binary. These tools work
 both with executables, dynamic and static libraries.
 
  And are there any special OSX-only prerequisites?
 
 The developer tools, aka Xcode, available in App Store.
 

Thanks, I was indeed able to compile DMD/phobos on the system (after a
lng and surprisingly non-trivial download and install process for
xcode/gcc).

There did appear to be an issue with the tools repo, as I got errors
about dustmite being a directory instead of a file, which kinda
surprised me b/c I thought OSX was case-sensitive? (The tools repo
*does* have the dustmite sources in a subdirectory named DustMite.)



Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Jacob Carlborg

On 2013-08-12 09:33, Nick Sabalausky wrote:


Thanks, I was indeed able to compile DMD/phobos on the system (after a
lng and surprisingly non-trivial download and install process for
xcode/gcc).


Oh, really? I guess I forgot to mention that you need to install the 
command line tools as well.



There did appear to be an issue with the tools repo, as I got errors
about dustmite being a directory instead of a file, which kinda
surprised me b/c I thought OSX was case-sensitive? (The tools repo
*does* have the dustmite sources in a subdirectory named DustMite.)


No, HFS+, the filesystem on Mac OS X, is by default _not_ 
case-sensitive. I have hit one or two issues with this but in general 
it's not a problem. If you want, it's possible to choose case-sensitive, 
but that would most likely require you to reinstall the system.


--
/Jacob Carlborg


Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Mon, 12 Aug 2013 10:33:24 +0200
Jacob Carlborg d...@me.com wrote:

 On 2013-08-12 09:33, Nick Sabalausky wrote:
 
  Thanks, I was indeed able to compile DMD/phobos on the system
  (after a lng and surprisingly non-trivial download and install
  process for xcode/gcc).
 
 Oh, really? I guess I forgot to mention that you need to install the 
 command line tools as well.
 

Actually, what really took the most time by far was just downloading
xcode - that sucker's like 1 or 2 gigs!

All in all that wasn't too bad though. The most awkward thing about
the whole deal was just using an OS that I'm *really* not accustomed
to ;)


  There did appear to be an issue with the tools repo, as I got errors
  about dustmite being a directory instead of a file, which kinda
  surprised me b/c I thought OSX was case-sensitive? (The tools repo
  *does* have the dustmite sources in a subdirectory named
  DustMite.)
 
 No, HFS+, the filesystem on Mac OS X, is by default _not_ 
 case-sensitive. I have hit one or two issues with this but in general 
 it's not a problem. If you want, it's possible to choose
 case-sensitive, but that would most likely require you to reinstall
 the system.
 

I see. In that case, the tools's posix.mak needs to be fixed,
ideally by generating the executables into a subdirectory instead of
tools's root. I'll put together a pull req.




Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Mon, 12 Aug 2013 12:11:13 -0400
Nick Sabalausky seewebsitetocontac...@semitwist.com wrote:
 
 I see. In that case, the tools's posix.mak needs to be fixed,
 ideally by generating the executables into a subdirectory instead of
 tools's root. I'll put together a pull req.
 

https://github.com/D-Programming-Language/tools/pull/74



Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Jacob Carlborg

On 2013-08-12 18:11, Nick Sabalausky wrote:


Actually, what really took the most time by far was just downloading
xcode - that sucker's like 1 or 2 gigs!


You can actually just download and install the command line tools. But 
I'm not sure if the DMD makefile is setup to handle that. I have know 
idea if it will find the SKD and so on.


They're available here:

https://developer.apple.com/downloads/index.action

Requires a free Apple account. Search for Command Line Tools. Only 113 MB.


All in all that wasn't too bad though. The most awkward thing about
the whole deal was just using an OS that I'm *really* not accustomed
to ;)


Hehe :)

--
/Jacob Carlborg


Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-11 Thread Jacob Carlborg

On 2013-08-11 03:57, Nick Sabalausky wrote:

I'm familiar with building DMD/Phobos on linux32/64 (and I assume
freebsd is much the same, aside from having to install GNU make), but I
know OSX is different in that the 32/64-bits bins are combined. I don't
have access to a modern OSX machine ATM, but I might have a little
bit of time with one tomorrow (I'm pretty sure it's either 10.6 or 10.7
- I know it's a Core i7 laptop FWIW).


Both of these should be fine and are modern enough for developing using DMD.


So I wanted to ask, is there anything I should know about doing a full
build of DMD/Phobos on OSX? Is it just like doing a 32-bit-only or
64-bit-only build on linux, but just without using -m32/-m64? Or do I
do one arch and then the other? Or does it differ between the different
components (dmd/druntime/phobos)? Etc.


If you run make -f posix.mak it will build only build for the default 
architecture, that is most likely 64bit. Only 64bit binaries of DMD are 
distributed. For Phobos a universal (fat) binary is distributed. Search 
for lipo in the Phobos makefile. lipo is the tool used to combine 
multiple architectures to a single binary. You can verify the result by 
running file path/to/binary. It will tell which architectures are 
available in the binary. These tools work both with executables, dynamic 
and static libraries.



And are there any special OSX-only prerequisites?


The developer tools, aka Xcode, available in App Store.

--
/Jacob Carlborg


Compiling DMD/Phobos on OSX (vs linux)

2013-08-10 Thread Nick Sabalausky
I'm familiar with building DMD/Phobos on linux32/64 (and I assume
freebsd is much the same, aside from having to install GNU make), but I
know OSX is different in that the 32/64-bits bins are combined. I don't
have access to a modern OSX machine ATM, but I might have a little
bit of time with one tomorrow (I'm pretty sure it's either 10.6 or 10.7
- I know it's a Core i7 laptop FWIW).

So I wanted to ask, is there anything I should know about doing a full
build of DMD/Phobos on OSX? Is it just like doing a 32-bit-only or
64-bit-only build on linux, but just without using -m32/-m64? Or do I
do one arch and then the other? Or does it differ between the different
components (dmd/druntime/phobos)? Etc. And are there any special
OSX-only prerequisites?



Re: Compiling DMD on MAC OS X

2012-02-29 Thread Joshua Niehus
On Monday, 20 February 2012 at 11:18:34 UTC, Tyro[a.c.edwards] 
wrote:

...

and I doubt you want me to put all of what dmd -v spits out 
for this little script.


Thanks,
Andrew


Hi Andrew,

I ran into this problem as well and here is how I fixed/hacked it:
OSX Lion, and soon to be Mountain Lion, no longer come with GCC 
installed for the Command Line (/usr/bin/gcc)
What you need to do is Install Xcode from the app store, which is 
free, and then:

  * Launch your Xcode 4.1
  * Go to preferences  Downloads
  * Click on the install button near the Command line tools

This will put gcc in your /usr/bin directory.

Then try to recompile your code.

-- the new mac installer on the website should probably come with 
gcc or check for dependencies


Josh


Re: Compiling DMD on MAC OS X

2012-02-20 Thread Tyro[a.c.edwards]

On Sunday, 19 February 2012 at 11:39:15 UTC, kraybourne wrote:

On 2/19/12 09:20 , Tyro[a.c.edwards] wrote:

Hi all,

I've just installed DMD 2.058 and attempted to compile a 
little script

but was greeted with the following error:

gcc: Invalid argument

I used the .dmg installer from 
http://www.dlang.org/download.html and

issued the command:

dmd average

Is there something I'm missing?

Thanks,
Andrew


Hi!

Could you try

dmd -v avarage

and tell us what comes out?
Also, how does avarage.d look? Also what does

uname -a

and
gcc --version

say? Also, just in case

which dmd


I made the mistake of assuming that gcc was automatically 
installed in MAC OSX. After installing Xcode the problem went 
away. To answer your questions though:


I'm using DMD version 2.058 for MAC OSX which I installed using 
the .dmg package available at 
http://www.dlang.org/download.html;.


gcc --version yields:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. 
build 5658) (LLVM build 2336.9.00)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  
There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.


uname -a yields:

Darwin Andrews-MacBook-Pro.local 11.3.0 Darwin Kernel Version 
11.3.0: Thu Jan 12 18:47:41 PST 2012; 
root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64


the average program is as follows:

[code]
import std.stdio: stdin, writefln;
import std.conv: to;

void main(string[] args)
{
   double sum = 0.0;
   int cnt = 0;
   foreach(line; stdin.byLine())
   {
  if(line.length)
  {
 sum += to!double (line);
 cnt++;
  }
   }

   double avg = sum / cnt;
   writefln(Average is %.5f, avg);
}
[/code]

and I doubt you want me to put all of what dmd -v spits out for 
this little script.


Thanks,
Andrew



Compiling DMD on MAC OS X

2012-02-19 Thread Tyro[a.c.edwards]

Hi all,

I've just installed DMD 2.058 and attempted to compile a little 
script but was greeted with the following error:


gcc: Invalid argument

I used the .dmg installer from http://www.dlang.org/download.html 
and issued the command:


dmd average

Is there something I'm missing?

Thanks,
Andrew


Re: Compiling DMD on MAC OS X

2012-02-19 Thread kraybourne

On 2/19/12 09:20 , Tyro[a.c.edwards] wrote:

Hi all,

I've just installed DMD 2.058 and attempted to compile a little script
but was greeted with the following error:

gcc: Invalid argument

I used the .dmg installer from http://www.dlang.org/download.html and
issued the command:

dmd average

Is there something I'm missing?

Thanks,
Andrew


Hi!

Could you try

dmd -v avarage

and tell us what comes out?
Also, how does avarage.d look? Also what does

uname -a

and
gcc --version

say? Also, just in case

which dmd



Re: Compiling DMD

2011-04-08 Thread Simon

On 08/04/2011 05:37, Nick Sabalausky wrote:

Is the makefile supposed to work out-of-the-box, or is it expected that it
be edited first?  Because when I do make -f win32.mak form the src dir I
just get Error: '\dm\bin\dmc' not found. Same (exact same) result if I do
make -f win32.mak D=path_to_parent_of_dm.

I know I can just hack the make file to make it work like I've alwayd done
before, but now that I'm starting to work with the source from github, I
want to see if theres a proper way to do it that I'm missing that won't
end up with me needing to omit the makefile from commits and re-apply my
change whenever I pull a new version of the makefile.




You could create a junction from \dm\bin to where ever you've put the 
dmc bin folder. saves mucking around.


--
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


Compiling DMD

2011-04-07 Thread Nick Sabalausky
Is the makefile supposed to work out-of-the-box, or is it expected that it 
be edited first?  Because when I do make -f win32.mak form the src dir I 
just get Error: '\dm\bin\dmc' not found. Same (exact same) result if I do 
make -f win32.mak D=path_to_parent_of_dm.

I know I can just hack the make file to make it work like I've alwayd done 
before, but now that I'm starting to work with the source from github, I 
want to see if theres a proper way to do it that I'm missing that won't 
end up with me needing to omit the makefile from commits and re-apply my 
change whenever I pull a new version of the makefile.