Pytensor compilation error

I just got a new mac and ran into several compiler errors, including these missing standard C libraries. I had to do the following steps:

  1. I had to reinstall xcode-select (xcode-select --install, but in my case I also had to uninstall it first because I did a migration from an intel to an M1 system, so everything got messed up).

  2. BLAS doesn’t seem to grab the apple accelerate version that works on the ARM64 chips by default, so i had to do mamba install blas=*=*accelerate*

  3. I added the location of xcode CommandLineTools to the CPATH and LIBRARY_PATH globals as described here.

  4. I also encountered a problem with the -c++11-narrowing flag when compiling PyMC models, so i added the following lines into my .pytensorrc (or .aesararc):

[gcc] 
cxxflags = -Wno-c++11-narrowing

Admittedly I have no idea which of these (or which combination) are critical, but it got me up and running. If anyone can refine this down to a simple how-to for Macs, it would be great.

2 Likes