Python problems on OS X

Andrew Butterfield Andrew.Butterfield at scss.tcd.ie
Wed Nov 18 09:32:03 UTC 2020


Hi Chris,

> On 17 Nov 2020, at 20:25, Chris Johns <chrisj at rtems.org> wrote:
> 
> On 17/11/20 9:19 pm, Andrew Butterfield wrote:
>> I keep getting a python error when trying to build the tool suite on 
>> OS X. The end of the error log is:
>> 
>> ```
>> checking whether to use python... /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
> 
> That looks like RSB has provided a suitable path.
> 
>> checking for python... no
>> configure: error: no usable python found at /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
>> make[1]: *** [configure-gdb] Error 1
>> make: *** [all] Error 2
>> shell cmd failed: /bin/sh -ex  /Users/butrfeld/REPOS/esa-qual/modules/rsb/rtems/build/sparc-rtems6-gdb-0295dde-x86_64-apple-darwin19.6.0-1/do-build
>> error: building sparc-rtems6-gdb-0295dde-x86_64-apple-darwin19.6.0-1
>> 
>> ```
> 
> What is the gdb configure command line the RSB uses?

I'm not sure how to establish this. In
   rsb/rtems/build/sparc-rtems6-gdb-0295dde-x86_64-apple-darwin19.6.0-1/build/gdb/config.log

I find the following (esa-qual is my local name for the ESA version of rtems-central):

  $ /Users/butrfeld/REPOS/esa-qual/modules/rsb/rtems/build/sparc-rtems6-gdb-0295dde-x86_64-apple-darwin19.6.0-1/sourceware-mirror-binutils-gdb-0295dde/gdb/configure --srcdir=../../sourceware-mirror-binutils-gdb-0295dde/gdb --cache-file=./config.cache --verbose --disable-nls --disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof --without-included-gettext --disable-win32-registry --disable-werror --disable-sim --without-zlib --with-expat --with-guile=no --with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python2 --prefix=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6 --bindir=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/bin --exec-prefix=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6 --includedir=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/include --libdir=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/lib --mandir=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/share/man --infodir=/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/share/info --program-transform-name=s&^&sparc-rtems6-& --disable-option-checking --build=x86_64-apple-darwin19.6.0 --host=x86_64-apple-darwin19.6.0 --target=sparc-rtems6

Does this help?


> 
>> What are the criteria for python to be "useable"?
> 
> Does the following help?
> 
> https://git.rtems.org/rtems-source-builder/tree/source-builder/config/gdb-common-1.cfg#n7
> 
> On MacOS (darwin) I gave up on the library checks and assume if the header is
> present the Python install is OK.
> 
> After the build fails there should be a config.log file under `build` ...
> 
> find build -name config.log

This finds a lot of files.
In folder
  rsb/rtems/build/sparc-rtems6-gdb-0295dde-x86_64-apple-darwin19.6.0-1/build
I find a number of folders, many of which contain a config.log

I opened gdb/config.log and searched for "checking whether to use python" and found the transcript below at (A)

(to save reading it all, the issues seems to be:
   clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'

This is now confusing because, in /Library/Frameworks/Python.framework/Versions/2.7 I observe:

$ pwd
/Library/Frameworks/Python.framework/Versions/2.7

$ file *
...
Python:         Mach-O 64-bit dynamically linked shared library x86_64
...
$ ls -ls
...
4072 -r-xrwxr-x   1 root  admin  2084864 Apr 20  2020 Python
...

/Library/Frameworks/Python.framework/Versions/2.7/Python is passed as a command-line argument below...


(A)
```
configure:10570: checking whether to use python
configure:10572: result: /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
configure:10770: checking for python
configure:10788: /usr/bin/cc -O2 -pipe -fbracket-depth=1024 -I/Users/butrfeld/REPOS/esa-qual/modules/rsb/rtems/build/tmp/sb-501/6/rtems-sparc/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/include -o conftest -g -O2 -I/Users/butrfeld/REPOS/esa-qual/modules/rsb/rtems/build/tmp/sb-501/6/rtems-sparc/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7  -Wl,-no_pie -L/Users/butrfeld/REPOS/esa-qual/modules/rsb/rtems/build/tmp/sb-501/6/rtems-sparc/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/lib conftest.c -L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl -framework CoreFoundation -u _PyMac_Error Python.framework/Versions/2.7/Python -lncurses -lm  >&5
clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'
configure:10788: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define HAVE_CXX11 1
| #define PACKAGE "gdb"
| #define DEBUGDIR "/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/lib/debug"
| #define DEBUGDIR_RELOCATABLE 1
| #define BINDIR "/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/bin"
| #define GDB_DATADIR "/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/share/gdb"
| #define GDB_DATADIR_RELOCATABLE 1
| #define AUTO_LOAD_DIR ":${prefix}/share/auto-load"
| #define AUTO_LOAD_SAFE_PATH ":${prefix}/share/auto-load"
| #define DEFAULT_BFD_ARCH bfd_sparc_arch
| #define DEFAULT_BFD_VEC sparc_elf32_vec
| #define HAVE_MONSTARTUP 1
| #define PKGVERSION "(GDB) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/gdb/bugs/>"
| #define HAVE_LIBM 1
| #define HAVE_ICONV 1
| #define ICONV_CONST 
| #define SIZEOF_UNSIGNED_LONG_LONG 8
| #define SIZEOF_UNSIGNED_LONG 8
| #define SIZEOF_UNSIGNED___INT128 16
| #define JIT_READER_DIR "/Users/butrfeld/REPOS/esa-qual/modules/rtems/6/lib/gdb"
| #define JIT_READER_DIR_RELOCATABLE 1
| #define HAVE_LIBEXPAT 1
| #define HAVE_XML_STOPPARSER 1
| /* end confdefs.h.  */
| #include "Python.h"
| int
| main ()
| {
| Py_Initialize ();
|   ;
|   return 0;
| }
configure:10798: result: no
configure:10888: error: no usable python found at /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
```

> 
> Does it provide any insight into why the configure failed?
> 
>> I have removed all traces of non-native (brew) pythons that I can find.
> 
> OK.
> 
>> I followed the virtual environment instructions in the rtems-central README.md
> 
> I do not use rtems-central or follow it in detail.
> 
>> :- which python
>> /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
>> 
>> :- which python3
>> /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
> 
> That looks fine. Did you install python3?

Yes, 3.8, from Python.org
> 
>> My machine is running macOS Catalina 10.15.7
> 
> Catalina should be fine. I installed Big Sur yesterday and was going to test it
> today. I suspect it will only have python3 support.
> 
> Unrelated, does Catalina support APFS?

Yes - in fact it requires APFS
> 
> Chris

Regards and thanks, Andrew



--------------------------------------------------------------------
Andrew Butterfield     Tel: +353-1-896-2517     Fax: +353-1-677-2204
Lero at TCD, Head of Software Foundations & Verification Research Group
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
                         http://www.scss.tcd.ie/Andrew.Butterfield/
--------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20201118/29ce13db/attachment-0001.html>


More information about the users mailing list