setup.py.error#

View page source

setup.py Error Messages#

cholmod.h#

This message can only occur when include_mixed is true.

Message#

      … fatal error: ‘cholmod.h’ file not found
      # include <cholmod.h>

Solution#

If you get this message, find out where cholmod.h is on your system. For example, if you are using homebrew on the Mac, the following command will find cholmod.h:

find -L $HOMEBREW_PREFIX -name 'cholmod.h'

On one system, the result of this command was:

/opt/homebrew/include/cholmod.h
/opt/homebrew/var/homebrew/linked/suite-sparse/include/cholmod.h
/opt/homebrew/opt/suite-sparse/include/cholmod.h
/opt/homebrew/opt/suitesparse/include/cholmod.h
/opt/homebrew/Cellar/suite-sparse/7.1.0/include/cholmod.h

So cholmod was installed in the /opt/homebrew/include directory. Changing extra_cxx_flags as follows solved the problem:

extra_cxx_flags  = '-Wall -pedantic-errors -Wno-unused-result -std=c++11'
extra_cxx_flags += ' ' + '-I /opt/homebrew/include'