RejectedSoftware Forums

Sign up

Compile Batch? dmd

Hello, I am learning D still and don't understand the toolchain
so well yet, and when I try to switch out the rdmd to a dmd in
the run_example batch script it errors out.

Is it possible to get an example build script that compiles
instead of using rdmd?

Re: Compile Batch? dmd

Am 18.06.2012 21:12, schrieb Don Duvall:

Hello, I am learning D still and don't understand the toolchain so well
yet, and when I try to switch out the rdmd to a dmd in the run_example
batch script it errors out.

Is it possible to get an example build script that compiles instead of
using rdmd?

rdmd automatically finds all .d files that the app.d depends on - dmd
doesn't do this and thus the linking will fail. If you just want to
build without running you can also navigate to the example directory
(e.g. examples/http_server) and then execute "vibe build". You will then
get an app.exe that can be run manually.

Alternatively, building without rdmd just requires to pass all source
files to the compiler. Something like the following should work:

On Windows:

rem find all source files
cd ../source
dir /s /b .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>dir /s /b .d >> ../files.txt
rem remove some files now by hand...

rem build the example
cd ..
set LIBDIR=....\lib\win-i386
set LIBS="%LIBDIR%\event2.lib" "%LIBDIR%\eay.lib" "%LIBDIR%\ssl.lib"
ws2_32.lib
dmd -ofapp.exe -I../../source -Isource -Jviews %LIBS% @files.txt

On Posix systems:

find all source files

cd ../source
find -name .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>find -name .d >> ../files.txt

remove some files now by hand...

build the example

cd ..
LIBS=-L-levent_pthreads -L-levent -L-lssl -L-lcrypto
dmd -ofapp -I../../source -Isource -Jviews $LIBS @files.txt

The following files need to be removed from files.txt prior to
compilation as they are currently not compiling successfully:

deimos/ev.d
core/drivers/ev.d
core/drivers/win32.d
core/drivers/winrt.d
stream/base64.d

I just did a quick test on windows, so no guarantee that the posix
version works correctly.

Regards,
Sönke

Re: Compile Batch? dmd

On Tuesday, 19 June 2012 at 06:41:29 UTC, Sönke Ludwig wrote:

rdmd automatically finds all .d files that the app.d depends on

  • dmd doesn't do this and thus the linking will fail. If you

just want to build without running you can also navigate to the
example directory (e.g. examples/http_server) and then execute
"vibe build". You will then get an app.exe that can be run
manually.

Alternatively, building without rdmd just requires to pass all
source files to the compiler. Something like the following
should work:

On Windows:

rem find all source files
cd ../source
dir /s /b .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>dir /s /b .d >> ../files.txt
rem remove some files now by hand...

rem build the example
cd ..
set LIBDIR=....\lib\win-i386
set LIBS="%LIBDIR%\event2.lib" "%LIBDIR%\eay.lib"
"%LIBDIR%\ssl.lib" ws2_32.lib
dmd -ofapp.exe -I../../source -Isource -Jviews %LIBS% @files.txt

On Posix systems:

find all source files

cd ../source
find -name .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>find -name .d >> ../files.txt

remove some files now by hand...

build the example

cd ..
LIBS=-L-levent_pthreads -L-levent -L-lssl -L-lcrypto
dmd -ofapp -I../../source -Isource -Jviews $LIBS @files.txt

The following files need to be removed from files.txt prior to
compilation as they are currently not compiling successfully:

deimos/ev.d
core/drivers/ev.d
core/drivers/win32.d
core/drivers/winrt.d
stream/base64.d

I just did a quick test on windows, so no guarantee that the
posix version works correctly.

Thanks for giving this. I was just about to ask the same thing. I
want to be able to build my app inside MonoDevelop instead of a
second step using vibe build.

I'm very pleased with Vibe.d so far. Thanks for putting this
together.

Re: Compile Batch? dmd

On Tuesday, 19 June 2012 at 06:41:29 UTC, Sönke Ludwig wrote:

Am 18.06.2012 21:12, schrieb Don Duvall:

Hello, I am learning D still and don't understand the
toolchain so well
yet, and when I try to switch out the rdmd to a dmd in the
run_example
batch script it errors out.

Is it possible to get an example build script that compiles
instead of
using rdmd?

rdmd automatically finds all .d files that the app.d depends on

  • dmd doesn't do this and thus the linking will fail. If you

just want to build without running you can also navigate to the
example directory (e.g. examples/http_server) and then execute
"vibe build". You will then get an app.exe that can be run
manually.

Alternatively, building without rdmd just requires to pass all
source files to the compiler. Something like the following
should work:

On Windows:

rem find all source files
cd ../source
dir /s /b .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>dir /s /b .d >> ../files.txt
rem remove some files now by hand...

rem build the example
cd ..
set LIBDIR=....\lib\win-i386
set LIBS="%LIBDIR%\event2.lib" "%LIBDIR%\eay.lib"
"%LIBDIR%\ssl.lib" ws2_32.lib
dmd -ofapp.exe -I../../source -Isource -Jviews %LIBS% @files.txt

On Posix systems:

find all source files

cd ../source
find -name .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>find -name .d >> ../files.txt

remove some files now by hand...

build the example

cd ..
LIBS=-L-levent_pthreads -L-levent -L-lssl -L-lcrypto
dmd -ofapp -I../../source -Isource -Jviews $LIBS @files.txt

The following files need to be removed from files.txt prior to
compilation as they are currently not compiling successfully:

deimos/ev.d
core/drivers/ev.d
core/drivers/win32.d
core/drivers/winrt.d
stream/base64.d

I just did a quick test on windows, so no guarantee that the
posix version works correctly.

Regards,
Sönke

Yes, thank you very much. I am using D-IDE at the moment and
would like to be able to build my application from there. Also it
would be nice to just build the application and deploy it to the
server instead of compilation on the server.

Thanks again.

Re: Compile Batch? dmd

On Saturday, 23 June 2012 at 02:39:49 UTC, Don Duvall wrote:

On Tuesday, 19 June 2012 at 06:41:29 UTC, Sönke Ludwig wrote:

Am 18.06.2012 21:12, schrieb Don Duvall:

Hello, I am learning D still and don't understand the
toolchain so well
yet, and when I try to switch out the rdmd to a dmd in the
run_example
batch script it errors out.

Is it possible to get an example build script that compiles
instead of
using rdmd?

rdmd automatically finds all .d files that the app.d depends
on - dmd doesn't do this and thus the linking will fail. If
you just want to build without running you can also navigate
to the example directory (e.g. examples/http_server) and then
execute "vibe build". You will then get an app.exe that can be
run manually.

Alternatively, building without rdmd just requires to pass all
source files to the compiler. Something like the following
should work:

On Windows:

rem find all source files
cd ../source
dir /s /b .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>dir /s /b .d >> ../files.txt
rem remove some files now by hand...

rem build the example
cd ..
set LIBDIR=....\lib\win-i386
set LIBS="%LIBDIR%\event2.lib" "%LIBDIR%\eay.lib"
"%LIBDIR%\ssl.lib" ws2_32.lib
dmd -ofapp.exe -I../../source -Isource -Jviews %LIBS%
@files.txt

On Posix systems:

find all source files

cd ../source
find -name .d > ../examples/http_server/files.txt<br>cd ../examples/http_server/source<br>find -name .d >> ../files.txt

remove some files now by hand...

build the example

cd ..
LIBS=-L-levent_pthreads -L-levent -L-lssl -L-lcrypto
dmd -ofapp -I../../source -Isource -Jviews $LIBS @files.txt

The following files need to be removed from files.txt prior to
compilation as they are currently not compiling successfully:

deimos/ev.d
core/drivers/ev.d
core/drivers/win32.d
core/drivers/winrt.d
stream/base64.d

I just did a quick test on windows, so no guarantee that the
posix version works correctly.

Regards,
Sönke

Yes, thank you very much. I am using D-IDE at the moment and
would like to be able to build my application from there. Also
it would be nice to just build the application and deploy it to
the server instead of compilation on the server.

Thanks again.

Are you satisfied with D-IDE? I am looking now for descent IDE.

Thank you

Re: Compile Batch? dmd

On Wednesday, 25 July 2012 at 15:41:34 UTC, Menjanahary R. R.
wrote:

Are you satisfied with D-IDE? I am looking now for descent IDE.

I use MonoDevelop's D plugin and am pleased with it.

http://mono-d.alexanderbothe.com/
http://monodevelop.com/