Building from source: ccnet build fails

I’m trying to build Seafile (server and hub) from source on Gentoo. I believe I have nearly all dependencies; I’m expecting to see obvious compile errors for any that I missed.

I’ve gotten these tarballs:

ccnet-server-v6.2.0-server.tar.gz
libevhtp-1.2.12-1.tar.gz
libsearpc-v3.1-latest.tar.gz
seafile-server-v6.2.0-server.tar.gz
seahub-v6.2.0-server.tar.gz

I am attempting to install into ~/usr/local (under the user’s home dir) by way of --prefix on the ./configure commands. I am following the instructions at https://manual.seafile.com/build_seafile/server.html . libevhtp and libsearpc seem to have built and installed without issue. Next is ccnet-server but I am not succeeding.

I have set these environment variables to try to help the build:

CPATH=/home/seafile6/seafile-server/src/libsearpc-3.1-latest/test
PKG_CONFIG_PATH=/home/seafile6/usr/local/lib/pkgconfig
LD_RUN_PATH=/home/seafile6/usr/local/lib

I set the CPATH because without it, the ccnet build fails at:

../common/rpc-service.c:40:30: fatal error: searpc-signature.h: No such file or directory #include "searpc-signature.h"

Once I set the CPATH, then the build fails at:

[...lots more output above this...]
/bin/sh ../../libtool  --tag=CC   --mode=link gcc  -g -O2 -no-undefined  -o ccnet-server ccnet-server.o server-session.o user-mgr.o group-mgr.o org-mgr.o ../common/ccnet-db.o .
./common/session.o ../common/peer-mgr.o ../common/packet-io.o ../common/message.o ../common/perm-mgr.o ../common/log.o ../common/peer.o ../common/algorithms.o ../common/handsha
ke.o ../common/processor.o ../common/getgateway.o ../common/connect-mgr.o ../common/message-manager.o ../common/proc-factory.o ../common/ccnet-config.o ../common/rpc-service.o
../common/peermgr-message.o ../common/processors/sendmsg-proc.o ../common/processors/rcvmsg-proc.o ../common/processors/rcvcmd-proc.o ../common/processors/putpubinfo-proc.o ../
common/processors/getpubinfo-proc.o ../common/processors/keepalive2-proc.o ../common/processors/mqserver-proc.o ../common/processors/service-proxy-proc.o ../common/processors/s
ervice-stub-proc.o ../common/processors/rpcserver-proc.o ../common/processors/threaded-rpcserver-proc.o ../common/processors/echo-proc.o ../common/processors/sendsessionkey-pro
c.o ../common/processors/recvsessionkey-proc.o ../common/processors/sendsessionkey-v2-proc.o ../common/processors/recvsessionkey-v2-proc.o -levent  ../../lib/libccnetd.la ../..
/net/common/db-wrapper/libdbwrapper.la -lglib-2.0  -lgobject-2.0 -lglib-2.0  -lssl -lcrypto   -luuid -lsqlite3 -lpthread -L/home/seafile6/usr/local/lib -lsearpc -lgio-2.0 -lgob
ject-2.0 -lglib-2.0 -ljansson -L/usr/lib64 -lmysqlclient -lpthread -lz -lm -lssl -lcrypto -ldl -L/usr/lib64/postgresql-9.5/lib64 -lpq                        
libtool: link: gcc -g -O2 -o ccnet-server ccnet-server.o server-session.o user-mgr.o group-mgr.o org-mgr.o ../common/ccnet-db.o ../common/session.o ../common/peer-mgr.o ../comm
on/packet-io.o ../common/message.o ../common/perm-mgr.o ../common/log.o ../common/peer.o ../common/algorithms.o ../common/handshake.o ../common/processor.o ../common/getgateway
.o ../common/connect-mgr.o ../common/message-manager.o ../common/proc-factory.o ../common/ccnet-config.o ../common/rpc-service.o ../common/peermgr-message.o ../common/processor
s/sendmsg-proc.o ../common/processors/rcvmsg-proc.o ../common/processors/rcvcmd-proc.o ../common/processors/putpubinfo-proc.o ../common/processors/getpubinfo-proc.o ../common/p
rocessors/keepalive2-proc.o ../common/processors/mqserver-proc.o ../common/processors/service-proxy-proc.o ../common/processors/service-stub-proc.o ../common/processors/rpcserv
er-proc.o ../common/processors/threaded-rpcserver-proc.o ../common/processors/echo-proc.o ../common/processors/sendsessionkey-proc.o ../common/processors/recvsessionkey-proc.o
../common/processors/sendsessionkey-v2-proc.o ../common/processors/recvsessionkey-v2-proc.o  ../../lib/.libs/libccnetd.a -levent -L/home/seafile6/usr/local/lib ../../net/common
/db-wrapper/.libs/libdbwrapper.a -L/usr/lib64 -L/usr/lib64/postgresql-9.5/lib64 -luuid -lsqlite3 /home/seafile6/usr/local/lib/libsearpc.so -lgio-2.0 -lgobject-2.0 -lglib-2.0 /u
sr/lib64/libjansson.so -lmysqlclient -lpthread -lz -lm -lssl -lcrypto -ldl -lpq -Wl,-rpath -Wl,/home/seafile6/usr/local/lib -Wl,-rpath -Wl,/home/seafile6/usr/local/lib
../common/rpc-service.o: In function `ccnet_start_rpc':                                                                                                      
/home/seafile6/seafile-server/src/ccnet-server-6.2.0-server/net/server/../common/rpc-service.c:63: undefined reference to `searpc_signature_string__void'            
/home/seafile6/seafile-server/src/ccnet-server-6.2.0-server/net/server/../common/rpc-service.c:68: undefined reference to `searpc_signature_objlist__void'
[...and many more similar "searpc_signature_****" lines below here...]

~/usr/local has the following stuff in it:

/home/seafile6/usr/local 
├── bin                 
│   └── searpc-codegen.py    
├── include                   
│   ├── ccnet                 
│   │   ├── async-rpc-proc.h 
│   │   ├── ccnet-client.h    
│   │   ├── ccnet-object.h    
│   │   ├── ccnetrpc-transport.h
│   │   ├── ccnet-session-base.h
│   │   ├── cevent.h            
│   │   ├── invoke-service-proc.h
│   │   ├── job-mgr.h         
│   │   ├── message.h         
│   │   ├── mqclient-proc.h
│   │   ├── option.h    
│   │   ├── packet.h                                         
│   │   ├── peer.h                     
│   │   ├── processor.h                        
│   │   ├── proc-factory.h
│   │   ├── rpcserver-proc.h
│   │   ├── sendcmd-proc.h
│   │   ├── status-code.h
│   │   ├── threaded-rpcserver-proc.h
│   │   ├── timer.h
│   │   └── valid-check.h
│   ├── ccnet.h
│   ├── evhtp
│   │   ├── config.h
│   │   ├── evhtp.h
│   │   ├── parser.h
│   │   └── thread.h
│   ├── evhtp.h
│   ├── searpc-client.h
│   ├── searpc.h
│   ├── searpc-named-pipe-transport.h
│   ├── searpc-server.h
│   └── searpc-utils.h
├── lib
│   ├── libccnet.a
│   ├── libccnet.la
│   ├── libccnet.so -> libccnet.so.0.0.0
│   ├── libccnet.so.0 -> libccnet.so.0.0.0
│   ├── libccnet.so.0.0.0
│   ├── libevhtp.a
│   ├── libsearpc.a
│   ├── libsearpc.la
│   ├── libsearpc.so -> libsearpc.so.1.0.2
│   ├── libsearpc.so.1 -> libsearpc.so.1.0.2
│   ├── libsearpc.so.1.0.2
│   └── pkgconfig
│       ├── evhtp.pc
│       └── libsearpc.pc
└── lib64
    └── python2.7
        └── site-packages
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo

You must add /home/seafile6/usr/local to your PATH because the searpc-codegen.py script is required to compile ccnet-server and seafile-server.

You can also refer to https://manual.seafile.com/build_seafile/rpi.html for an easier way to build from source. The page title is for raspberry pi but the steps described there is suitable for all platforms.

@lins05 Thank you, that was the problem. I have now successfully built ccnet.