Compilation ARM64 - DONE

compiling
compiliation
arm64
aarch64
arm

#1

TL:DR; I managed to fix all the issues, check the post bellow for detailed compile instructions or just grab my complied version for ARM64. https://cdn.iklive.eu/tcb13/2018/seafile-server_6.3.0_arm64.tar.gz


So I own a ARM64 device and I would like to compile seafile server from the source code for it. So there is this page on the manual about compiling Seafile on raspberry pi and since I’m running on a ARM device it should be similar. In theory it is easy, however I’ve encountered issues try after try, fix after fix.

Here is my current compilation process. I’m buying everything to the /mnt/SU1/apps/seafile/dev dir:

sudo apt-get install build-essential
sudo apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmariadbclient-dev-compat libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-setuptools cmake

mkdir -p /mnt/SU1/apps/seafile/dev
cd /mnt/SU1/apps/seafile/dev

export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/seafile-server/lib:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/libsearpc:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/ccnet-server:$PKG_CONFIG_PATH

git clone https://github.com/haiwen/libsearpc.git
cd libsearpc
git reset --hard v3.1-latest
./autogen.sh
./configure
make
make dist

cd ..
git clone https://github.com/haiwen/ccnet-server.git
cd ccnet-server
git reset --hard v6.3.0-server
./autogen.sh
./configure
make dist

Now here I have my first roadblock, there a compilation error related to libssl. I managed to fix this by applying the patch here: https://github.com/haiwen/ccnet/commit/445b72e52895431d02f5f6380a773409c689d8ea

So first question: why is this merged to ccnet but not to ccnet-server? Not really a issue but okay.

I proceeded with the compilation process after applying the patch and trying again:

cd ..
git clone ...github-com/haiwen/seafile-server.git
cd seafile-server
git reset --hard v6.3.0-server
./autogen.sh
./configure
make dist

And… roadblock two. Another libssl issue. Fix available here https://github.com/haiwen/seafile-server/pull/151/files, once again not merged.

I proceeded with the compilation process after applying the patch and trying again (links removed because I’m a new user):

cd ..
git clone ...github.com/haiwen/seahub.git
cd seahub
git reset --hard v6.3.0-server
./tools/gen-tarball.py --version=6.3.0 --branch=HEAD

cd ..
git clone ...github.com/haiwen/seafobj.git
cd seafobj
git reset --hard v6.3.0-server
make dist

cd ..
git clone ...github.com/haiwen/seafdav.git
cd seafdav
git reset --hard v6.3.0-server
make

cd ..
mkdir seafile-sources
cp libsearpc/libsearpc-*.tar.gz seafile-sources
cp ccnet-server/ccnet-*.tar.gz seafile-sources
cp seafile-server/seafile-*.tar.gz seafile-sources
cp seahub/seahub-*.tar.gz seafile-sources
cp seafobj/seafobj.tar.gz seafile-sources
cp seafdav/seafdav.tar.gz seafile-sources

cd ..
mkdir seahub_thirdpart; cd seahub_thirdpart

wget [all the recommended stuff, had to cut out because I'm a new user]

mv bde7f7c.zip django_constance.zip

export PYTHONPATH=.
easy_install -d . pytz-2016.1.tar.gz
easy_install -d . Django-1.8.18.tar.gz
easy_install -d . django-statici18n-1.1.3.tar.gz
easy_install -d . djangorestframework-3.3.2.tar.gz
easy_install -d . django_compressor-1.4.tar.gz
easy_install -d . jsonfield-1.0.3.tar.gz
easy_install -d . django-post_office-2.0.6.tar.gz
easy_install -d . gunicorn-19.4.5.tar.gz
easy_install -d . flup-1.0.2.tar.gz
easy_install -d . chardet-2.3.0.tar.gz
easy_install -d . python-dateutil-1.5.tar.gz
easy_install -d . six-1.9.0.tar.gz
easy_install -d . django-picklefield-0.3.2.tar.gz
easy_install -d . django_constance.zip
easy_install -d . jdcal-1.2.tar.gz
easy_install -d . et_xmlfile-1.0.1.tar.gz
easy_install -d . openpyxl-2.3.0.tar.gz

At this point everything look just fine no more errors, all the extra python dependencies are installed etc. Now it was time to run seafile-server/scripts/build/build-server.py in order to build everything.

Roadblock 3: build-server.py fails because it can find the versions I set:

seafile-server/scripts/build/build-server.py 
--version=6.3.0
--libsearpc_version=3.0.8 
--ccnet_version=6.3.0 
--seafile_version=6.3.0  
--thirdpartdir=/mnt/SU1/apps/seafile/dev/seahub_thirdpart 
--srcdir=/mnt/SU1/apps/seafile/dev/seafile-sources 
--outputdir=/mnt/SU1/apps/seafile/dev/seafile-server-pkgs

As you can see above I always did git reset --hard v6.3.0-server to force version 6.3.0 of everything however due to some reason I don’t understand the make dist command built ccnet as ccnet-6.0.1.tar.gz… Why? Just why?

I ended up renaming a bunch of files to 6.0.1 and run:

seafile-server/scripts/build/build-server.py 
--version=6.3.0
--libsearpc_version=3.0.8 
--ccnet_version=6.0.1 
--seafile_version=6.0.1
--thirdpartdir=/mnt/SU1/apps/seafile/dev/seahub_thirdpart 
--srcdir=/mnt/SU1/apps/seafile/dev/seafile-sources 
--outputdir=/mnt/SU1/apps/seafile/dev/seafile-server-pkgs

And it was working until… roadblock 4: some error with ldap. Since I didn’t want it I simply edited build-server.py and removed --enable-ldap.

Tried to compile again, no more ldap error however… roadblock 5:

[INFO] ------------------------------------------
[INFO] Seafile server 6.3.0: BUILD INFO
[INFO] ------------------------------------------
[INFO] seafile:          6.0.1
[INFO] ccnet:            6.0.1
[INFO] libsearpc:        3.0.8
[INFO] builddir:         /tmp/seafile-server-build
[INFO] outputdir:        /mnt/SU1/apps/seafile/dev/seafile-server-pkgs
[INFO] source dir:       /mnt/SU1/apps/seafile/dev/seafile-sources
[INFO] strip symbols:    True
[INFO] s3 support:       None
[INFO] clean on exit:    True
[INFO] ------------------------------------------
[INFO] press any key to continue 
[INFO] ------------------------------------------

[...lots of make output...]

[INFO] Uncompressing seahub
Traceback (most recent call last):
  File "seafile-server/scripts/build/build-server.py", line 905, in <module>
    main()
  File "seafile-server/scripts/build/build-server.py", line 899, in main
    seahub.build()
  File "seafile-server/scripts/build/build-server.py", line 252, in build
    self.write_version_to_settings_py()
  File "seafile-server/scripts/build/build-server.py", line 261, in write_version_to_settings_py
    with open(settings_py, 'a+') as fp:
IOError: [Errno 2] No such file or directory: '/tmp/seafile-server-build/seahub-6.0.1/seahub/settings.py'
[INFO] remove builddir before exit

Now, I tried to run the script with the --keep option and inspected /tmp/seafile-server-build/:

ls /tmp/seafile-server-build/
ccnet-6.0.1  libsearpc-3.0.8  seafile-6.0.1  seafile-server  seahub-6.3.0

Turns out… my previous fix for the version mismatch crap just blew on my face here. :frowning:

Why is there so many things actually broken in the major version 6.3.0? What am I doing wrong here? I tried other versions and the issues are the same. Why am I doing git reset --hard v6.3.0-server to force version 6.3.0 and some stuff builds as 6.0.1?

Is it normal to have so many roadblocks in compiling seafile? I mean, I’m just following the manual and nothing works as expected. How can I make this work?

Thank you.


6.2.5 seahub 500 ISE and ImportError
#2

I managed to fix all the issues above, here is how anyone can compile v6.3.0 potentially on every device out there.

Note: the directory I used to build this is /mnt/SU1/apps/seafile/dev/. Change it to yours.
Note 2: I’m building with MySQL support, but using MariaDB hence libmariadbclient-dev-compatand libmariadb-dev

sudo apt-get install build-essential
sudo apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmariadbclient-dev-compat libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-setuptools cmake libmariadb-dev

mkdir -p /mnt/SU1/apps/seafile/dev
cd /mnt/SU1/apps/seafile/dev

export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/seafile-server/lib:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/libsearpc:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/ccnet-server:$PKG_CONFIG_PATH

git clone -b v3.1-latest --single-branch https://github.com/haiwen/libsearpc.git
cd libsearpc
./autogen.sh
./configure
make
make dist

cd ..
git clone -b v6.3.0-server --single-branch https://github.com/haiwen/ccnet-server.git
cd ccnet-server
#(the following line applies PR ID=23 that fixes libssl/openssl related issues)
curl https://patch-diff.githubusercontent.com/raw/haiwen/ccnet-server/pull/23.patch | git apply -v --index
./autogen.sh
./configure 
make dist

cd ..
git clone -b v6.3.0-server --single-branch https://github.com/haiwen/seafile-server.git
cd seafile-server
#(the following line applies PR ID=151 that fixes libssl/openssl related issues)
curl https://patch-diff.githubusercontent.com/raw/haiwen/seafile-server/pull/151.patch | git apply -v --index

Now you need to manually edit the file configure.ac and replace 6.0.1 with the proper version 6.0.3:

AC_INIT([seafile], [6.3.0], [freeplant@gmail.com]) // corrigir versão

Now you can continue:

./autogen.sh
./configure
make dist

cd ..
git clone https://github.com/haiwen/seahub.git
cd seahub
git reset --hard v6.3.0-server
./tools/gen-tarball.py --version=6.3.0 --branch=HEAD

cd ..
git clone https://github.com/haiwen/seafobj.git
cd seafobj
git reset --hard v6.3.0-server
make dist

cd ..
git clone https://github.com/haiwen/seafdav.git
cd seafdav
git reset --hard v6.3.0-server
make

cd ..
mkdir seafile-sources
cp libsearpc/libsearpc-*.tar.gz seafile-sources
cp ccnet-server/ccnet-*.tar.gz seafile-sources
cp seafile-server/seafile-*.tar.gz seafile-sources
cp seahub/seahub-*.tar.gz seafile-sources
cp seafobj/seafobj.tar.gz seafile-sources
cp seafdav/seafdav.tar.gz seafile-sources

If everything was okay then:

ls -l seafile-sources
	-rw-r--r-- 1 root root  600808 May 14 02:55 ccnet-6.0.1.tar.gz
	-rw-r--r-- 1 root root  396582 May 14 02:54 libsearpc-3.0.8.tar.gz
	-rw-r--r-- 1 root root  163804 May 14 02:56 seafdav.tar.gz
	-rw-r--r-- 1 root root 1132739 May 14 02:55 seafile-6.0.1.tar.gz
	-rw-r--r-- 1 root root    8498 May 14 02:56 seafobj.tar.gz
	-rw-r--r-- 1 root root 9140398 May 14 02:56 seahub-6.0.3.tar.gz

Now lets take care of python dependencies:

mkdir seahub_thirdpart;
cd seahub_thirdpart

wget https://pypi.python.org/packages/source/p/pytz/pytz-2016.1.tar.gz;
wget https://www.djangoproject.com/m/releases/1.8/Django-1.8.18.tar.gz;
wget https://pypi.python.org/packages/source/d/django-statici18n/django-statici18n-1.1.3.tar.gz;
wget https://pypi.python.org/packages/source/d/djangorestframework/djangorestframework-3.3.2.tar.gz;
wget https://pypi.python.org/packages/source/d/django_compressor/django_compressor-1.4.tar.gz;
wget https://pypi.python.org/packages/source/j/jsonfield/jsonfield-1.0.3.tar.gz;
wget https://pypi.python.org/packages/source/d/django-post_office/django-post_office-2.0.6.tar.gz;
wget http://pypi.python.org/packages/source/g/gunicorn/gunicorn-19.4.5.tar.gz;
wget http://pypi.python.org/packages/source/f/flup/flup-1.0.2.tar.gz;
wget https://pypi.python.org/packages/source/c/chardet/chardet-2.3.0.tar.gz;
wget https://labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz;
wget https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz;
wget https://pypi.python.org/packages/source/d/django-picklefield/django-picklefield-0.3.2.tar.gz;
wget https://github.com/haiwen/django-constance/archive/bde7f7c.zip;
wget https://pypi.python.org/packages/source/j/jdcal/jdcal-1.2.tar.gz;
wget https://pypi.python.org/packages/source/e/et_xmlfile/et_xmlfile-1.0.1.tar.gz;
wget https://pypi.python.org/packages/source/o/openpyxl/openpyxl-2.3.0.tar.gz;
wget https://pypi.python.org/packages/cc/26/b61e3a4eb50653e8a7339d84eeaa46d1e93b92951978873c220ae64d0733/futures-3.1.1.tar.gz;
wget https://pypi.python.org/packages/a8/07/947dfe63dff1f2be5f84eb7f0ff5f712bb1dc730a6499b0aa0be5c8f194e/django-formtools-2.0.tar.gz;
wget https://pypi.python.org/packages/87/16/99038537dc58c87b136779c0e06d46887ff5104eb8c64989aac1ec8cba81/qrcode-5.3.tar.gz;

mv bde7f7c.zip django_constance.zip

export PYTHONPATH=.
easy_install -d . pytz-2016.1.tar.gz
easy_install -d . Django-1.8.18.tar.gz
easy_install -d . django-statici18n-1.1.3.tar.gz
easy_install -d . djangorestframework-3.3.2.tar.gz
easy_install -d . django_compressor-1.4.tar.gz
easy_install -d . jsonfield-1.0.3.tar.gz
easy_install -d . django-post_office-2.0.6.tar.gz
easy_install -d . gunicorn-19.4.5.tar.gz
easy_install -d . flup-1.0.2.tar.gz
easy_install -d . chardet-2.3.0.tar.gz
easy_install -d . python-dateutil-1.5.tar.gz
easy_install -d . six-1.9.0.tar.gz
easy_install -d . django-picklefield-0.3.2.tar.gz
easy_install -d . django_constance.zip
easy_install -d . jdcal-1.2.tar.gz
easy_install -d . et_xmlfile-1.0.1.tar.gz
easy_install -d . openpyxl-2.3.0.tar.gz

Almost done, now you’ve to fix the LDAP issue. Open the file seafile-server/scripts/build/build-server.py and look for --enable-ldap, remove it and save the file.

Now its time to build everything:

seafile-server/scripts/build/build-server.py \
--version=6.3.0 \
--libsearpc_version=3.0.8 \
--ccnet_version=6.0.1 \
--seafile_version=6.3.0  \
--thirdpartdir=/mnt/SU1/apps/seafile/dev/seahub_thirdpart \
--srcdir=/mnt/SU1/apps/seafile/dev/seafile-sources \
--outputdir=/mnt/SU1/apps/seafile/dev/seafile-server-pkgs \
--mysql_config=/usr/bin/mariadb_config

Now you’re ready to go, just follow https://manual.seafile.com/deploy/using_mysql.html on how to deploy using MySQL and your Seafile will be up and running!

Closing Note: Seafile maintainers should fix their s* and update the manual. I don’t really understand why everything is messed on this software.


Seafile server on arm64 (aarch64). - WORKING
6.2.5 seahub 500 ISE and ImportError
#3

Although there is a 6.3 tag I don’t think it has been released so far and would recommend using v6.2.5 instead.

Thank you for sharing your instructions.

I’d really like it if it were possible to build everything (client, server, closed) with a Dockerfile. The Dockerfile could just be in the repo and when one takes the one from a specific tag it builds that specific version. It would just need be run and leave the build package behind.


#4

@shoeper yeah the Dockerfile would be nice, however my way of compiling above doesn’t leave much garbage around, just a few package you can remove later with apt. But I do understand your point. It would probably work much better with Docker.

Thank for the feedback on the version 6.2.5, I will try to built it, however not sure if it will work due to the libssl patch that is required.

Are you running seafile on an ARM device? Do you notice high ram usage? In my case it is crazy. Loading seahub on a browser and clicking around is enough to waste away 80-100M of RAM :frowning: (or is it one more bug in 6.3?)

Have a nice day.


#5

@shoeper version 6.2.5 has the exact same version problem. Anyway here is my compiled version for ARM64: https://cdn.iklive.eu/tcb13/2018/seafile-server_6.3.0_arm64.tar.gz


#6

Hello, I use raspberry pie 3B+ to install seafile. Being stuck in the first step of installation, as if seafile can not be installed on ARM, I can’t understand your encoding configuration. Can you install 6.3.0’s installation package directly?


#7

If you used raspbian, you have a 32bit OS. You have to download 6.2.5 from the official download page.


#8

Only missing 3 python modules, easy to find it from error log and use pip to install them. other than that, everything is good on Ubuntu 18.04 LTS ARM64


#9

$ sudo pip install django-appconf

$ sudo pip install qrcode

$ sudo pip install django-formtools


#10

Integrated with Apache with non-root installation is good. Integrated with MySQL works well.


#11

Can someone who uses this setup write a setup guide for the community manual?


#12

I have not test the compilation steps, just use TCB13 pre-compiled package.

Some day, I want to follow the instruction and compile it by myself on Rockpro64 with Ubuntu 18.04 LTS and NVidia Jetson TX2 with Ubuntu 16.04 LTS.

Pre-compiled package works good, not sure compilation steps are detailed enough.


#13

It would be nice if you share your experience of the compilation on the community manual.


#14

You can follow my instructions, every single step and command is explained there. Except for the 3 missing python modules.


#15

I got errors when I follow the steps.
First, the 2 patches did not work for me, it said cannot apply the patch to source code line.
Second, the final build required Python 2, not Python 3. even I switch Python pointing to Python 2.7, I still got error:

---- that is on my Rock64 with Armbian Ubuntu18.04 LTS


#16

Following TCB13 instruction, move a little bit forward, I get this error in the final compilation:

upload-file.c: In function ‘upload_read_cb’:
upload-file.c:2091:12: error: ‘evhtp_request_t {aka struct evhtp_request_s}’ has no member named ‘keepalive’

TCB13: Could you help me on it? thanks in advance!

(comment, at beginning of TCB13 instruction, adding one more missing package: sudo apt install libevhtp-dev)

That is on my Rockpro64 with Ubuntu 18.04LTS, switch GCC 7 to GCC 6


#17

Finally, I built it –


The build is successful. Output is: /media/SATA/apps/seafile/dev/seafile-server-pkgs/seafile-server_6.3.0_i386.tar.gz

LOl – I should replace _i386 with _arm64.

It is on my Nvidia Jeson TX2, Ubuntu 16.04 LTS
$ uname -a
Linux 4.4.38-tegra #1 SMP PREEMPT Thu Jul 20 00:49:07 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux


#18

Besides TCB13 instruction, I add my update:
sudo apt-get install build-essential
sudo apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-setuptools cmake
sudo apt install libmariadb-client-lgpl-dev-compat libmariadbd-dev
sudo pip3 install django-admin
–make sure $PATH include /usr/local/bin
sudo apt install libevhtp-dev
– avoid evhtp.h not found error in the final compilation.
sudo cp /usr/include/evhtp/. /usr/include/
– easy_install is not avaliable any more, it is outdated command
–use “python /usr/lib/python2.7/dist-packages/easy_install.py” to replace “easy_install”
–I can only compile seafile on Ubuntu 16.04 LTS, because of evhtp version
–libevhtp-dev/xenial,now 1.2.11-1 arm64
–On Ubuntu 18.04LTS libevhtp-dev/bionic,now 1.2.16-1 arm64, is not compatible to compile seafile

TCB13’s patches seem unnecessary in my build process, they both failed to patch my code.

Final compilation command:
seafile-server/scripts/build/build-server.py --version=6.3.0 --libsearpc_version=3.1.0 --ccnet_version=6.0.1 --seafile_version=6.3.0 --thirdpartdir=/media/SATA/apps/seafile/dev/seahub_thirdpart --srcdir=/media/SATA/apps/seafile/dev/seafile-sources --outputdir=/media/SATA/apps/seafile/dev/seafile-server-pkgs --mysql_config=/usr/bin/mariadb_config


#19

@jzhang18 the last version probably has the patches already merged , that why they aren’t necessary anymore.


#20

Your package build quality is better than mine -
Yours is 46 MB, mine is 55 MB
I am wondering it is not good package.

I test mine, upload file – “unknown error” occurs.
As I remember, upload is C code, compiled and linked with libevhtp-dev package.

Maybe the version of libevhtp-dev on Ubuntu 16.04 LTS is still bad.