Skip to content

Instantly share code, notes, and snippets.

@j-c-cook
j-c-cook / cross-compile-python.md
Last active September 25, 2024 08:24
Cross-compile Python for use on armv7l

Cross-compile Python for use on armv7l

Introduction

This post shows how to cross compile Python (using the [CPython][#cpython] implementation) for use on an armv7l chip. This can likely be extrapolated to other chip archetectures, but the proper cross-compilation toolchain would need to be substituded. The Python version utilized here is version 3.7.13. The driving force behind this effort was to get [python-can][#python-can] functional on an armv7l platform. This compilation process is done on a Ubuntu 20.04.4 LTS operating system. I have utilized various online references and will do my best to provide citation and links.

In my case the device with an armv7l chip contains a root file system and shared objects that are compiled using a version of [buildroot][#buildroot]. The buildroot menu configuration allows for the selection of Python 3 for installation, but not all of the basic packages are included. For example, importing the python-can package into an environment using Python 3 installed b

@j-c-cook
j-c-cook / main.py
Last active October 24, 2022 22:43
Validation of SecondaryCoolProps to Coolprop for use cases in pygfunction
import pygfunction as gt
import scp
import matplotlib.pyplot as plt
import numpy as np
import os
def make_dir_if_not(path_to_dir: str):
import matplotlib.pyplot as plt
"""
The Halton sequence is a generalization of the one-dimensional Van der Corput
sequence.
https://en.wikipedia.org/wiki/Halton_sequence
https://en.wikipedia.org/wiki/Van_der_Corput_sequence
"""
@j-c-cook
j-c-cook / notes.md
Last active April 1, 2023 02:44
Dell Precision 5560 occasional touch pad lag

Dell Precision 5560 occasional touch pad lag

Locate the driver: https://unix.stackexchange.com/a/131447

$ cat /proc/bus/input/devices
...
I: Bus=0018 Vendor=04f3 Product=311c Version=0100
N: Name="DLL0945:00 04F3:311C Touchpad"
P: Phys=i2c-DLL0945:00
@j-c-cook
j-c-cook / CMakeLists.txt
Created May 18, 2023 13:11
Vector of pointers to derived classes constructor
cmake_minimum_required(VERSION 3.25)
project(vectorOfPointers)
set(CMAKE_CXX_STANDARD 17)
add_executable(vectorOfPointers main.cpp)