Im trying to use CBC in a Ubuntu Core 24.04 VM. The problem formulation should be OK, because Im using the same libraries and Jupyter notebook that Im using in my MAC where it works well. Also, the problem can be solved using Gurobi in the VM, but not with CBC.
On the VM, other solvers work well without any problem, but “cbc” doesnt work even in small example problems.
What means that error code? Do you know how to fixx it?
Thanks,
Linux termination code 139 indicates a crash due to a segmentation fault. This is a low-level error, so the cause cannot be found without some debugging effort.
Did you get CBC from https://portal.ampl.com/user/ampl/download/cbc? That is the latest build for AMPL (dated 20240724), so we recommend trying it if you are using some older CBC binary.
If using the latest build of CBC doesn’t fix the problem, we recommend using the free solver HiGHS (https://portal.ampl.com/user/ampl/download/highs) instead, as it generally has better performance than CBC and also has a more active development team.
Im actually using that build
(Requirement already satisfied: ampl_module_cbc in /home/usm/.local/lib/python3.12/site-packages (20240724))
Is probably a OS or python version compatibility problem? Do you have any recommendation for that side?
Im using SOS2 constraints, so seems that highs will not work with the same exact model formulation. Will try to change it in order to be able to use Highs.
Also would be nice to know if there is any advice regarding change OS or Python Version.
The most common use of SOS2 constructs is to describe piecewise-linear functions. If you’re using SOS2 for that purpose, you can switch to AMPL’s piecewise-linear notation, and then AMPL will take care of any transformations required by the solver (and will add SOS2 information if the solver recognizes it).
Also I’ll see if we can get an opinion from someone more versed in OS and Python version issues.
Fixing CBC could be difficult. If you can execute the AMPL command “write gcbctest;” and send us the resulting file cbctest.nl, we can try solving with CBC on some platforms that we have available, to see if we can reproduce the crash. If the crash is very specific to your VM setup, however, you might need to build and debug CBC yourself using our source at mp/solvers/cbcmp at develop · ampl/mp · GitHub, which would almost certainly be a lot more work than switching solvers.