Page 1 of 1

Unison qpackage

Posted: Sat Jan 21, 2012 10:28 pm
by fedoralinux
At first, yes, i know there is a downloadable unison package for qnap, but i need an out of the box package for the latest version
http://www.cis.upenn.edu/~bcpierce/unison/
http://www.seas.upenn.edu/~bcpierce/uni ... es/stable/

i got the latest version on my linux pc, and now i need a latest version for qnap device
thanks

Re: Unison qpackage

Posted: Sun Feb 26, 2012 11:04 pm
by avaterera
+1 for Unison qpkg. There is version only for ARM (as far as I know) and we need it for x86.

Re: Unison qpackage

Posted: Thu Mar 01, 2012 4:49 am
by johnripper

Re: Unison qpackage

Posted: Thu Mar 08, 2012 11:00 pm
by trejder
Hi,

fedoralinux wrote:At first, yes, i know there is a downloadable unison package for qnap, but i need an out of the box package for the latest version

Many people around this forum keeps talking about Unison package designed specially for QNAP? But where can I get it? There is no such package in QPKG repository and on Unison project website you can only download latest overall version, with no specific releases for either QNAP or any other system / NAS.

So? There is or there isn't ready out-of-the-box solution for getting Unison to QNAP? Can I get it fast or do I need to follow whole procedure of recompilation and instalation, covered in official release documentation?

Cheers,
Trejder

Re: Unison qpackage

Posted: Wed May 18, 2016 1:46 am
by ulikio
I absolutely need it too!!! +1

Unison working under Entware-ng (DEPRECATED)

Posted: Thu May 19, 2016 5:14 am
by ulikio
* * * 2019.02.03: GIVEN NEW 64BIT QNAP Hardware TS-453B PLEASE SEE MY UPDATED INSTALL HOWTO BELOW. This procedure only works for my older 32bit Intel system * * *

Alright, I spent two nights on this and finally got a solution that works for me (QNAP TS-439 Pro / Intel CPU). Result: get a working unison binary to use even under stupid entware

The steps I followed
- Deinstall any Qnapware / Entware / whatever-ware
- Optware is depricated but you will still need it temporarily to compile unison using the native ocaml ikpg (get it somewhere on the web & install. filename: Optware_0.99.163_x86.qpkg through QNAP web interface. I found it under: http://forum.qnapclub.de/viewtopic.php?f=67&t=655)
- ipkg update
- ipkg upgrade
- ipkg install ocaml make gcc
- wget http://www.seas.upenn.edu/~bcpierce/uni ... 8.3.tar.gz
- mv unison-2.48.3.tar.gz /share/Public <<--- you need this, ocaml compliation will fail otherwise (if there's a space in the path for instance)
- tar xvfz unison-2.48.3.tar.gz
- cd unison-2.48.3
- make clean
- make NATIVE=false UISTYLE=text
- you will get an error message saying "etags - command not found" - binary is built anyway and usable
- copy unison (binary file) to somewhere safe and /opt/bin if you want to use it
----------------- we could stop here if we wanted to stick with Optware, but we don't ------------------
- now deinstall Optware (through Web interface)
- install Entware-ng
- copy unison binary to whereever you want to use it (you don't need ocaml anymore)

Re: Unison qpackage

Posted: Thu May 19, 2016 1:45 pm
by trejder
Thank you for your comprehensive research and for writing this guide. Congratulations on your success!

However, you have replied to FOUR years old topic / question. Yes, I'm still using my old TS-210 and I still wonder, how it is possible, that it still works fine (after six years), but I certainly had to develop some alternative solution back in 2012. That solution was named "Dropbox" (now "OneDrive").

Again, thank you for sharing your thoughts. I hope, this guide will help someone, who is in desperate need to use Unison on QNAP-like devices.

Re: Unison qpackage

Posted: Fri May 20, 2016 1:13 am
by halol
No harm in reviving old threads! It is still useful to some people (me, for example!)

I used to have an ARM based TS-219P II and have been using unison successfully for a long time. What I noticed when building unison back then was that if I was using the ocaml version provided with Optware, unison would be extremely slow (because of the NATIVE=false flag required with the OOTB ocaml).

The solution for me was to build ocaml as well. Here are the steps I followed at the time:

Compile ocaml:
- get the ocaml 3.12.0 sources from: http://ipkg.nslu2-linux.org/sources/
- tar xvfz ocaml-3.12.0.tar.gz
- configure -prefix /opt
- make world
- make opt
- make install
=> chech that ocamlc and ocamlopt are working

Then build unison:
- ipkg install emacs
- get Unison latest sources (pick up a version compatible with the one of your other machines) and extract them
- make UISTYLE=text

And I would get much much better performances like this (you can drop the NATIVE=false when compiling).

---

Now, I just upgraded to a TVS-663, 64bits and Intel based. The problems started... and I too just spent 2 days pulling my hair trying to get this working!

Here is what I did, as this is a slightly different solution:
- Install Entware using the 64 bits package

As in the past, first compile ocaml. There are a few differences though:
- first, Unison apparently doesn't compile with the version > 4. So get ocaml-3.12.1.
- ./configure -prefix /opt -no-shared-libs -no-curses (not sure which options are absolutely needed here, that's just what worked for me)
- create links to some Entware librairies (otherwise the build process uses 32bit default libraries from /lib and fails. Of course this may not be needed if you have a 32bit architecture):
ln -s /opt/lib/libm-2.23.so /lib64/libm.so.6
ln -s /opt/lib/libdl-2.23.so /lib64/libdl.so.2
ln -s /opt/lib/libncurses.so /lib64/libncurses.so.6
- ldconfig
- make world, make opt and make install

Then compile ctags/etags
- download the sources from http://ctags.sourceforge.net/
- ./configure --prefix=/opt --enable-etags
- make
- make install

Finally, build Unison:
- make UISTYLE=text
- ln -s /opt/lib/libutil-2.23.so /lib64/libutil.so.1 (required to run Unison)
- ldconfig
- test that the binary is working

=> done! well... almost

Any link created in /lib64 will be removed after a reboot, which will break Unison (and ocaml). Beside I don't think that it would be a very good idea to make those libs available system wide as they may disrupt other applications...
So here is what I did:
- mkdir /opt/usr/local/libunison
- create all the links in this directory:
ln -s /opt/lib/libm-2.23.so /opt/usr/local/libunison/libm.so.6
ln -s /opt/lib/libdl-2.23.so /opt/usr/local/libunison/libdl.so.2
ln -s /opt/lib/libncurses.so /opt/usr/local/libunison/libncurses.so.6
ln -s /opt/lib/libutil-2.23.so /opt/usr/local/libunison/libutil.so.1
- mv /opt/bin/unison /opt/bin/unison-bin
- vi /opt/bin/unison (to create a new script), with the following content:

Code: Select all

    #!/bin/sh
    LD_LIBRARY_PATH=/opt/usr/local/libunison
    unison-bin $@

- chmod +x unison

=> you can call Unison using the 'unison' command as usual

Hope this helps!

Re: Unison qpackage

Posted: Tue Aug 30, 2016 1:31 pm
by blackdog
Here is the tutorial to install unison precompiled binary without optware

http://gayberti.de/2016/02/07/unison-au ... atisieren/

Re: Unison qpackage

Posted: Fri Nov 02, 2018 3:32 am
by nickma

"www.gayberti.de Server not found"

Re: Unison qpackage

Posted: Sun Nov 04, 2018 4:49 am
by nickma
I just built unison on my TS-228A using armv8 (aka aarch64) Entware-ng [1] and halol's how to.
halol wrote:The solution for me was to build ocaml as well. Here are the steps I followed at the time:
[...]
Hope this helps!

Thank you so much, it did help!

[1] http://bin.entware.net/aarch64-k3.10/installer/generic.sh

Re: Unison qpackage

Posted: Sun Feb 03, 2019 10:40 pm
by ulikio
hi guys

thanks halol for your indepth update howto. @Trejder, I agree there's no harm in reviving old threads if people keep using (good) software. I have several QNAP's, now a 64bit Intel based TS-453B with firmware 4.3.6.0805 (2018/12/28) installed. I tried my own procedure posted above and it didn't work anymore. tried Halol's, failed on the OCAML compilation. I'm not an expert user so kept searching and found this easy procedure to work for me
- export PATH=$PATH:/opt/bin:/opt/sbin
- deinstall Optware (through Web interface) if installed, it's deprecated
- find entware (2019.02.03: https://github.com/Entware/Entware/wiki ... n-QNAP-NAS) as of QNAP firmware: 4.3.6.0805)
- install Entware-ng through web-UI
- install essential entware packages via ssh/console (package list: https://pkg.entware.net/binaries/armv7/Packages.html)
opkg update & opkg upgrade
opkg install coreutils binutils shadow-su less
- cd /share/Public <<--- you need this, ocaml compliation will fail otherwise (if there's a space in the path for instance)
- wget http://caml.inria.fr/pub/distrib/ocaml- ... 2.0.tar.gz
- tar xvfz ocaml-4.02.0.tar.gz
- cd ocaml-4.02.0
- ./configure -prefix /opt
- make world.opt
- make install
- wget https://www.seas.upenn.edu/~bcpierce/un ... 8.3.tar.gz
- cd ../unison-2.48.3
- make clean
- make UISTYLE=text
- you will get an error message saying "etags - command not found" - binary is built anyway and usable
- chmod 755 unison unison-fsmonitor
- cp unison /opt/bin/ && cp unison-fsmonitor /opt/bin/ <-- copy unison (binary file) to somewhere within the path

Re: Unison qpackage

Posted: Tue Mar 12, 2019 2:25 am
by gordwait
I had to add:

opkg install gcc
opkg install make

to your instructions, otherwise, looks like I have a copy of Unison on my QNAP - thanks!
(Now to see if it works ;)

Re: Unison qpackage

Posted: Mon Jul 22, 2019 11:09 pm
by Novaldex
Thanks ulikio & gordwait, your two posts helped me figure it out too.

I know it's now a slightly older topic, but as I ran into some issues on my system, i've been able to get it running with more up to date components. I also do not have Optware installed, and a reasonably up to date version of Entware already installed too, so these steps are missing below.

TS-420 (Arm), QTS 4.3.3
OCaml 4.06.1
Unison 2.51.2

Base steps:
  • Set correct path variable:

    Code: Select all

    export PATH=$PATH:/opt/bin:/opt/sbin
  • Update opkg:

    Code: Select all

    opkg update & opkg upgrade
  • Install essential packages:

    Code: Select all

    opkg install coreutils binutils shadow-su less gcc make
  • Change to good working directory:

    Code: Select all

    cd /share/Public
Build OCaml
  • Fetch OCaml source:

    Code: Select all

    wget https://caml.inria.fr/pub/distrib/ocaml-4.06/ocaml-4.06.1.tar.gz
  • Unpack:

    Code: Select all

    tar xvfz ocaml-4.06.1.tar.gz
  • Enter source directory:

    Code: Select all

    cd ocaml-4.06.1
  • Configure source:

    Code: Select all

    ./configure -prefix /opt
  • Leave OCaml source directory:

    Code: Select all

    cd /share/Public
Build Unison
  • Fetch Unison source:

    Code: Select all

    wget https://www.seas.upenn.edu/~bcpierce/unison/download/releases/unison-2.51.2/unison-2.51.2.tar.gz
  • Make working directory for build:

    Code: Select all

    mkdir unison-2.51.2
  • Enter working directory:

    Code: Select all

    cd unison-2.51.2
  • Unpack source archive:

    Code: Select all

    tar xvfz ../unison-2.51.2.tar.gz
  • Clean source before build:

    Code: Select all

    make clean
  • Build text version only:

    Code: Select all

    make UISTYLE=text
  • Set permissions on files:

    Code: Select all

    chmod 755 unison unison-fsmonitor
  • Copy files to usable location:

    Code: Select all

    cp unison /opt/bin/ && cp unison-fsmonitor /opt/bin/
Once done I was able to test the version with:

Code: Select all

unison -version
which gave me:

Code: Select all

unison version 2.51.2 (ocaml 4.06.1)
I'm now away to test it further, hope the above helps others

Re: Unison qpackage

Posted: Sun Oct 13, 2019 8:06 pm
by halol
I had to upgrade to OCaml 4.09 to stay compatible with my clients, and I ran into a problem. Here is how I solved it:

- get the ocaml 4.09.0 sources from: https://ocaml.org/releases/
- tar xvfz ocaml-4.09.0.tar.gz
- cd ocaml-4.09.0
- vi tools/check-parser-uptodate-or-warn.sh and replace (line 35)

Code: Select all

else MTIME="stat -f %m"
with

Code: Select all

else MTIME="stat -c %Y"

- ./configure -prefix /opt
- make world.opt
- make install

Hope this helps.