安裝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