How to compile Unison for a Synology DS212+

Edit (May 15, 2020): An updated guide for newer Synology devices can be found here:
How to compile unison for a Synology NAS (DSM 6.2)

(Originally posted Aug 18, 2012)
This guide explains how to compile and install Unison on your Synology DS212+ NAS.

Compiling Unison

  • Install the dependencies
    sudo ipkg install ocaml make gcc textutils
  • Fix the pthreads library symlink (Borrowed from this site)
    sudo rm /opt/arm-none-linux-gnueabi/lib/
    sudo ln -s /lib/ /opt/arm-none-linux-gnueabi/lib/
  • Get the latest unison
  • Unpack unison
    tar zxvf unison-2.40.63.tar.gz
  • Change dir
    cd unison-2.40.63
  • Build (text version)
    make UISTYLE=text NATIVE=false
  • Install
    sudo cp unison /opt/bin

Testing Unison

  • unison -version
    unison version 2.40.63
    unison -selftest
    Contacting server...
    Running internal tests...
    backups 1 (local)...
    backups 2...
    backups 2a...
    backups 3...
    backups 4...
    backups 5 (directories)...
    backups 6 (backup prefix/suffix)...
    links 1 (directories and links)...
    links 2 (symlink to nowhere)...
    Success :-)
  • Clean up
    rm -Rf test-a.tmp
    rm -Rf test-b.tmp

17 Comment



    sadly I get an error message during compiling unison:

    make tags
    tail: `-1′ option is obsolete; use `-n 1′
    Try `tail –help’ for more information.
    tail: `-1′ option is obsolete; use `-n 1′
    Try `tail –help’ for more information.
    /bin/sh: bash: not found
    make[1]: Entering directory `/volume1/@tmp/unison-2.40.63′
    if [ -f `which etags` ]; then \
    etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
    ; fi
    /bin/sh: etags: not found
    make[1]: [tags] Error 127 (ignored)

    Any idea why?

    Best regards


    16 Nov 2012 | Reply

  1. Anonymous

    I came across this error as well when compiling for x86. Build still produced a usable executable. Others have had the same result:

    07 Feb 2013 | Reply

    • OLiver Rettig

      I run into the same error:

      make tags
      make[1]: Entering directory `/volume1/public/unison-2.40.102′
      if [ -f `which etags` ]; then \
      etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
      ; fi
      /bin/sh: etags: not found
      make[1]: [tags] Error 127 (ignored)
      make[1]: Leaving directory `/volume1/public/unison-2.40.102′

      compiling on a DS213

      18 Sep 2013 | Reply

  2. Markus

    Just wanna say a big thank you! Your very simple but essential instructions helped my to set up sync between 2 Synology Diskstations.
    Have a good time,
    greetings from Vienna!

    15 Sep 2013 | Reply

  3. Martn Rüegg


    i had to install
    # ipkg install ncurses
    as well.

    i’ve compiled unison version 2.40.102 on a DS213+. this model is equipped with a PPC cpu, thus the above mentioned directory /opt/arm-none-linux-gnueabi is equivalent to the directory /opt/powerpc-linux-gnuspe as it is found on this system.

    so instead of
    # sudo rm /opt/arm-none-linux-gnueabi/lib/
    # sudo ln -s /lib/ /opt/arm-none-linux-gnueabi/lib/

    i run (as root):
    # rm /opt/powerpc-linux-gnuspe/lib/
    # ln -s /lib/ /opt/powerpc-linux-gnuspe/lib/

    but i found additional libraries that had invalid refernces. so i did the same for libm and libdl:
    # rm /opt/powerpc-linux-gnuspe/lib/
    # ln -s /lib/ /opt/powerpc-linux-gnuspe/lib/
    # rm /opt/powerpc-linux-gnuspe/lib/
    # ln -s /lib/ /opt/powerpc-linux-gnuspe/lib/

    additionally i had to do a similar workaround for libncurses:
    # rm /opt/lib/
    # ln -s /lib/ /opt/lib

    the error with the ‘etags” appeared as well. i just ignored it. the unison-binary created worked well.


    25 Sep 2013 | Reply

  4. davec

    # I can confirm that the following worked for me on a DS212+ running DSM 5.0-4482
    # Note the extra step to avoid ‘undefined reference to `_dl_tls_get_addr_soft@GLIBC_PRIVATE” compile errors

    ipkg install ocaml make gcc textutils

    rm /opt/arm-none-linux-gnueabi/lib/
    ln -s /lib/ /opt/arm-none-linux-gnueabi/lib/

    rm /opt/arm-none-linux-gnueabi/lib/
    ln -s /lib/ /opt/arm-none-linux-gnueabi/lib/

    cd /volume1/@tmp

    tar xf unison-2.40.65.tar.gz
    cd unison-2.40.65/

    make clean
    make mkProjectInfo
    make NATIVE=false UISTYLE=text CFLAGS=”-cclib -L/lib”

    cp ./unison /opt/bin/

    cd /volume1/@tmp
    rm -rf unison-2*

    unison -version

    01 May 2014 | Reply

  5. michele

    Thank you! I ALMOST got it to work on a DS1513+ with the latest DSM 5.
    I compiled, but it was segfaulting. Out of desperation I tried to compile on my laptop (Ubuntu 14.04) copied the executable, and copied from my /usr/lib64 to /lib64 on the NAS.
    It just works!

    17 Jul 2014 | Reply

  6. Piotr58

    On DSM 5 I have some trouble.

    1) ln on libpthread
    The directory “/opt/arm-none-linux-gnueabi” depend on processor with intel it must be “”

    2) Makefile.Ocaml prepend we have “emacs”
    Makefile.Ocaml use “etags” and “etags” is a part of emacs so we must install it with:
    sudo ipkg install emacs22

    3) Makefile.Ocaml use “tail -1”
    and this use is obsolete. So We must modify the file from “tail -1” to “tail -n 1” (3 occurs)

    4) Makefile.Ocaml refer “bash”
    On line 324, we have:
    # ifeq ($(shell echo type -t ocamldot | bash), file)
    but my Synology rs3412 and DSM 5 only have “ash”!
    So, we must also install it or modify the Makfile…

    Finaly, the compilation seem to be ok but, like “michele”, I have a “Segmentation fault”. So, Ihave done like Michele from the unison on our Debian server…

    23 Sep 2014 | Reply

  7. Michael Naylor

    Found 1 additional sym link needed to get complie working on DS211j using DSM 5.1-5022 Update 2
    ln -s /lib/ /opt/arm-none-linux-gnueabi/lib/

    16 Feb 2015 | Reply

  8. john

    Thank you thank you thank you thank you!!!

    24 Apr 2016 | Reply

  9. Mark

    As this is one of the first results when googling for unison on synology, here’s some updated news:

    13 Oct 2019 | Reply

    • Thanks! I’ve updated the guide and also linked to that github issue.

      15 May 2020 | Reply

  1. NAS Synology : synchronisation bidirectionnelle avec Unison | Kaliseo
  2. Thias の blog » Blog Archive » Building Unison 2.32 for Synology DS211
  3. Building Unison 2.32 for Synology DS211 | Thias の blog

Leave a reply