[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Compiling on/for ARM



On Tue, Mar 24, 2015 at 04:57:55PM +0100, Magnus Therning wrote:
> On Tue, Mar 24, 2015 at 07:52:26AM +0000, Anil Madhavapeddy wrote:
> > On 24 Mar 2015, at 05:24, Magnus Therning <magnus@xxxxxxxxxxxx> wrote:
> > > 
> > > I thought github/mirage-decks would be a good first project to build
> > > on/for my Cubietruck.  So after installing the mirage tool via `opam`
> > > I cloned the decks project and proceeded to build it in unix mode.
> > > `make configure` worked just fine, but `make build` did not.
> > > Apparently `camlp4` requires more memory than what's available:
> > 
> > mirage-decks isn't a great first choice -- mirage-www would be better.
> > The reason is that it currently crunches the *entire* slide deck into
> > memory rather than use an external block device.  We do need to port
> > the decks build system to dynamically read the slides off disk as they
> > have grown quite significantly.  What Mort and I normally do is to
> > delete the irrelevant slides from a local checkout on the ARM box.
> > 
> > Note that you can still get it compile fine if you setup a swap device
> > as normal on dom0, but compiling it will take forever due to building a
> > 50MB OCaml source file.  I'd recommend just playing with mirage-www
> > instead, or the static_website example in mirage-skeleton (where you
> > just populate htdocs/ with whatever content you want)
> 
> Thanks.  I'll switch to mirage-www then :)  Hopefully I'll have more
> luck with that.

Unfortunately mirage-www also results in an out-of-memory error:

~~~
mirage@cubietruck:~/mirage-www$ make build
cd src && make build
make[1]: Entering directory `/home/mirage/mirage-www/src'
ocamlbuild -use-ocamlfind -pkgs 
lwt.syntax,conduit.mirage,cow.syntax,cowabloga,cstruct,io-page,io-page.unix,lwt,mirage-console.unix,mirage-fs-unix,mirage-http,mirage-types,mirage-types.lwt,tcpip.stack-socket
 -tags "syntax(camlp4o),annot,bin_annot,strict_sequence,principal" -tag-line 
"<static*.*>: -syntax(camlp4o)" -cflag -g -lflags -g,-linkpkg main.native
+ ocamlfind ocamldep -package tcpip.stack-socket -package mirage-types.lwt 
-package mirage-types -package mirage-http -package mirage-fs-unix -package 
mirage-console.unix -package lwt -package io-page.unix -package io-page 
-package cstruct -package cowabloga -package cow.syntax -package conduit.mirage 
-package lwt.syntax -syntax camlp4o -modules main.ml > main.ml.depends
Out of memory
File "main.ml", line 1:
Error: Error while running external preprocessor
Command line: camlp4 '-I' '/home/mirage/.opam/4.02.1/lib/ocaml/camlp4' '-I' 
'/home/mirage/.opam/4.02.1/lib/ocaml' '-I' 
'/home/mirage/.opam/4.02.1/lib/type_conv' '-I' 
'/home/mirage/.opam/4.02.1/lib/dyntype' '-I' 
'/home/mirage/.opam/4.02.1/lib/xmlm' '-I' '/home/mirage/.opam/4.02.1/lib/uutf' 
'-I' '/home/mirage/.opam/4.02.1/lib/jsonm' '-I' 
'/home/mirage/.opam/4.02.1/lib/hex' '-I' '/home/mirage/.opam/4.02.1/lib/ocaml' 
'-I' '/home/mirage/.opam/4.02.1/lib/ocaml' '-I' 
'/home/mirage/.opam/4.02.1/lib/sexplib' '-I' 
'/home/mirage/.opam/4.02.1/lib/ezjsonm' '-I' 
'/home/mirage/.opam/4.02.1/lib/cow' '-I' '/home/mirage/.opam/4.02.1/lib/lwt' 
'-I' '/home/mirage/.opam/4.02.1/lib/lwt' '-parser' 'o' '-parser' 'op' 
'-printer' 'p' 'str.cma' 'pa_type_conv.cma' 'pa_dyntype.cma' 'xmlm.cma' 
'uutf.cma' 'jsonm.cma' 'hex.cma' 'unix.cma' 'bigarray.cma' 'sexplib.cma' 
'ezjsonm.cma' 'xmlm.cma' 'str.cma' 'pa_cow.cma' 'ezjsonm.cma' 
'lwt-syntax-options.cma' 'lwt-syntax.cma'  'main.ml' > /tmp/ocamlppb0265b

Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
make[1]: *** [main.native] Error 10
make[1]: Leaving directory `/home/mirage/mirage-www/src'
make: *** [build] Error 2
~~~

This is after configuring using

~~~
mirage@cubietruck:~/mirage-www$ make configure NET=socket PORT=8080
mirage configure src/config.ml  --unix
Mirage      Using specified config file: src/config.ml
Mirage      Compiling for target: Unix
Mirage      Processing: /home/mirage/mirage-www/src/config.ml
Mirage      => rm -rf /home/mirage/mirage-www/src/_build/config.*
Mirage      => cd /home/mirage/mirage-www/src && ocamlbuild -use-ocamlfind 
-tags annot,bin_annot -pkg mirage config.cmxs
www         Using configuration: /home/mirage/mirage-www/src/config.ml
www         1 job [Dispatch.Main]
www         Installing OPAM packages.
www         => opam --version
www         => opam install --yes conduit cow cowabloga crunch cstruct io-page 
lwt mirage-conduit mirage-console mirage-fs-unix mirage-http mirage-types 
mirage-unix tcpip vchan
[NOTE] Package conduit is already installed (current version is 0.7.2).
[NOTE] Package cow is already installed (current version is 1.2.1).
[NOTE] Package cowabloga is already installed (current version is 0.0.9).
[NOTE] Package crunch is already installed (current version is 1.4.0).
[NOTE] Package cstruct is already installed (current version is 1.5.0).
[NOTE] Package io-page is already installed (current version is 1.5.1).
[NOTE] Package lwt is already installed (current version is 2.4.8).
[NOTE] Package mirage-conduit is already installed (current version is 2.0.0).
[NOTE] Package mirage-console is already installed (current version is 2.1.3).
[NOTE] Package mirage-fs-unix is already installed (current version is 1.1.4).
[NOTE] Package mirage-http is already installed (current version is 2.1.0).
[NOTE] Package mirage-types is already installed (current version is 2.3.0).
[NOTE] Package mirage-unix is already installed (current version is 2.2.3).
[NOTE] Package tcpip is already installed (current version is 2.3.0).
[NOTE] Package vchan is already installed (current version is 2.0.2).
www         Generating: main.ml
~~~

The dom0 has 512M memory, maybe it would help to give it a bit more...
If I could only figure out how!  `sudo xl mem-set` fails with a rather
surprising error:

    libxl: error: libxl.c:4075:libxl_set_memory_target: cannot get memory info 
from /local/domain/0/memory/static-max : No such file or directory

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus@xxxxxxxxxxxx   jabber: magnus@xxxxxxxxxxxx
twitter: magthe               http://therning.org/magnus

Never be afraid to try something new. Remember, amateurs built the
ark; professionals built the Titanic.
     -- Anonymous

Attachment: pgpcfw6EGb1tL.pgp
Description: PGP signature

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.