Since my full-tower 10 hdd raid5 server is apparently making too much noise and polluting the air in the room too much (can’t imagine why, just because it has 6 fans?), I bought a NAS as a first step towards replacing the server with something less.. bulky. I got a Synology DS411j NAS, and have spent the last 24h moving data around so that I could use 4 existing WD 1.5 TB drives in it. Seems to be working very well so far and the Synology web gui (DSM) is quite impressive. However, it doesn’t have Unison and if there is one thing I need it’s Unison!
Luckily it is possible to install it:
- Follow the Synology guide for installing ipkg/bootstrapping your NAS. (The DS411j has a Marvel Kirkwood mv6281 ARM processor.)
- Install the required packages with: ipkg install ocaml make gcc
- Now the tricky part, for me Unison didn’t compile initially due to errors in /opt/arm-none-linux-gnueabi/lib/libpthread-2.5.so. Somehow this library is not the correct version, but the correct version IS installed in /lib.
Fix this by deleting the symlink /opt/arm-none-linux-gnueabi/lib/libpthread.so.0, and creating a new one to /lib using: ln -s /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/libpthread/ - Then download the unison source code somewhere (eg /volume1/@tmp), go there and run: make UISTYLE=text NATIVE=false
- There might be some error messages, but in the end a functional unison binary is created!
- Copy the binary to for example /opt/bin. Set up SSH keys for the root account, and we’re all set!

#1 by Vans on August 14, 2011 - 12:20
Hi there,
I tried the steps above on a DS211j and unison 2.40.63 sources,
but got stuck linking with the following error:
ocamlc -I lwt -I ubase -I system -I system/generic -I lwt/generic -custom -g -ccopt “-o “/volume1/@tmp/unison-2.40.63/osxsupport.o -c /volume1/@tmp/unison-2.40.63/osxsupport.c
ocamlopt: pty.c —> pty.o
ocamlc -I lwt -I ubase -I system -I system/generic -I lwt/generic -custom -g -ccopt “-o “/volume1/@tmp/unison-2.40.63/pty.o -c /volume1/@tmp/unison-2.40.63/pty.c
ocamlopt: bytearray_stubs.c —> bytearray_stubs.o
ocamlc -I lwt -I ubase -I system -I system/generic -I lwt/generic -custom -g -ccopt “-o “/volume1/@tmp/unison-2.40.63/bytearray_stubs.o -c /volume1/@tmp/unison-2.40.63/bytearray_stubs.c
Linking unison
ocamlc -verbose -I lwt -I ubase -I system -I system/generic -I lwt/generic -custom -g -o unison unix.cma str.cma bigarray.cma ubase/rx.cmo unicode_tables.cmo unicode.cmo bytearray.cmo system/system_generic.cmo system/generic/system_impl.cmo system.cmo ubase/projectInfo.cmo ubase/myMap.cmo ubase/safelist.cmo ubase/uprintf.cmo ubase/util.cmo ubase/uarg.cmo ubase/prefs.cmo ubase/trace.cmo ubase/proplist.cmo lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo lwt/generic/lwt_unix_impl.cmo lwt/lwt_unix.cmo case.cmo pred.cmo uutil.cmo fileutil.cmo name.cmo path.cmo fspath.cmo fs.cmo fingerprint.cmo abort.cmo osx.cmo external.cmo props.cmo fileinfo.cmo os.cmo lock.cmo clroot.cmo common.cmo tree.cmo checksum.cmo terminal.cmo transfer.cmo xferhint.cmo remote.cmo globals.cmo fpcache.cmo update.cmo copy.cmo stasher.cmo files.cmo sortri.cmo recon.cmo transport.cmo strings.cmo uicommon.cmo uitext.cmo test.cmo main.cmo linktext.cmo osxsupport.o pty.o bytearray_stubs.o -cclib -lutil
+ gcc -o ‘unison’ ‘-Llwt’ ‘-Lubase’ ‘-Lsystem’ ‘-Lsystem/generic’ ‘-Llwt/generic’ ‘-L/opt/lib/ocaml’ ‘/tmp/camlprim3e1bfe.c’ ‘-lbigarray’ ‘-lcamlstr’ ‘-lunix’ ‘osxsupport.o’ ‘pty.o’ ‘bytearray_stubs.o’ ‘-lutil’ ‘-lcamlrun’ -I’/opt/lib/ocaml’ -lm -ldl -lpthread
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
File “_none_”, line 1, characters 0-1:
Error: Error while building custom runtime system
make: *** [unison] Error 2
Any Idea, what’s the problem here?
regards, vans
#2 by LAV on August 30, 2011 - 23:39
It’s been a while since I did that, but are you sure the binary was not build? I remember getting a bunch of error messages, but in the end the binary was still built.
#3 by Jonathan on August 26, 2011 - 04:05
Thanks for the tip, it worked for me on a DS211.
#4 by a4refillpad on September 19, 2011 - 14:43
Hi,
Any chance I can download the text arm binary for unison from you? Having problems compiling it on my nas.
Kind Regards,
wayne
#5 by Jason on December 6, 2011 - 23:43
Cool it works!
I have a DS1511+ (i686 processor) and it worked like a charm. Step 3) was not required.
Thanks a lot for your help!
#6 by Thomas on January 25, 2012 - 21:41
It worked for DS411 after changing
/opt/arm-none-linux-gnueabi/lib/libpthread.so.0 -> libpthread-2.5.so
to
ln -s /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
as suggested in the “trackbacks”.
I reveived the error messages “tr: not found” and “bash” not found” and “etags: not found” but the unison file was created anyway.
Thanks! Thomas
#7 by Moritz on February 11, 2012 - 19:42
Hi,
Worked great for me with DS211.
I had to use the following library fixes (from http://blog.thomas-lauria.de/archives/19-unison-auf-Synology-DS211.html):
delete: /opt/arm-none-linux-gnueabi/lib/libpthread.so.0 -> libpthread-2.5.so
create: ln -s /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
I also got some errors, but the binary was built.
Moritz