FeatureNotPresentError: linking issue with CSDP

asked 2020-11-05 13:25:38 -0600

insidiae gravatar image

updated 2020-11-11 05:51:48 -0600

I'm trying to use the Lovász theta-function for graphs. When I attempt to use the function, I get the following error:

--------------------------------------------------------------------------- 
FeatureNotPresentError                    Traceback (most recent call last)
<ipython-input-9-3a9a00f477b1> in <module>
      1 g = graphs.CycleGraph(Integer(7))
----> 2 lovasz_bound(g, Integer(2))

<ipython-input-2-d57428a0d48f> in lovasz_bound(G, k)
     27 def lovasz_bound(G, k):
     28     H = power_graph(G, k)
---> 29     return H.lovasz_theta()
     30 
     31 

/usr/lib/python3/dist-packages/sage/graphs/lovasz_theta.py in lovasz_theta(graph)
     66 
     67     from sage.features.csdp import CSDP
---> 68     CSDP().require()
     69 
     70     g = graph.relabel(inplace=False, perm=range(1, n + 1)).networkx_graph()

/usr/lib/python3/dist-packages/sage/features/__init__.py in require(self)
    189         presence = self.is_present()
    190         if not presence:
--> 191             raise FeatureNotPresentError(self, presence.reason, presence.resolution)
    192 
    193     def __repr__(self):

FeatureNotPresentError: CSDP is not available.
Executable 'theta' not found on PATH.
To install CSDP you can try to run 'sage -i csdp'

It thus seems to be unable to find the CSDP package which it uses to compute the Lovász theta-function.

I'm running Ubuntu 20.04, and have installed SageMath 9.0 via the APT package manager. Therefore, I cannot use 'sage -i' to install packages. I have installed CSDP separately via the package manager as well (the 'coinor-csdp' package), but SageMath doesn't seem to pick it up. I can access CSDP from the command line just fine.

Is there a way to manually link the package? Or is it not possible to use such packages when installing from the APT repositories and should I install from SageMath's binaries?

Many thanks in advance.

Edit: I have decided to install the SageMath binaries directly, and everything now works perfectly.

edit retag flag offensive close merge delete