编译 CITA 时报错

环境:

Ubuntu 18.04

$ rustc  --version
rustc 1.43.1 (8d69840ab 2020-05-04)
$ rustup default
stable-x86_64-unknown-linux-gnu (default)

编译命令

make release

报错1

以下报错信息超字数了,详见 gist.log.txt

   Compiling cita-network v20.2.0 (/home/flyq/workspaces/cita/cita/cita-network)
   Compiling cita-bft v20.2.0 (/home/flyq/workspaces/cita/cita/cita-bft)
   Compiling cita-auth v20.2.0 (/home/flyq/workspaces/cita/cita/cita-auth)
   Compiling cita-chain v20.2.0 (/home/flyq/workspaces/cita/cita/cita-chain)
   Compiling jsonrpc-proto v0.1.0 (https://github.com/citahub/cita-common.git?branch=develop#7a23d751)
   Compiling chain-executor-mock v0.1.0 (/home/flyq/workspaces/cita/cita/tests/chain-executor-mock)
error: linking with `cc` failed: exit code: 1
  "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-a78b04f112feb31a.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-29469f6c53ac35f8.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-0eb3c513c640c4a6.rlib" "-Wl,--end-group" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-0b278345638bce90.rlib" "-Wl,-Bdynamic" "-lsnappy" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find -lsnappy
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `chain-executor-mock`.

To learn more, run the command again with --verbose.
Makefile:10: recipe for target 'release' failed
make: *** [release] Error 101

原因: Ubuntu 缺少 snappy lib。snappy 这是一个 google 开发的高效压缩解压软件。通过源码编译按照失败,

参考:https://github.com/CIRCL/AIL-framework/issues/37

最后是通过:

sudo apt install libsnappy-dev

安装的。安装完之后即可继续编译。

报错2

Compiling cita-jsonrpc v20.2.0 (/home/flyq/workspaces/cita/cita/cita-jsonrpc)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.0.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.1.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.10.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.11.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.12.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.13.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.14.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.15.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.2.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.3.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.4.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.5.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.6.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.7.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.8.rcgu.o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.cita_jsonrpc.5g5kizqq-cgu.9.rcgu.o" "-o" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf" "/home/flyq/workspaces/cita/cita/target/release/deps/cita_jsonrpc-e77ddd400ffc4edf.2flhhaivqiwhxd9h.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/flyq/workspaces/cita/cita/target/release/deps" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/miniz-sys-b99ef2377bd37f29/out" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/backtrace-sys-6e8a14a1285afd7b/out" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/secp256k1-42bdadd39b3f77cc/out" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/libgit2-sys-76845f2f951811ac/out/build" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/curl-sys-9f413385c5f4847c/out/build" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/flyq/workspaces/cita/cita/target/release/build/libssh2-sys-0036900df580380a/out/build" "-L" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/flyq/workspaces/cita/cita/target/release/deps/liberror-3f5bf6995721a6ad.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcpuprofiler-4855663f60fc3e20.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblazy_static-e176566bb80aba32.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liberror_chain-265025dadd7dcb92.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbacktrace-9f6b4bfde6a550ee.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libdbghelp-46a4bdef57eee0b9.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libwinapi-fe9ba7c8bce0ad11.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libkernel32-64f21a777a559b12.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libclap-a1108794292bbb86.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libvec_map-8cca89a40580c674.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtextwrap-7024e07c286fb35b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libunicode_width-1a4a1d09a66059fa.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libstrsim-f6e744a7d9214e35.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libatty-bd7be8bea28fd18d.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libansi_term-70e3d20490f1c176.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libthreadpool-d81821e56dae851d.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libhyper-d0f3f102dd1a3adb.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libwant-de3d7c56a005ffb0.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtry_lock-479618b4fd8ebc75.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio-54f3544758900e5f.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_uds-9566699457e1e19a.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmio_uds-ce547977b6218310.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_udp-cf3b34d8f8db87f6.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_timer-1482a1202306cb8e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_tcp-dfc4293f861e86c2.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_sync-5362ab22431d340f.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_reactor-84901b6c71e73600.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_utils-6ed7e98985308457.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_fs-128e5d80ffb49079.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_threadpool-36dffaf839cd659e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand-a57472ec7fa3d2eb.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_xorshift-90ba6fb175ca62cd.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_pcg-9327c926b37c99f5.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_hc-da2d31966c624ba1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_chacha-93d3a3ce211af7ae.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_isaac-379722e47186e675.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_os-82a4852b935b5628.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_jitter-d0c4e190bbd9bd52.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_queue-a315666db10ff955.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_deque-d640fc5d42506d13.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_epoch-139f9841ff71ae88.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libscopeguard-01ededb4d8477ed1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmemoffset-7059d77816f8bdc1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libarrayvec-60957bb3c7580ccf.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnodrop-a67626da1b0b2f2e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_current_thread-82cb82d97f840957.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_executor-5a0625e1bb6fb4da.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_codec-1d05b891a7921e62.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libh2-cfd9348488906d66.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libindexmap-fe10c0e7eb52f3c7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libstring-7dbb227174c91eb7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libhttp-eaa457b241dbc36c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtokio_io-982e5df266ebd085.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libfutures_cpupool-57e7c66c94133800.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnum_cpus-73e8beafdb3560ad.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libpubsub-76b5e5ac7129c71c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libdotenv-a4f4f4a46a38dbb6.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libregex-eed7b244bec64b91.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libutf8_ranges-bcd33c002fb39d47.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libregex_syntax-e40e7be0a8dd81f1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libucd_util-54163bc8688bed62.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libthread_local-364e84ae80f9d7b5.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libaho_corasick-b3fc7a91db77d89e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmemchr-dfab272e783cc0f7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libfailure-a1411cd7018d58b0.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libamqp-df8946ef78499a62.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libamq_proto-d3f4a01cde322559.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libenum_primitive-150843eb33b63351.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liberror_chain-fc40f1b92e18b19c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbit_vec-dcb15b5895127d70.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbyteorder-c01131f92ec362b4.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblog-59fe726df829baf5.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libjsonrpc_proto-b19cb7d50cb2a11c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libproof-6b13d897e0daa68e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_directories-d19a534751a2bb0c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libuuid-f32a82ef1da2bcd0.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbincode-fa960177ce4fc921.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libjsonrpc_types-71c6bbbf3e20094d.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libfutures-778b52f20ca35e76.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libws-f33c990191fe2b63.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsha1-945348a241d15c72.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmio_extras-f94176f2358fde85.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmio-ccdb169c1dd0b540.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libslab-e2035321b2448bf9.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnet2-00df839a2ad98ec9.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblazycell-e5f1c47d83dbaa30.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libhttparse-05b21ad2da000bd5.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libutil-ad700c0fc0d1a3cd.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbacktrace-9823a11b3afe2052.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbacktrace_sys-9d68cdd103fde0af.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librustc_demangle-3339ad29ecab0418.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtoml-5c1689a88aac9a15.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librustc_version-622e6b6aec945947.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsemver-ab1a020f4aa60722.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsemver_parser-605ab867da0ad009.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libparking_lot-5921ab9aed9f1fab.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libparking_lot_core-53e458dfe35dddc2.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsmallvec-3e149003f2b4c3d4.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand-83da19fad8793be7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_core-5b9e37fbec2c7680.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_core-5c0caa9101a2befa.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand_core-90250ff79d66a103.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblock_api-5d6426bb1f4c4bc7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libowning_ref-80941ee41fa2ca94.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libstable_deref_trait-52899adc1d57cf95.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libscopeguard-82ac140af45b42f4.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libgit2-eb7b86139de39727.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libopenssl_probe-ee94e02e2ebcce4d.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbitflags-2b9a3f34d8f44eaf.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblibgit2_sys-85c1ea4bc1608aa7.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcurl_sys-1adb188463eb95e1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblibssh2_sys-a1038613344ba3cd.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libopenssl_sys-10716f7cdbbeec67.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblibz_sys-9a66f467894329f2.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liburl-971d2bd259f9ba42.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libpercent_encoding-196f136f86329c0b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libidna-b53c9dd7d0cae7ef.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libunicode_normalization-fb6b577da10185eb.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libunicode_bidi-bf3bb6ed7743f44b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libmatches-d81ea5de58d59e95.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libansi_term-3106df05e9744040.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblibproto-85c224624f098a5a.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsnappy-e4bdf96f75271f67.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_merklehash-e29aaf0a15d69fcf.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libstatic_merkle_tree-1963dc8dbb84ee5e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libprotobuf-699806ed25886f9c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbytes-2de6ebf29a763409.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libiovec-6fe0a962eb56e93b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_logger-9c82a20fa11a2c40.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsignal_hook-347fdf34f37f5830.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libarc_swap-7cfa0b5e010ecf7e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblog4rs-470309da3d370e9c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtypemap-6f3c3c32ac59def6.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libunsafe_any-5a72784e617901f1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtraitobject-64173bccc784b7df.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libthread_id-df2c7bb3020e6443.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libserde_yaml-dbc00702d3482512.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libyaml_rust-53098644b8d20d49.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblinked_hash_map-bf4b9a9a89c536d5.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libdtoa-a545076b1336301f.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libserde_value-50ee233d6229ea84.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libordered_float-bbe2d9aeeb42e8cb.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libunreachable-082a61f2464c575b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libvoid-3339edbee8da1088.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnum_traits-5957ea331f63e661.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libserde_json-07daa1ec04c9db58.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libryu-69cfa1494584bcec.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libitoa-1d757cf9ef3ff6ae.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblog_mdc-8c90b19d0c3c1b43.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libhumantime-52a562326c641962.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libquick_error-97d4a47fda5feb89.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libfnv-9fc3ed2bfa921b40.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libflate2-d8d33468846899f2.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libminiz_sys-fc683febaa631855.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam-eed4bda8755c2772.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libantidote-56157acc73a5866c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_channel-95d64f7c551937d8.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrossbeam_utils-221f27b3cffef16c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libchrono-eae347e0a81a9f21.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnum_integer-b6cdd05781cc4363.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libnum_traits-a29ef41821e0462b.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtime-fbc336fd03842c38.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblog-db23f618003512f2.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcfg_if-4f1283368edb1caa.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_crypto-932364cf8f0bbc58.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_secp256k1-5e0e4f20a5560ef8.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librlp-fc1bf29d612cb365.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libelastic_array-84e63021520cd954.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libsecp256k1-f2cb3dba296c6f70.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librustc_serialize-ca8927bff787288c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand-f079bf2435ad72aa.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libhashable-29ecf27429bf6427.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_crypto_trait-94e1e5e5471e35ea.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblazy_static-997263a125f53d12.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcita_types-4a10f86567ea0b6c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libplain_hasher-96df5cf7f846c430.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libethereum_types-b4f314f3054fe7b6.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libethbloom-1c5ac3ff46de4f44.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libethereum_types_serialize-dde07188bd6b5dbe.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libserde-c23b5ebb226017dd.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libtiny_keccak-7f8b1588c1456446.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libfixed_hash-0f1a216e3f1fc073.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librand-d03eaebdda4878b1.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librustc_hex-75daa68fb6f777ff.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/liblibc-5237a77f51fede2e.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libuint-dad3e61704e2a6d9.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/librustc_hex-242102e9c32a5278.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libheapsize-3fc14c816ce6353d.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libbyteorder-04663e18b1f8e88c.rlib" "/home/flyq/workspaces/cita/cita/target/release/deps/libcrunchy-c8dedc30895a955c.rlib" "-Wl,--start-group" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-3859b7e52a41a8fd.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-b6f63fdced5391b3.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-f1162cb368d8a940.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-3a410b3342175ea9.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-8465780e2e7f26a2.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-dc606003556dfe9c.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-9b57db8474cf9a25.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-eb5c673507e106bb.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-6bfbf42e528a9aa0.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-bd6281bbe193935c.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1ca9bb8ed5fdbc90.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-d0d38ef150f70011.rlib" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-0d0018c00d4fd6be.rlib" "-Wl,--end-group" "/home/flyq/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-2541f1e09df1c67d.rlib" "-Wl,-Bdynamic" "-lprofiler" "-lssl" "-lcrypto" "-lz" "-lsnappy" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find -lprofiler
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `cita-jsonrpc`.

To learn more, run the command again with --verbose.
Makefile:10: recipe for target 'release' failed
make: *** [release] Error 101

目前这个问题还没解决

通过参考:
https://github.com/ApolloAuto/apollo/issues/3208

来安装:

sudo apt-get install google-perftools

sudo apt install  libgoogle-perftools-dev

最后解决 /usr/bin/ld: cannot find -lprofiler

我们是推荐通过cita-build这个docker镜像来编译的,原因就是cita的依赖比较多,依赖之间的版本匹配比较复杂。
如果因为某些特殊原因,一定要本地编译的话,可以参考我们的cita-build镜像的Dockerfile文件,里面可以看出安装了哪些依赖,以及依赖具体的版本。
当前最新版本使用的Dockerfile链接

1赞

我是因为没有在 README 里面看到这个推荐,就直接本地编译的。把依赖安装全了就没问题了