building python 3.8.3 on jetpack 4.4 dp and the jetson xavier nx

This how-to is a refinement of my first Python 3.8.3 from 16 May build, built on the older Jetson Nano with JetPack 4.4 DP ( https://arcanesciencelab.wordpress.com/2020/05/16/building-python-3-8-3-on-jetpack-4-4-developer-preview/ ). Where changes have occurred, they are noted.

These instructions will help you build Python 3.8.3 on the Jetson Xavier NX Development Kit running JetPack 4.4 Developer Preview. There are two broad steps to building this version. The first is the installation of support developer libraries to allow as many Python modules as possible to successfully build. After the installation step, then comes the build steps. This was reversed in the 16 May build how-to.

To build as many modules as possible the following libraries need to be installed.

  • libgdm-dev
  • libnss3-dev
  • libssl-dev
  • libsqlite3-dev
  • libreadline-dev
  • libbz2-dev
  • libdb-dev, libdb++-dev (Berkeley db)
  • libgdbm-dev
  • libffi-dev

And for those of you following along who just want to copy and paste one time, the single line command to install all the libraries at once is:

sudo apt install libgdm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libbz2-dev libdb-dev libdb++-dev libgdbm-dev libgdbm-dev libffi-dev

The package libffi-dev was not in the installation list from 16 May. If not installed then then module _ctypes will fail to build.

  1. If you haven’t done so already then download the latest Python, version 3.8.3, from https://www.python.org/downloads/.
  2. Untar the file (we’ll assume it’s downloaded to the default ~/Downloads):
    tar xvf Downloads/Python-3.8.3.tar.xz
  3. Make a build directory at the same level as the untarred source directory. In this case the build directory was named build-python-3.8.3
  4. Change directory into the build directory.
  5. From within the build directory execute the configure script:
    ../Python-3.8.3/configure --enable-optimizations
  6. Run make:
    make -j 6

    Note that we’re using all six cores of the Jetson Xavier NX. This means that all six cores should be enabled on the NX.

  7. Install into the alternate location for this version of Python:
    sudo -H make altinstall
  8. Check for the alternate location with ‘which python3.8’. It should return ‘/usr/local/bin/python3.8’.

I then created a Python 3.8.3 virtual work environment. These are the specific steps I used to create that environment.

  1. In your home directory, create a work folder. In this example it was named ‘venv383’. Change directory (cd) into it.
  2. Then create a Python VE:
    python3.8 -m venv app01

Once created, you should have a directory structure like this:

├── bin/
│   ├── activate
│   ├── activate.csh
│   ├── activate.fish
│   ├── easy_install
│   ├── easy_install-3.8
│   ├── pip
│   ├── pip3
│   ├── pip3.8
│   ├── python -> python3.8
│   ├── python3 -> python3.8
│   └── python3.8 -> /user/local/bin/python3.8
├── include/
├── lib/
│   └── python3.8/
│       └── site-packages/
│           ├── easy_install.py
│           ├── pip/...
│           ├── pip-19.2.3.dist-info/...
│           ├── pkg_resources/...
│           ├── __pycache__/...
│           ├── setuptools/...
│           └── setuptools-41.2.0.dist-info/...
├── lib64 -> lib/
└── pyvenv.cfg

To active the virtual environment, you would execute

source bin/activate

In my environment I created a Bash alias to handle that:

alias activate='source $HOME/venv383/app01/bin/activate'

Note that this incorporates the folder and virtual environment name I personally created earlier. If you change any of that then you’ll incorporate what you created.

Here’s a quick run to see if those bits are working properly.

And so it would appear that they do.

what time is it in london? daringfireball gets its knickers in a knot over the answer

Just about everybody and their sibling(s) knows who John Gruber is, and his blog, “DaringFireball” ( https://daringfireball.net/ ). In the past, before today, I’d regularly stroll by to read everything he posted. 99% of the time I’d nod my head in agreement with his opinions and observations and then move on to something else. Except for today.

Today, Gruber wrote ‘What Time Is It in London?’ ( https://daringfireball.net/2020/05/what_time_is_it_in_london ) in which he took Apple to task because Siri, when asked the question, supposedly took too long and then answered with the time in London, Canada.

Nilay Patel asked this of Siri on his Apple Watch. After too long of a wait, he got the correct answer — for London Canada. I tried on my iPhone and got the same result. Stupid and slow is heck of a combination.

So one of Gruber’s Twitter buddies tweets his experience asking the question, and Gruber gives it a try and finds the same issue. That’s fine as it goes. Except it gets much worse. In the next paragraph Gruber writes:

You can argue that giving the time in London Ontario isn’t wrong per se, but that’s nonsense. The right answer is the common sense answer. If you had a human assistant and asked them “What’s the time in London?” and they honestly thought the best way to answer that question was to give you the time for the nearest London, which happened to be in Ontario or Kentucky, you’d fire that assistant. You wouldn’t fire them for getting that one answer wrong, you’d fire them because that one wrong answer is emblematic of a serious cognitive deficiency that permeates everything they try to do. You’d never have hired them in the first place, really, because there’s no way a person this lacking in common sense would get through a job interview. You don’t have to be particularly smart or knowledgeable to assume that “London” means “London England”, you just have to not be stupid. (emphasis mine)

The stench of arrogance and entitlement that runs through this paragraph is so strong as to be unbelievable. It’s a good thing I never worked for John Gruber, because if I had and I’d done something, anything, that he deemed to be stupid and “emblematic of a serious cognitive deficiency” I’d have turned around and left far faster than he could have fire me. I would have, in effect, fired him as a boss. Who really wants to work for such a toxic individual?

If I’d run across this type of “problem”, I would have stopped and asked why that kind of result to the question. For software systems, that means letting someone know this is an issue and helping to resolve it. If it’s a person I stop and understand why they delivered that kind of answer. Who knows why? Taking something like this completely out of context and then rage-blogging about it only shows how immature the author (in this case one John Gruber) is. When it especially comes to people, I don’t believe in disposable people. I’m retired now, but I really have tried to be a mentor to those who’ve worked for me, not some bastard boss from hell.

I read that article early this morning while in my doctor’s office (many of us old retirees have Medical Issues that need looking into from time to time). I couldn’t try this in the waiting room, since a doctor’s waiting room, even during COVID-19, should be quiet. But when I got home around noon I tried it, and I got the “correct” answer. Later in the day I tried it again, and then this evening, before I wrote this post, I tried again and grabbed screen shots off my Apple Watch and iPhone. My hardware, in case you’re interested, is a Series 3 Apple Watch and an iPhone 11 Pro Max, both running the latest software that dropped yesterday.

Thanks, John, for helping me to cut my screen time down further. I now have more time to devote to what’s really important, helping others.

Series 3 Apple Watch, watchOS 6.2.5
iPhone 11 Pro Max, iOS 13.5