在链接阶段在Solaris 11.2上编译python 3.7失败 [英] Compiling python 3.7 on Solaris 11.2 fails at link stage

查看:88
本文介绍了在链接阶段在Solaris 11.2上编译python 3.7失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在solaris 11.2上编译python 3.7.在链接阶段之前,编译似乎没有错误.我没有root访问权限.

I am trying to compile python 3.7 on solaris 11.2. The compiling seems to be error free until the linking phase. I do not have root access.

我尝试了以下操作:

  ./configure --prefix=/appgroup/appuser
  make

  ./configure --prefix=/appgroup/appuser --enable-shared
  make

两个错误均出现:

gcc    -o python Programs/python.o -Wl,-R,/appgroup/appuser/scripts/lib -L. -lpython3.7m -lsocket -lnsl -lintl -ldl -lsendfile   -lm  
Undefined                       first referenced
 symbol                             in file
libintl_bind_textdomain_codeset     ./libpython3.7m.so
libintl_gettext                     ./libpython3.7m.so
libintl_textdomain                  ./libpython3.7m.so
libintl_dcgettext                   ./libpython3.7m.so
libintl_bindtextdomain              ./libpython3.7m.so
libintl_dgettext                    ./libpython3.7m.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `python'

我认为该错误是基于/usr/include/libintl.h和/usr/local/include/libintl.h之间的冲突,因为/usr/local/include中的那个有那些变量,而/usr/include不会.

I think the error is based on the conflict between /usr/include/libintl.h and /usr/local/include/libintl.h, because the one in /usr/local/include had those variables, while /usr/include does not.

我试图设置CFLAGS =-I/usr/include -I/usr/local/include"和CFLAGS =-I/usr/local/include -I/usr/include",但是结果是一样.

I tried to set CFLAGS="-I/usr/include -I/usr/local/include" and CFLAGS="-I/usr/local/include -I/usr/include", but the result was the same.

有什么想法吗?

推荐答案

现在可以使用了.谢谢paulsm4.

It is now working. Thank you paulsm4.

make clean
./configure --prefix=/apps/myapp/scripts CFLAGS="-I/usr/local/include -I/usr/include" 
cp pyconfig.h pyconfig.h-1018-1200
vim +/INTL pyconfig.h                                    

diff pyconfig.h pyconfig.h-1018-1200
    568c568
    < /* #undef HAVE_LIBINTL_H  */
    ---
    > #define HAVE_LIBINTL_H 1
    1463c1463
    < /* #undef WITH_LIBINTL */ 
    ---
    > #define WITH_LIBINTL 1

make 
make test 
... stopped test with Ctrl-C 
... (this machine is in a production environment without internet access)

make install  
python3 -V
    Python 3.7.0

仍然有几个问题,但确实可以加载.

There are a couple of issues still, but it does load.

这篇关于在链接阶段在Solaris 11.2上编译python 3.7失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆