Failed to build psi4 from source using conda on MacOS silicon


I followed the procedure shown on the website to install psi4 from source using conda but failed. I am using a Macbook Air M1 with anaconda 3 installed. I downloaded the source and created the environment using conda successfully. However the following build process didn’t work at the end. I have already tried reinstalling anaconda, updating all of the packages and recreating the environment but it didn’t help either.

The error says that it cannot find the numpy include dir but I confirmed the numpy was already installed and up-to-date in the environment. So there must be something else causing the issue. Is there anyone facing the same issue as me and anyone could help me with it?

Here is a snippet of the issue when I started building:

(p4env) psi4 eval $(conda/ cmake)
loading initial cache file /Users/jinlinzhu/software/psi4/cache_p4env.cmake
– The C compiler identification is AppleClang
– The CXX compiler identification is AppleClang
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Building using CMake 3.29.2 Generator Ninja
– Setting (unspecified) option BUILD_SHARED_LIBS: OFF
– Setting option CMAKE_BUILD_TYPE: Release
– Setting (unspecified) option ENABLE_XHOST: ON
– Performing Test CMAKE_C_FLAGS [-march=native] - Success, Appending
– Performing Test CMAKE_CXX_FLAGS [-march=native] - Success, Appending
– Setting option ENABLE_OPENMP: ON
– Setting (unspecified) option ENABLE_AUTO_BLAS: ON
– Setting (unspecified) option ENABLE_AUTO_LAPACK: ON
– Setting (unspecified) option ENABLE_PLUGIN_TESTING: OFF
– Setting (unspecified) option ENABLE_CYTHONIZE: OFF
– Setting (unspecified) option ENABLE_CODE_COVERAGE: OFF
– Setting (unspecified) option ENABLE_BOUNDS_CHECK: OFF
– Setting (unspecified) option ENABLE_ASAN: OFF
– Setting (unspecified) option ENABLE_TSAN: OFF
– Setting (unspecified) option ENABLE_UBSAN: OFF
– Setting (unspecified) option ENABLE_MSAN: OFF
– Setting (unspecified) option MAX_AM_ERI: 5
– Setting (unspecified) option FC_SYMBOL: 2
– Setting (unspecified) option BUILD_FPIC: ON
– Setting (unspecified) option CMAKE_INSTALL_LIBDIR: lib
– Setting (unspecified) option PYMOD_INSTALL_LIBDIR: /
– Setting (unspecified) option psi4_INSTALL_CMAKEDIR: share/cmake/psi4
– Setting (unspecified) option TargetLAPACK_INSTALL_CMAKEDIR: share/cmake/TargetLAPACK
– Setting (unspecified) option TargetHDF5_INSTALL_CMAKEDIR: share/cmake/TargetHDF5
– Setting (unspecified) option ENABLE_GENERIC: OFF
– Setting (unspecified) option CMAKE_INSTALL_MESSAGE: LAZY
– Setting (unspecified) option psi4_CXX_STANDARD: 17
– Setting (unspecified) option psi4_CXX_STANDARD_Libint2: 17
– Setting (unspecified) option SIMINT_VECTOR: avx
– Setting (unspecified) option SPHINX_THEME: sphinx_psi_theme
– Setting (unspecified) option SPHINXMAN_STRICT: OFF
– Setting (unspecified) option BUILD_Libint2_GENERATOR: OFF
– Setting (unspecified) option psi4_SHGAUSS_ORDERING: gaussian
– Psi4 install: /usr/local/psi4
CMake Error at /Users/jinlinzhu/opt/anaconda3/envs/p4env/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy) (found
suitable version “3.9.19”, minimum required is “3.8”)
Call Stack (most recent call first):
/Users/jinlinzhu/opt/anaconda3/envs/p4env/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/Users/jinlinzhu/opt/anaconda3/envs/p4env/share/cmake-3.29/Modules/FindPython/Support.cmake:3867 (find_package_handle_standard_args)
/Users/jinlinzhu/opt/anaconda3/envs/p4env/share/cmake-3.29/Modules/FindPython.cmake:574 (include)
CMakeLists.txt:214 (find_package)

– Configuring incomplete, errors occurred!



Thanks for the report. What’s your conda list, please? And did you create the environment through the conda-psi4-path-advisor? I can already see an einsums problem (with the path-advisor for mac silicon). The others archs have their path-advisor sequence tested in CI, but not silicon so it can break unnoticed.

Ok, if you’re trying for python 3.12, need to comment out cppe and dftd4-python in the env file. And regardless of python version, change einsums=*=mkl* to plain einsums (or comment out einsums). Otherwise, the build on native silicon (M2) worked for me. Let me know more of your env details, I think.

Hi loriab,

Thanks for your reply! Sorry but I do not know which is the env file you referred to. I found several yaml files starting with the env prefix but I didn’t find the keywords such as cppe or einsums in those files.

I then found the post: Installing from source code for Mac silicon where you gave a solution to modify the env file. I followed that procedure and the build finally worked. Is there anything else I should do with it? Is there any update of the env file against that solution posted last year?


Ok, I wasn’t sure what directions you were referring to. The main update to the env file you found is that this monstrosity - conda-forge/label/libint_dev::libint==2.7.3dev1 can now be plain - libint. The einsums and cppe edits were only if conda had trouble solving the environment. Glad you’ve got it working!