Decision Optimization

 View Only
Expand all | Collapse all

Problem with CPLEX running on Mac M1

  • 1.  Problem with CPLEX running on Mac M1

    Posted Tue April 06, 2021 04:32 PM
    Hello everyone,
    I have some trouble running CPLEX with Java on my Mac M1 with MacOs BigSur 11.2.3. Im using a Beta version of CPLEX (CPLEX_Studio_Beta211). When trying to run my script I'm receiving the following error message:

    java.lang.UnsatisfiedLinkError: /Applications/CPLEX_Studio_Beta211/cplex/bin/x86-64_osx/libcplex2010.dylib: dlopen(/Applications/CPLEX_Studio_Beta211/cplex/bin/x86-64_osx/libcplex2010.dylib, 1): no suitable image found.  Did find:
    /Applications/CPLEX_Studio_Beta211/cplex/bin/x86-64_osx/libcplex2010.dylib: mach-o, but wrong architecture
    /Applications/CPLEX_Studio_Beta211/cplex/bin/x86-64_osx/libcplex2010.dylib: mach-o, but wrong architecture
    java.library.path must point to the directory containing the CPLEX shared library
    try invoking java with java -Djava.library.path=...

    I have already tried out several java-versions which don't seem to be the problem.

    I would appreciate any help. Thanks in advance.

    ------------------------------
    Luis Masuch Ibanez
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Problem with CPLEX running on Mac M1

    Posted Wed April 07, 2021 02:36 AM
    Hi

    there is not yet an M1 port for CPLEX.
    Do not hesitate to log a wish in Aha

    regards


    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: Problem with CPLEX running on Mac M1

    Posted Wed April 07, 2021 10:47 AM
    Edited by System Fri January 20, 2023 04:22 PM


  • 4.  RE: Problem with CPLEX running on Mac M1

    Posted Wed April 07, 2021 11:16 AM
    Is there any way to use CPLEX via the Java API? I'm able to start OPL Studio.

    regards

    ------------------------------
    Luis Masuch Ibanez
    ------------------------------



  • 5.  RE: Problem with CPLEX running on Mac M1

    Posted Wed April 07, 2021 02:20 PM
    Hi,

    have you managed to run an OPL model in the IDE ?

    Anyway, what you could try is run an OPL model from the IDE in the cloud ?

    Or use oplrunwml to run a cplex model that will run in the cloud: https://alexfleischer-84755.medium.com/command-line-call-opl-cplex-model-in-watson-machine-learning-518aba1be0b4

    regards

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 6.  RE: Problem with CPLEX running on Mac M1

    Posted Wed April 07, 2021 04:46 PM
    Hi,

    yes I have managed to run an existing OPL example.

    regards

    ------------------------------
    Luis Masuch Ibanez
    ------------------------------



  • 7.  RE: Problem with CPLEX running on Mac M1

    Posted Thu April 08, 2021 06:41 AM
    Thanks for your suggestion Alex. But using the cloud is not an option
    for me. I'm implementing an algorithm in Java that uses Cplex as a
    subroutine.

    The problem is the Java API not Cplex itself. I can use Cplex via OPL
    studio and also run Cplex on the command line without problems.

    I'm using a x86-64 version of Java JDK, which is the same architecture
    as the Cplex library. Hence, I think it should be possible to use Cplex
    from Java.

    regards


    ------------------------------
    Luis Masuch Ibanez
    ------------------------------



  • 8.  RE: Problem with CPLEX running on Mac M1

    Posted Thu April 08, 2021 07:53 AM
    Hi,
    you have some OPL / java examples in CPLEX_Studio201\opl\examples\opl_interfaces\java

    If this does not work as a workaround you could try to do an external call from java to oplrun command line

    regards

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 9.  RE: Problem with CPLEX running on Mac M1

    Posted Sat April 10, 2021 07:05 AM
    Hi Alex, your suggestion does not solve my problem (see my original
    post). I don't want to call OPL through Java. I want to use the Java API
    to Cplex itself (I need to invoke cuts callbacks etc.).

    Somebody else an idea?

    regards


    ------------------------------
    Luis Masuch Ibanez
    ------------------------------



  • 10.  RE: Problem with CPLEX running on Mac M1

    Posted Mon January 15, 2024 09:07 AM

    Then you can design your model using IloCplex Api directly, using either oplall.jar or cplex.jar



    ------------------------------
    David Gravot
    ------------------------------