0

I am trying to install scip on my m1 Mac, running on python 3.7

I created a terminal that runs in x86_64, and was able to compile scip following these instructions:

Compiling SCIP directly can be done as follows:

  1. unpack the tarball "tar xvzf scip-x.y.z.tgz"
  2. change into the directory "cd scip-x.y.z"
  3. start compiling SCIP "make"
  4. (recommended) check your SCIP installation "make test"

but I am not sure what to do next. I then tried to pip install pyscipopt but I get the following error:

Collecting pyscipopt
  Using cached PySCIPOpt-3.1.5.tar.gz (623 kB)
Requirement already satisfied: wheel in /Users/chiennifer/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pyscipopt) (0.36.2)
Building wheels for collected packages: pyscipopt
  Building wheel for pyscipopt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-wheel-f_3atwka
       cwd: /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/
  Complete output (39 lines):
  Using include path </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src>.
  Using SCIP library <scip> at </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/lib>.
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11.1-x86_64-3.7
  creating build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/Multidict.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/__init__.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/scip.pyx -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/scip.pxd -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/propagator.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/heuristic.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/event.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/lp.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/relax.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/benders.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/conshdlr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/benderscut.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/nodesel.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/expr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/branchrule.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/sepa.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/presol.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  copying src/pyscipopt/pricer.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
  running build_ext
  building 'pyscipopt.scip' extension
  creating build/temp.macosx-11.1-x86_64-3.7
  creating build/temp.macosx-11.1-x86_64-3.7/src
  creating build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src -I/Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m -c src/pyscipopt/scip.c -o build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt/scip.o
  In file included from src/pyscipopt/scip.c:635:
  In file included from /usr/local/include/scip/scip.h:35:
  /usr/local/include/scip/def.h:43:10: fatal error: 'scip/config.h' file not found
  #include "scip/config.h"
           ^~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyscipopt
  Running setup.py clean for pyscipopt
Failed to build pyscipopt
Installing collected packages: pyscipopt
    Running setup.py install for pyscipopt ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-record-uyujqy4v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m/pyscipopt
         cwd: /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/
    Complete output (39 lines):
    Using include path </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src>.
    Using SCIP library <scip> at </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/lib>.
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-11.1-x86_64-3.7
    creating build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/Multidict.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/__init__.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/scip.pyx -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/scip.pxd -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/propagator.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/heuristic.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/event.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/lp.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/relax.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/benders.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/conshdlr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/benderscut.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/nodesel.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/expr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/branchrule.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/sepa.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/presol.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    copying src/pyscipopt/pricer.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
    running build_ext
    building 'pyscipopt.scip' extension
    creating build/temp.macosx-11.1-x86_64-3.7
    creating build/temp.macosx-11.1-x86_64-3.7/src
    creating build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src -I/Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m -c src/pyscipopt/scip.c -o build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt/scip.o
    In file included from src/pyscipopt/scip.c:635:
    In file included from /usr/local/include/scip/scip.h:35:
    /usr/local/include/scip/def.h:43:10: fatal error: 'scip/config.h' file not found
    #include "scip/config.h"
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-record-uyujqy4v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m/pyscipopt Check the logs for full command output.
chiennifer
  • 135
  • 6

1 Answers1

0

PySCIPOpt does not work well with the Makefile system of SCIP - you need to build SCIP using CMake as mentioned in the PySCIPOpt installation guide. This will then generate a shared library and the missing config.h header.

Did you already try using the prebuilt conda packages for PySCIPOpt and SCIP?

mattmilten
  • 6,242
  • 3
  • 35
  • 65