我试图在AIX 7.1上本地安装python3(3.5.2)解释器,我用它来configuration,它运行正常
CC=gcc OPT="-O2" ./configure --enable-shared --prefix=$HOME/usr/local
但是我在做altinstall的时候出错了
/tmp/python3-src/Python-3.5.2 $ make altinstall prefix=$HOME/usr/local exec-prefix=$HOME/usr/local gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O1 -O -Werror=declaration-after-statement -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function 'posix_do_stat': ./Modules/posixmodule.c:2142:48: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW); ^ ./Modules/posixmodule.c:2142:48: note: each undeclared identifier is reported only once for each function it appears in ./Modules/posixmodule.c: In function 'os_access_impl': ./Modules/posixmodule.c:2609:22: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) flags |= AT_SYMLINK_NOFOLLOW; ^ ./Modules/posixmodule.c:2611:22: error: 'AT_EACCESS' undeclared (first use in this function) flags |= AT_EACCESS; ^ ./Modules/posixmodule.c: In function 'os_chmod_impl': ./Modules/posixmodule.c:2854:49: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW); ^ ./Modules/posixmodule.c: In function 'os_chown_impl': ./Modules/posixmodule.c:3191:49: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW); ^ ./Modules/posixmodule.c: In function 'os_link_impl': ./Modules/posixmodule.c:3441:31: error: 'AT_SYMLINK_FOLLOW' undeclared (first use in this function) follow_symlinks ? AT_SYMLINK_FOLLOW : 0); ^ ./Modules/posixmodule.c: In function 'os_rmdir_impl': ./Modules/posixmodule.c:4240:49: error: 'AT_REMOVEDIR' undeclared (first use in this function) result = unlinkat(dir_fd, path->narrow, AT_REMOVEDIR); ^ ./Modules/posixmodule.c: In function 'utime_dir_fd': ./Modules/posixmodule.c:4571:39: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW; ^ ./Modules/posixmodule.c: In function 'utime_nofollow_symlinks': ./Modules/posixmodule.c:4621:50: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW); ^ make: The error code from the last command is 1. Stop.
我检查/ usr /包括那些缺less的声明,看起来像他们在那里。 在做本地安装时,我是否必须以某种方式指定这些手动path?
/usr/include $ grep -R "#define AT_EACCESS" . ./fcntl.h:#define AT_EACCESS 1 /* Check access using effective /usr/include $ grep -R "#define AT_SYMLINK_NOFOLLOW" . ./fcntl.h:#define AT_SYMLINK_NOFOLLOW 1 /* Do not follow symbolic links */
编译时,
出现以下错误,
/Modules/posixmodule.c:2142:48: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function) follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
posixmodule.c行2142如下,在这里使用fstatat方法;
#ifdef HAVE_FSTATAT if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) result = fstatat(dir_fd, path->narrow, &st, follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW); else #endif
所以这个修复 应该用来解决这个问题。