This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Building without OpenPTY and without stropts.h
Type: compile error Stage:
Components: Versions: Python 3.7, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: nickpapior
Priority: normal Keywords:

Created on 2019-06-21 09:45 by nickpapior, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg346200 - (view) Author: Nick Papior (nickpapior) Date: 2019-06-21 09:45
When trying to compile Python without OpenPTY and without stropts.h the compilation fails at Modules/posixmodule.c.

Apparently there is a failed logic in the def's.

It goes something like this:

#ifdef HAVE_OPENPTY
...
#elif defined(HAVE__GETPTY)
...
#else
...
#if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC)
    ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */
...
#endif
#endif

However, in the top of the file there is:
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX)
#ifdef HAVE_PTY_H
#include <pty.h>
#else
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#else
#ifdef HAVE_UTIL_H
#include <util.h>
#endif /* HAVE_UTIL_H */
#endif /* HAVE_LIBUTIL_H */
#endif /* HAVE_PTY_H */
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif


However, if stropts.h is not present (then I_PUSH isn't either) then the logic fails if OpenPTY isn't present as well... :(

This came up when I tried to compile Python using Intel compiler suite on our cluster.
It succesfully compiles using GNU, but fails with Intel due to this rare hickup.

If you need additional details, please let me now!
msg346204 - (view) Author: Nick Papior (nickpapior) Date: 2019-06-21 11:16
FYI:

The problem arises since Intel adds a library path to:

../clck/2019.2.1/lib/intel64/

which has libutil.so!

This means that the Intel compiler *may* not find OpenPTY since that may optionally be placed in libutil.so...
Simply removing the path from the env means Intel compilers functions again ;)

*sigh*
History
Date User Action Args
2022-04-11 14:59:17adminsetgithub: 81541
2019-06-21 11:16:23nickpapiorsetmessages: + msg346204
2019-06-21 09:45:22nickpapiorcreate