1

I'm trying to locally install python3 (3.5.2) interpreter on AIX 7.1 I used this to configure, which runs ok

CC=gcc OPT="-O2" ./configure --enable-shared --prefix=$HOME/usr/local

but I get error while doing make 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.

I checked /usr/include for those missing declarations and it looks like they are there. Do I have to somehow specify path to these includes manually when doing local installation?

/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 */
1
  • After the ./configure stage has completed, there's a header file generated that's usually config.h but I think it might be Python.h. In there is the result of all the tests autoconf ran, do you have HAVE_FCNTL, HAVE_FSTATAT and possibly even HAVE_FACCESSAT defined?
    – bodgit
    Jul 21, 2016 at 11:36

1 Answer 1

1

When compile,

The folowing error occured,

/Modules/posixmodule.c:2142:48: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function)
                              follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);

posixmodule.c line 2142 as below, fstatat methods was used in here;

#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

So this fix; should be applied to solve this problem.

4
  • 2
    The problem described in the APAR is a runtime problem, whereas this question is asking about a compile-time problem. Can you provide more details as to why you think the fix you linked to is appropriate for this situation?
    – womble
    Jul 21, 2016 at 8:35
  • I updated my answer; Jul 21, 2016 at 11:16
  • But the error is still at compile time; it's saying the AT_SYMLINK_NOFOLLOW symbol is not defined. It looks like the correct header file is not being included or that it is but the definitions are wrapped in some form of #ifdef guard that is preventing them from being defined. <fcntl.h> is a fairly standard header so my hunch would be on the latter. Does the config.h or equivalent generated by autoconf define HAVE_FCNTL at the very least?
    – bodgit
    Jul 21, 2016 at 11:24
  • I don't have config.h but pyconfig.h and HAVE_FCNTL_H is set to 1 also HAVE_FSTATAT is set to 1
    – J91321
    Aug 2, 2016 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .