在 Solaris 11.2 上编译 python 3.7 在 link 阶段失败

Compiling python 3.7 on Solaris 11.2 fails at link stage

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

我试过以下方法:

  ./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没有。

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

有什么想法吗?

它正在运行。谢谢 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

还有一些问题,但它确实加载了。