安装libsodium-1.0.1python
执行./autogen.sh时候,报以下错误:mysql
automake --foreign --copy --add-missing -Woverridelinux
src/common/compress/Makefile.am:9: Libtool library used but `LIBTOOL' is undefinedgit
src/common/compress/Makefile.am:9: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL' sql
src/common/compress/Makefile.am:9: to `configure.ac' and run `aclocal' and `autoconf' again.vim
src/common/compress/Makefile.am:9: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure src/common/compress/Makefile.am:9: its definition is in aclocal's search path.bash
观点一:python2.7
缘由分析:aclocal是个扫描程序, 负责扫描configure.ac中全部的宏定义并展开,上面产生的缘由就是找不到LIBTOOL宏的定义之处形成的.socket
缘由就是aclocal与libtool没有安装在一个相同目录下面,aclocal是去默认 安装目录 /usr/share/aclocal下面搜索全部的.m4文件找所定义的宏,安装libstool的时候最好指定--prefix=/usr,但有时候,就算将libtool安装到/usr下,有时候也会出现这个问题,这是因为安装了多个aclocal,可能aclocal目录不存在,实际目录为/usr/share/aclocal1.15等,这就形成了aclocal找不到m4文件的状况, 解决办法就是将文件夹aclocal1.15重命名为aclocal.ide
固然,若是/usr/share/下有aclocal,仍是报这些错误的话,那多是aclocal里的m4文件不全,那么须要删除该aclocal,将aclocal1.15拷贝并命名为aclocal,之因此不是mv,那是由于安装libsodium-1.0.1,还须要用到aclocal1.15......
或者显示指定路径 aclocal -I /usr/share/aclocal1.15 -I /usr/share/libtool/m4 --install
或者把/usr/share/libtool/m4下面的文件都copy至/usr/share/aclocal1.15中.
但这个问题解决后,也许还会报:
configure.ac:418: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf:
/usr/bin/autoconf
failed with
exit
status: 1
这说明的是你没有装或者系统没有识别libtool,从新安装便可!
2.安装zeromq-4.1.5报错:
configure.ac:251: error: possibly undefined macro: AC_MSG_ERROR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
autogen.sh: error: autoreconf exited with status 0
查了半天,原来是pkgconfig包须要安装,但是我用rpm -ql|grep pkgconfig发现系统有这个包,但不知为什么没有识别出来,看来只能从新安装了!从新安装没有问题了!
3.CentOS在安装openssl的时候,make时有一小半概率遇到下面的错误:
rc4test.o: In function `main': rc4test.c:(.text+0x30): undefined reference to `OPENSSL_cpuid_setup' collect2: ld returned 1 exit status
有两种解决方法:
1)安装pycrypto-2.6.1.tar.gz,而后再次安装openssl
2)加入一个参数,./config -fPIC -DOPENSSL_PIC 下面对-fPIC参数的说明,至于第二个参数我没有找到解释:
-fPIC 做用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code),
则产生的代码中,没有绝对地址,所有使用相对地址,故而代码能够被加载器加载到内存的任意
位置,均可以正确的执行。这正是共享库所要求的,共享库被加载时,在内存的位置不是固定的。
gcc -shared -fPIC -o 1.so 1.c
这里有一个-fPIC参数
PIC就是position independent code
PIC使.so文件的代码段变为真正意义上的共享
若是不加-fPIC,则加载.so文件的代码段时,代码段引用的数据对象须要重定位, 重定位会修改代码段的内容,这就形成每一个使用这个.so文件代码段的进程在内核里都会生成这个.so文件代码段的copy.每一个copy都不同,取决于 这个.so文件代码段和数据段内存映射的位置.
不加fPIC编译出来的so,是要再加载时根据加载到的位置再次重定位的.(由于它里面的代码并非位置无关代码)
若是被多个应用程序共同使用,那么它们必须每一个程序维护一份so的代码副本了.(由于so被每一个程序加载的位置都不一样,显然这些重定位后的代码也不一样,固然不能共享)
fPIC与动态连接能够说基本没有关系,libc.so同样能够不用fPIC编译,只是这样的so必需要在加载到用户程序的地址空间时重定向全部表目.
4.安装requests报错:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/ssl.py", line 97, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
执行python
Python 2.7.12 (default, Oct 12 2016, 15:49:19)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
执行import ssl,如果仍是报ImportError: No module named _ssl,须要vim Python-2.7.12/Modules/Setup
21四、21九、220、221行将“#”去掉 ,如:
_socket socketmodule.c timemodule.c
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
而后从新编译:make && make install
5.安装MySQL-python报错:
Downloading/unpacking mysql-python Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded Running setup.py egg_info for package mysql-python sh: mysql_config: not found Traceback (most recent call last): File "<string>", line 14, in <module> File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module> metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found Complete output from command python setup.py egg_info: sh: mysql_config: not found
须要安装mysql-devel python-devel