RejectedSoftware Forums

Sign up

vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

I'm pretty new to vibe.d, so maybe this is something obvious. But I can't get a stock dub project with vibe.d to work on my Ubuntu server, though it works just fine on my OS X development machine. Any help in fixing this would be appreciated!

➜ ~ dub init test-vibe vibe.d
Successfully created an empty project in '/home/ysgard/test-vibe'.

➜ ~ cd test-vibe

➜ test-vibe dub
vibe-d: ["vibe-d", "libevent", "openssl"]
test-vibe: ["test-vibe", "vibe-d", "libevent", "openssl"]
Building vibe-d configuration "libevent", build type debug.
Running dmd...
FAIL ../.dub/packages/vibe-d-0.7.20/.dub/build/libevent-debug-linux.posix-x86_64-dmd-AB0707232CA963B5DA23C2232BBED51B vibe-d staticLibrary
Error executing command run: DMD compile run failed with exit code -9

➜ test-vibe cat dub.json
{

"name": "test-vibe",
"description": "A simple vibe.d server application.",
"copyright": "Copyright © 2014, ysgard",
"authors": ["ysgard"],
"dependencies": {
	"vibe-d": ">=0.7.17"
},
"versions": ["VibeDefaultMain"]

}
➜ test-vibe dmd | head -1
DMD64 D Compiler v2.065

➜ test-vibe dpkg -s libevent-dev | grep Version
Version: 2.0.21-stable-1ubuntu1

➜ test-vibe dub list
Packages present in the system and known to dub:
test-vibe ~master: /home/ysgard/test-vibe
libev ~master: /home/ysgard/.dub/packages/libev-master
libevent ~master: /home/ysgard/.dub/packages/libevent-master
openssl ~master: /home/ysgard/.dub/packages/openssl-master
vibe-d 0.7.20: /home/ysgard/.dub/packages/vibe-d-0.7.20

➜ test-vibe lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

Re: vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

On Tue, 23 Sep 2014 16:11:35 GMT, Jan Van Uytven wrote:

I'm pretty new to vibe.d, so maybe this is something obvious. But I can't get a stock dub project with vibe.d to work on my Ubuntu server, though it works just fine on my OS X development machine. Any help in fixing this would be appreciated!

➜ ~ dub init test-vibe vibe.d
Successfully created an empty project in '/home/ysgard/test-vibe'.

➜ ~ cd test-vibe

➜ test-vibe dub
vibe-d: ["vibe-d", "libevent", "openssl"]
test-vibe: ["test-vibe", "vibe-d", "libevent", "openssl"]
Building vibe-d configuration "libevent", build type debug.
Running dmd...
FAIL ../.dub/packages/vibe-d-0.7.20/.dub/build/libevent-debug-linux.posix-x86_64-dmd-AB0707232CA963B5DA23C2232BBED51B vibe-d staticLibrary
Error executing command run: DMD compile run failed with exit code -9

This looks a lot like the infamous out-of-memory issue. Unfortunately DMD uses up a lot of RAM during compilation, so on systems with less than about 2 GB of RAM it usually fails. With the most recent version of DUB (0.9.22) you should be able to work around it using the --build-mode=singleFile switch, though, at the expense of longer compile times.

The vibe.d version coming after 0.7.21 will also be separated into multiple sub packages, so that it may consist of small enough chunks that the issue will go away without single file compilation, too. I've also heard that the most recent DMD (the latest DMD beta may apply) uses up quite a bit less memory, so that might help too.

Re: vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

Hello Sönke,

That was indeed it. Thank you! using --build-mode=singleFile with the newest version of dub unambiguously identified running out of memory as the issue (it died on web.d, in case you were interested). I tried with the beta dmd, but alas, it did not help (dying on d.d). I only have 1Gb of RAM on this server, so I am not surprised.

I suppose my best option would either be to provision more RAM on the server, or compile it in a VM on my OS X instance and just copy the binary.

Thanks for your help!

  • Jan

Re: vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

sorry, I've no idea what I'm talking about now (just playing with "dub on Windows" since some days and have my difficulties with some projects/packages ;) ), but...

the first thing I always do after the "dub init" is to update the "dub.json" with the latest vibe-d package dependency info from "code.dlang.com", which as of today is:

"vibe-d": ">=0.7.21-beta.4"

next, I do/did a "dub upgrade" (just in case ;) )

afterward "dub" worked out fine on my lenovo S10 with Win8.1 32bit with 2GB RAM so far...

you may also want to run "dub --vverbose" on your project to get more infos and see what could be the real issue there...

btw., I also have "dub" or "vibe.d" issues on my company laptop (Win7 64bit with 8GB RAM) but I guess this has another background/reason (I have multiple DVM/Digger/D installations and a mix of 32/64bit 3rd vendor lib's installed there)...

On Tue, 23 Sep 2014 16:33:48 GMT, Sönke Ludwig wrote:

On Tue, 23 Sep 2014 16:11:35 GMT, Jan Van Uytven wrote:

I'm pretty new to vibe.d, so maybe this is something obvious. But I can't get a stock dub project with vibe.d to work on my Ubuntu server, though it works just fine on my OS X development machine. Any help in fixing this would be appreciated!

➜ ~ dub init test-vibe vibe.d
Successfully created an empty project in '/home/ysgard/test-vibe'.

➜ ~ cd test-vibe

➜ test-vibe dub
vibe-d: ["vibe-d", "libevent", "openssl"]
test-vibe: ["test-vibe", "vibe-d", "libevent", "openssl"]
Building vibe-d configuration "libevent", build type debug.
Running dmd...
FAIL ../.dub/packages/vibe-d-0.7.20/.dub/build/libevent-debug-linux.posix-x86_64-dmd-AB0707232CA963B5DA23C2232BBED51B vibe-d staticLibrary
Error executing command run: DMD compile run failed with exit code -9

This looks a lot like the infamous out-of-memory issue. Unfortunately DMD uses up a lot of RAM during compilation, so on systems with less than about 2 GB of RAM it usually fails. With the most recent version of DUB (0.9.22) you should be able to work around it using the --build-mode=singleFile switch, though, at the expense of longer compile times.

The vibe.d version coming after 0.7.21 will also be separated into multiple sub packages, so that it may consist of small enough chunks that the issue will go away without single file compilation, too. I've also heard that the most recent DMD (the latest DMD beta may apply) uses up quite a bit less memory, so that might help too.

Re: vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

On Tue, 23 Sep 2014 16:33:48 GMT, Sönke Ludwig wrote:

On Tue, 23 Sep 2014 16:11:35 GMT, Jan Van Uytven wrote:

I'm pretty new to vibe.d, so maybe this is something obvious. But I can't get a stock dub project with vibe.d to work on my Ubuntu server, though it works just fine on my OS X development machine. Any help in fixing this would be appreciated!

➜ ~ dub init test-vibe vibe.d
Successfully created an empty project in '/home/ysgard/test-vibe'.

➜ ~ cd test-vibe

➜ test-vibe dub
vibe-d: ["vibe-d", "libevent", "openssl"]
test-vibe: ["test-vibe", "vibe-d", "libevent", "openssl"]
Building vibe-d configuration "libevent", build type debug.
Running dmd...
FAIL ../.dub/packages/vibe-d-0.7.20/.dub/build/libevent-debug-linux.posix-x86_64-dmd-AB0707232CA963B5DA23C2232BBED51B vibe-d staticLibrary
Error executing command run: DMD compile run failed with exit code -9

This looks a lot like the infamous out-of-memory issue. Unfortunately DMD uses up a lot of RAM during compilation, so on systems with less than about 2 GB of RAM it usually fails. With the most recent version of DUB (0.9.22) you should be able to work around it using the --build-mode=singleFile switch, though, at the expense of longer compile times.

The vibe.d version coming after 0.7.21 will also be separated into multiple sub packages, so that it may consist of small enough chunks that the issue will go away without single file compilation, too. I've also heard that the most recent DMD (the latest DMD beta may apply) uses up quite a bit less memory, so that might help too.

I've setup an EC2 "micro" VM on the free plan (1cpu, 1G ram) and tried putting my project on it.

Even using singeFile I still have memory issues.

vibe.d is 0.7.21-rc.4

After building all the files:

Compiling ../../.dub/packages/vibe-d-0.7.21-rc.4/source/vibe/web/web.d...<br>Linking...<br>Error: out of memory<br>FAIL ../../.dub/packages/vibe-d-0.7.21-rc.4/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2066-2161C57E83B1803FA54B8BBD5FBBBAA1/ vibe-d staticLibrary<br>Error executing command run: dmd failed with exit code 1.

Thoughts? Or will I just have to build this on another VM somewhere else and copy things over?

Thanks!

-brian

Re: vibe.d fails to build on ubuntu 14 x64 with libevent (exit code -9)

Thoughts? Or will I just have to build this on another VM somewhere else and copy things over?

Our project is getting rather large (probably needs to be split into some sub packages) but even so we can't build it on a 1GB machine either. Our solution has been, as you suggested to compile on another machine and deploy the binary to the production machine.

Off topic but we have been busy setting up CoreOS for production and we now have docker images on our development Macs so that we can build test and run in the exact Ubuntu environment we are deploying to. Works like a charm if you are so inclined to try it out:

https://coreos.com
http://viget.com/extend/how-to-use-docker-on-os-x-the-missing-guide