1、安装m4
sudo apt-get install m4 //这样比较方便……
或者
http://www.gnu.org/software/m4/
http://ftp.gnu.org/gnu/m4/ 下载压缩包
但我暂时不会安……
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).
2、安装gmp
http://gmplib.org/
./configure
make
make check
sudo make install
3、安装pbc
http://crypto.stanford.edu/pbc/download.html
flex not found
sudo apt-get install flex
bison not found
sudo apt-get install bison
-----------------------------------------------------
./configure
make
sudo make install
4、安装cpabe toolkit
http://hms.isi.jhu.edu/acsc/cpabe/ or http://acsc.cs.utexas.edu/cpabe/
先安装libbswabe
./configure
make
make install
---------------------------------------- configure: error: please install the OpenSSL crypto library, libcrypto.
sudo apt-get install libssl-dev
-------------------------------------------
checking for GLIB - version >= 2.0.0... no
*** Could not run GLIB test program
sudo apt-get install libgtk2.0-dev 还可尝试sudo apt-get install libglib2.0-dev
也可以通过源码来安装
www.gtk.org/download/linux.php
configure: error: Package requirements (libffi >= 3.0.0) were not met:
No package 'libffi' found
安装libffi,sourceware.org/libffi/
----------------------
/usr/bin/ld: /usr/local/lib/libpbc.so: undefined reference to symbol '__gmpz_init'
/usr/bin/ld: note: '__gmpz_init' is defined in DSO /usr/local/lib/libgmp.so so try adding it to the linker command line
修改Makefile,LDFLAGS最后加入-lgmp
-----------------------
64位系统请注意!!!
policy_lang.y: In function ‘eq_policy’:
policy_lang.y:212:4: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
(g_strdup_printf("%s_flexint_%llu", attr, n->value));
32位%llu,64位%lu就行
-----------------------
policy_lang.y: In function ‘yyparse’:
policy_lang.y:67:38: error: expected ‘;’ before ‘}’ token
result: policy { final_policy = $1 }
确实需要一个;
-----------------------
make
sudo make install
---------------------
make install 也有问题!!!
if which help2man 2> /dev/null; then \
help2man --section=1 --source="SRI International" --no-info \
-I cpabe-setup.more-man -o cpabe-setup.1 ./cpabe-setup; \
fi
......
./install-sh: cpabe-setup.1 does not exist.
./install-sh: cpabe-enc.1 does not exist.
./install-sh: cpabe-keygen.1 does not exist.
./install-sh: cpabe-dec.1 does not exist.
make: *** [install] Error 1
安装help2man
sudo apt-get install help2man
--------------
大功告成。
部分参考http://blog.sina.com.cn/s/blog_7b83134b0101ba1o.html
------------------------
目前这个应该是最完善的了吧!!!