haiwen / seafile-client

Seafile desktop client.
http://seafile.com
Apache License 2.0
471 stars 279 forks source link

Building and installing with a custom prefix fails #41

Closed allo- closed 10 years ago

allo- commented 10 years ago

It seems, that building and installing with a custom prefix fails while installing ccnet, because it does not find libsearpc in the prefix. I tried some workaround, but the error is always only shifted by a bit. I guess you could fix it somewhere in the autotools toolchain.

Build-Log:

# Following https://github.com/haiwen/seafile/wiki/Build-and-use-seafile-client-from-source on debian wheezy (stable)

mkdir -p ~/tmp/seafile;cd ~/tmp/seafile
$ wget https://github.com/haiwen/libsearpc/archive/v2.0.8.tar.gz
$ mv v2.0.8.tar.gz libsearpc-2.0.8.tar.gz
$ wget https://github.com/haiwen/ccnet/archive/v2.0.8.tar.gz
$ mv v2.0.8.tar.gz ccnet-2.0.8.tar.gz
$ wget https://github.com/haiwen/seafile/archive/v2.0.8.tar.gz
$ mv v2.0.8.tar.gz seafile-2.0.8.tar.gz
$ wget https://github.com/haiwen/seafile-client/archive/v2.0.8.tar.gz
$ mv v2.0.8.tar.gz seafile-client-2.0.8.tar.gz
$ for i in *;do tar xfvz $i;done
$ cd libsearpc-2.0.8/
$ ./autogen.sh
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build'.
libtoolize: copying file `build/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `build/autotools'.
libtoolize: copying file `build/autotools/libtool.m4'
libtoolize: copying file `build/autotools/ltoptions.m4'
libtoolize: copying file `build/autotools/ltsugar.m4'
libtoolize: copying file `build/autotools/ltversion.m4'
libtoolize: copying file `build/autotools/lt~obsolete.m4'
configure.ac:42: installing `build/compile'
configure.ac:45: installing `build/config.guess'
configure.ac:45: installing `build/config.sub'
configure.ac:38: installing `build/install-sh'
configure.ac:38: installing `build/missing'
json-glib/Makefile.am: installing `build/depcomp'
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:12: installing `./config.guess'
configure.ac:12: installing `./config.sub'
configure.ac:11: installing `./install-sh'
configure.ac:11: installing `./missing'
demo/Makefile.am: installing `./depcomp'
pysearpc/Makefile.am:4: installing `./py-compile'

$ ./configure --prefix=/home/allo/apps/seafile-client
[snip]
config.status: executing libtool commands

 Json-GLib - 0.14.2 (release)

 • Prefix: /home/allo/apps/seafile-client

 • Debug level: minimum
 • Compiler flags: -g -O2

 • Enable test suite: yes

$ make
[snip]

$ make install
[snip]

$ cd ../ccnet-2.0.8
$ ./autogen.sh
processing .
Creating ./aclocal.m4 ...
Making ./aclocal.m4 writable ...
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running aclocal  -I m4 ...
Running autoheader...
Running automake --gnu  ...
configure.ac:13: installing `./config.guess'
configure.ac:13: installing `./config.sub'
configure.ac:11: installing `./install-sh'
configure.ac:11: installing `./missing'
demo/Makefile.am: installing `./depcomp'
python/ccnet/Makefile.am:3: installing `./py-compile'
Running autoconf ..

$ PKG_CONFIG_PATH=/home/allo/apps/seafile-client/lib/pkgconfig ./configure --prefix=/home/allo/apps/seafile-client
[snip]
config.status: executing libtool commands

The following modules will be built:

python
ccnet-daemon
demo

$ make
[snip]
mv -f .deps/proc-factory.Tpo .deps/proc-factory.Po
gcc -DHAVE_CONFIG_H -I. -I../..  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DCCNET_DAEMON -I../../net/common -I../../include -I../../include/ccnet -I../../lib -I../../include -I../../lib -pthread -I/home/allo/apps/seafile-client/include -I/home/allo/apps/seafile-client/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall   -g -O2 -MT ccnet-config.o -MD -MP -MF .deps/ccnet-config.Tpo -c -o ccnet-config.o `test -f '../common/ccnet-config.c' || echo './'`../common/ccnet-config.c
mv -f .deps/ccnet-config.Tpo .deps/ccnet-config.Po
gcc -DHAVE_CONFIG_H -I. -I../..  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DCCNET_DAEMON -I../../net/common -I../../include -I../../include/ccnet -I../../lib -I../../include -I../../lib -pthread -I/home/allo/apps/seafile-client/include -I/home/allo/apps/seafile-client/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall   -g -O2 -MT rpc-service.o -MD -MP -MF .deps/rpc-service.Tpo -c -o rpc-service.o `test -f '../common/rpc-service.c' || echo './'`../common/rpc-service.c
../common/rpc-service.c:40:30: fatal error: searpc-signature.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.

$ find /home/allo/apps/seafile-client/|grep searpc-signature.h
[nothing]
$  find ../libsearpc-2.0.8/|grep searpc-signature.h
../libsearpc-2.0.8/demo/searpc-signature.h
../libsearpc-2.0.8/tests/searpc-signature.h
$ cp ../libsearpc-2.0.8/demo/searpc-signature.h /home/allo/apps/seafile-client/include/
$ make
[snip]
gcc -DHAVE_CONFIG_H -I. -I../..  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DCCNET_DAEMON -I../../net/common -I../../include -I../../include/ccnet -I../../lib -I../../include -I../../lib -pthread -I/home/allo/apps/seafile-client/include -I/home/allo/apps/seafile-client/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall   -g -O2 -MT rpc-service.o -MD -MP -MF .deps/rpc-service.Tpo -c -o rpc-service.o `test -f '../common/rpc-service.c' || echo './'`../common/rpc-service.c
../common/rpc-service.c:41:28: fatal error: searpc-marshal.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.

$ [same for searpc-mashal.h]
[snip]
rpc-service.o: In function `ccnet_start_rpc':
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:63: undefined reference to `searpc_signature_string__void'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:68: undefined reference to `searpc_signature_objlist__void'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:73: undefined reference to `searpc_signature_objlist__string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:78: undefined reference to `searpc_signature_object__string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:83: undefined reference to `searpc_signature_object__string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:88: undefined reference to `searpc_signature_int__string_string_int'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:94: undefined reference to `searpc_signature_object__void'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:105: undefined reference to `searpc_signature_int__string_string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:110: undefined reference to `searpc_signature_int__string_string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:116: undefined reference to `searpc_signature_objlist__int_int'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:120: undefined reference to `searpc_signature_int__void'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:125: undefined reference to `searpc_signature_objlist__int_int'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:129: undefined reference to `searpc_signature_int__void'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:134: undefined reference to `searpc_signature_string__string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:138: undefined reference to `searpc_signature_int__string_string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:144: undefined reference to `searpc_signature_string__string_string'
/home/allo/tmp/seafile/ccnet-2.0.8/net/daemon/../common/rpc-service.c:150: undefined reference to `searpc_signature_string__string'

$ cp ../libsearpc-2.0.8/lib/.libs/libsearpc.so.1 ~/apps/seafile-client/lib/
[seems not to help]
lins05 commented 10 years ago

libsearpc installs a executable script, which is needed when compiling ccnet and seafile.

The script is installed to $prefix/bin, so I guess you need to do this and try again:

export $PATH=/home/allo/apps/seafile-client/bin:$PATH

Regards

allo- commented 10 years ago

seems not to work. I set the path and retried from current working copy with ./configure and make in the ccnet-folder, and got the same error.

I guess the Problem has two points:

i tried some configure options like --libdir, but they did not really help. I am not that skilled with autotools, maybe there is another thing i can try?

If you have some spare time, you can try building it with custom path, if it works for you. I guess there is somewhere a path hardcoded which is easy to fix, if you know where.

a possible thing: Should all libs/headers be installed into the prefix (by there source package), or are some installed from another package or statically linked?

The pkgconfig-File looks rather good:

prefix=/home/allo/apps/seafile-client
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libsearpc 
Description: Simple C rpc library
Version: 1.1.0
Libs: -L${libdir} -lsearpc -lsearpc-json-glib
Cflags: -I${includedir} -I${includedir}/searpc
Requires: gobject-2.0 gio-2.0
lins05 commented 10 years ago

Hi,

allo- commented 10 years ago

sorry, still seems to make trouble:

deleted: searpc-marshal.h and searpc-signature.h from the install directory

build:

export PATH=/home/allo/apps/seafile-client/bin:$PATH
export PKG_CONFIG_PATH=/home/allo/apps/seafile-client/lib/pkgconfig
make clean
./configure --prefix=/home/allo/apps/seafile-client
make

Error:

gcc -DHAVE_CONFIG_H -I. -I..    -DPKGDATADIR=\"/home/allo/apps/seafile-client/share/ccnet\" -DPACKAGE_DATA_DIR=\""/home/allo/apps/seafile-client/share/ccnet"\" -I../include -I../lib -I../lib -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -g -O2 -MT ccnet-demo-server.o -MD -MP -MF .deps/ccnet-demo-server.Tpo -c -o ccnet-demo-server.o ccnet-demo-server.c
In file included from ccnet-demo-server.c:12:0:
../include/ccnet.h:26:27: fatal error: searpc-client.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
$ ls ~/apps/seafile-client/include/
searpc  searpc-client.h  searpc.h  searpc-server.h  searpc-utils.h
lins05 commented 10 years ago

I guess you'd better remove all and start cleanly from the beginning.

On Mon, Dec 2, 2013 at 3:10 PM, allo- notifications@github.com wrote:

sorry, still seems to make trouble:

deleted: searpc-marshal.h and searpc-signature.h from the install directory

build:

export PATH=/home/allo/apps/seafile-client/bin:$PATH export PKG_CONFIG_PATH=/home/allo/apps/seafile-client/lib/pkgconfig make clean ./configure --prefix=/home/allo/apps/seafile-client make

Error:

gcc -DHAVE_CONFIG_H -I. -I.. -DPKGDATADIR=\"/home/allo/apps/seafile-client/share/ccnet\" -DPACKAGE_DATA_DIR=\""/home/allo/apps/seafile-client/share/ccnet"\" -I../include -I../lib -I../lib -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -g -O2 -MT ccnet-demo-server.o -MD -MP -MF .deps/ccnet-demo-server.Tpo -c -o ccnet-demo-server.o ccnet-demo-server.c In file included from ccnet-demo-server.c:12:0: ../include/ccnet.h:26:27: fatal error: searpc-client.h: Datei oder Verzeichnis nicht gefunden compilation terminated.

$ ls ~/apps/seafile-client/include/ searpc searpc-client.h searpc.h searpc-server.h searpc-utils.h

— Reply to this email directly or view it on GitHubhttps://github.com/haiwen/seafile-client/issues/41#issuecomment-29598346 .

allo- commented 10 years ago

I still cannot build it.

Error:

gcc -DHAVE_CONFIG_H -I. -I..    -DPKGDATADIR=\"/home/allo/apps/seafile-client/share/ccnet\" -DPACKAGE_DATA_DIR=\""/home/allo/apps/seafile-client/share/ccnet"\" -I../include -I../lib -I../lib -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -g -O2 -MT ccnet-demo-server.o -MD -MP -MF .deps/ccnet-demo-server.Tpo -c -o ccnet-demo-server.o ccnet-demo-server.c
In file included from ccnet-demo-server.c:12:0:
../include/ccnet.h:26:27: fatal error: searpc-client.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.

Build-Script (assumes the folders are nonexistent=

#!/bin/bash
set -e

mkdir -p ~/tmp/seafile
mkdir -p ~/apps/seafile-client
cd ~/tmp/seafile
wget https://github.com/haiwen/libsearpc/archive/v2.0.8.tar.gz
mv v2.0.8.tar.gz libsearpc-2.0.8.tar.gz
wget https://github.com/haiwen/ccnet/archive/v2.0.8.tar.gz
mv v2.0.8.tar.gz ccnet-2.0.8.tar.gz
wget https://github.com/haiwen/seafile/archive/v2.0.8.tar.gz
mv v2.0.8.tar.gz seafile-2.0.8.tar.gz
wget https://github.com/haiwen/seafile-client/archive/v2.0.8.tar.gz
mv v2.0.8.tar.gz seafile-client-2.0.8.tar.gz
for i in *;do tar xfvz $i;done
cd libsearpc-2.0.8/
./autogen.sh
./configure --prefix=/home/allo/apps/seafile-client
make
make install

cd ../ccnet-2.0.8
export PATH=/home/allo/apps/seafile-client/bin:$PATH
export PKG_CONFIG_PATH=/home/allo/apps/seafile-client/lib/pkgconfig
./autogen.sh
./configure --prefix=/home/allo/apps/seafile-client
make
make install
allo- commented 10 years ago

okay, fix for ccnet (editing the Makefile, not the automake files)

DEFAULT_INCLUDES = -I. -I$(top_builddir) -I$(top_builddir)/../libsearpc-2.0.8/lib

for seafile:

-I$(top_builddir)/../libsearpc-2.0.8/demo

still getting linker errors, not sure how to fix, but i think the problem should be solved in the autotools templates, anyway. Any pointers what to try?

allo- commented 10 years ago

Does it work for you? Or did you change something and i can retry?

allo- commented 10 years ago

I still have trouble with the default buildprocess for version 3.0.2, that libsearpc headers cannot be found. I did not try to reproduce the patches from above, yet. But at least it seems not to be fixed with the defaultconfig and --prefix=/path/to/some/seafile-appdir

copying the heades from libsearpc/demo to net/common, it compiles, but has linker errors. I am not sure, if the object files should be linked into ccnet or into libsearpc.

allo- commented 10 years ago

Okay, the instructions from above with setting the PATH variables while building are working now just fine. I updated the wiki page https://github.com/haiwen/seafile/wiki/Build-and-use-seafile-client-from-source/2b2e0045fefa50dfa1f9fca4f2791c683366d1c3 and tested it with a fresh install, with empty appdir and empty builddir on debian jessie.

it would be good, if you can verify that it works for you, too. Then this bug can be closed.

allo- commented 10 years ago

https://github.com/haiwen/seafile/wiki/Build-and-use-seafile-client-from-source/94e8ed5786320a432f39941d9396bd1aa982f8c7 has an even better command to create the shellscript with the needed path variables.

allo- commented 10 years ago

I am closing here, because https://github.com/haiwen/seafile/wiki/Build-and-use-seafile-client-from-source/cd62cbb2a95222c67e66bdc5768942b935181561 works fine on ubuntu and debian for me.