1

I have a 32 bit framework called Tk that I need to use with Python. The problem is I have to make a 32 bit version of Python in order to use Tk(inter). The directions on doing this for Linux state the --host and --build options must be used. Here is one such example: ./configure --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu. So now I think I just need to be told what to use as the build and host options. My host system is 64 bit.

Some might be wondering why am I trying to upgrade Tkinter? Because the version that comes with Mac OS 10.12 is 8.5.9. It is very old and has a few bugs with it that Tk 8.5.11 fix. Since I already have the Tk framework 8.5.11 ready to go, I just need to make Python in order to be happy.

I have tired this:

./configure --with-tcltk-includes='-I/Library/Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/Headers' --with-tcltk-libs='/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl /Library/Frameworks/Tk.framework/Versions/8.5/Tk' CFLAGS="-arch i386"

It didn't work. This is the error message I saw:

ignoring file Python/pyctype.o, file was built for i386 which is not the architecture being linked (x86_64): Python/pyctype.o
Undefined symbols for architecture x86_64:
  "_PyObject_Free", referenced from:
      _getgrammar in pgenmain.o
  "_PyParser_ParseFile", referenced from:
      _getgrammar in pgenmain.o
  "__Py_ctype_table", referenced from:
      _PyTokenizer_Get in tokenizer_pgen.o
  "__Py_meta_grammar", referenced from:
      _getgrammar in pgenmain.o
  "__Py_pgen", referenced from:
      _getgrammar in pgenmain.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Parser/pgen] Error 1
user1766438
  • 492
  • 4
  • 13
  • 2
    Why do you think you need a 32-bit build? Tk should be fine with 64-bit. – user2357112 Oct 11 '17 at 18:33
  • Pythons [download page](https://www.python.org/downloads/mac-osx/) shows installers for both python 64bit and 32bit. I don't think you need to make anything. Just download what you need. Please note you can install any 32 bit application on a 64 bit machine. Just not the other way around. – Mike - SMT Oct 11 '17 at 19:03
  • I have the same problem. In my case, I'm embedding python in an app that comes in 32 bit and 64 bit flavours - so i need both to release my code. I tried the only configure variable that seemed 32-bit specific (--with-universal-archs=32-bit) but gcc didn't seem to add any flags for it: gcc -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c – effbiae Oct 18 '17 at 00:17
  • Why I need a 32-bit Python binary is because the framework that is linked to it (Tk) is also 32-bit. Many versions of Tk can be built on 64-bit Mac OS X, but not version 8.5.11. This is the version that I have found to have the fewest bugs. Since this version uses the carbon calls, it cannot be built on 64-bit systems. It does run on them well. – user1766438 Feb 24 '18 at 16:20

0 Answers0