Decision Optimization

 View Only
  • 1.  CPLEX/DOCPLEX Run Time Problem on Apple Silicon

    Posted Fri September 30, 2022 09:20 AM

    I installed CPLEX Studio 22.1 on my Apple Macbook (M2 CPU). Almost everything seems to be fine:

    • I can call cplex and cpoptimizer interactives from /Applications/CPLEX_Studio221/cplex/bin/x86-64_osx/cplex and /Applications/CPLEX_Studio221/cpoptimizer/bin/x86-64_osx/cpoptimizer, and can also optimize some examples of mp/cp successfully.
    • I installed python packages: cplex and docplex via the commmand
    python /Applications/CPLEX_Studio221/python/setup.py install
    

    and it seems to be fine also.

    • I tested the system with the command python -m docplex.cp.check_list and got the following:
    Execution environment:
     * System: Darwin, 64bit
     * Python version: 3.10.6, 64 bits (/Users/username/.pyenv/versions/3.10.6/Library/Frameworks/Python.framework/Versions/3.10/bin/python)
     * Docplex version: 2.23.221
     * Optional packages: numpy: 1.23.2, panda: None, matplotlib: 3.5.3
     * Solver agent: local, executable file: '/Applications/CPLEX_Studio221/cpoptimizer/bin/x86-64_osx/cpoptimizer'
     * Solver version: 22.1.0.0
    No problem found.
    
    • HOWEVER, when I tried with python -m docplex.mp.check_list, I got
    * system is: Darwin 64bit
    * Python version 3.10.6, located at: /Users/username/.pyenv/versions/3.10.6/Library/Frameworks/Python.framework/Versions/3.10/bin/python
    * docplex is present, version is 2.23.221
    * CPLEX library is not available
    * pandas is present, version is 1.4.3
    Cplex runtime not found, error importing cplex: dlopen(/Users/username/.pyenv/versions/3.10.6/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cplex-22.1.0.0-py3.10.egg/cplex/_internal/py310_cplex2210.so, 0x0002): tried: '/Users/username/.pyenv/versions/3.10.6/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cplex-22.1.0.0-py3.10.egg/cplex/_internal/py310_cplex2210.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
    
    * diagnostics: 1
      -- No local installation of CPLEX has been found.
    

    As far as I know, the docplex.cp.model works here, but docplex.mp.model failed since the local cplex not found on the system. The variable PYTHONPATH has been set to /Applications/CPLEX_Studio221/cplex/bin/x86-64_osx/. I have no ideas what I missed to configure on the installation process.

    Moreover, I still get a minor problem when trying to run oplide. It can not be executed, but oplrun works fine.



    ------------------------------
    Ratthaprom Promkam
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX/DOCPLEX Run Time Problem on Apple Silicon

    Posted Fri September 30, 2022 10:20 AM
    If you are with a Mx Apple cpu, I bet the python you run is running in arm64 mode which will fail at loading the intel based CPLEX libraries.
    You should try to run it with '''arch -x86_64 python'''


    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 3.  RE: CPLEX/DOCPLEX Run Time Problem on Apple Silicon

    Posted Fri September 30, 2022 12:14 PM
    Thanks for the suggestion.
    Unfortunately, the command python -m docplex.mp.check_liststill provides me the same result,
    i.e., CPLEX library is not available.


    I really wonder since the same process of installation and configuration works with cpoptimizer.


    ------------------------------
    Ratthaprom Promkam
    ------------------------------



  • 4.  RE: CPLEX/DOCPLEX Run Time Problem on Apple Silicon

    Posted Sat September 09, 2023 10:24 AM

    Any solutions to this? I have the same problem. 



    ------------------------------
    Zhiwei Feng
    ------------------------------