Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing nauty in static build #613

Closed
fontanf opened this issue Aug 19, 2023 · 3 comments
Closed

Missing nauty in static build #613

fontanf opened this issue Aug 19, 2023 · 3 comments

Comments

@fontanf
Copy link

fontanf commented Aug 19, 2023

I use CBC inside one of my codes. I downloaded this static build https://github.com/coin-or/Cbc/releases/download/releases%2F2.10.10/Cbc-releases.2.10.10-x86_64-ubuntu20-gcc940-static.tar.gz

At the linking step, I get:

external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::operator=(CbcNauty const&): error: undefined reference to 'alloc_error'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::operator=(CbcNauty const&): error: undefined reference to 'alloc_error'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::operator=(CbcNauty const&): error: undefined reference to 'alloc_error'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'nauty'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'nautil_freedyn'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'nauty_freedyn'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'dispatch_sparse'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'sparsenauty'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::CbcNauty(int, unsigned long const*, int const*, int const*): error: undefined reference to 'nauty_check'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::CbcNauty(int, unsigned long const*, int const*, int const*): error: undefined reference to 'dispatch_graph'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::CbcNauty(int, unsigned long const*, int const*, int const*): error: undefined reference to 'alloc_error'
external/coinor_linux/lib/libCbc.a(CbcSymmetry.o):CbcSymmetry.cpp:function CbcNauty::computeAuto(): error: undefined reference to 'nausparse_freedyn'

It seems that nauty is not included in this build. I don't have this issue with the dynamic builds.

@fontanf
Copy link
Author

fontanf commented Aug 20, 2023

I managed to make it work by installing nauty via the package manager:

sudo apt install libnauty2-dev

But again, I didn't need it with the dynamic build. So I don't know if it's the expected behavior

@tkralphs
Copy link
Member

You can check the workflow that does the build here: https://github.com/coin-or/Cbc/blob/stable/2.10/.github/workflows/linux-ci.yml

Nauty is found and linked in both the static and dynamic builds. You can verify this in the logs from a recent workflow run (the logs from the release builds have expired):

https://github.com/coin-or/Cbc/actions/runs/5453288036/job/14762540588#step:5:621
https://github.com/coin-or/Cbc/actions/runs/5453288036/job/14762540426#step:5:627

I downloaded both and verified that the dynamic build does have a dependency on Nauty:

~/tmp/Cbc-dynamic20/lib > ldd libCbc.so
        ...
        libnauty.so.2 => /usr/lib/x86_64-linux-gnu/libnauty.so.2 (0x00007f1af9d4e000)
        ...

My guess is that you had libnauty2 on your system already, but that package only provides dynamic libraries. libnauty2-dev provides the static libraries and so the linking would have only failed in the static build before installing the latter package. Installing that fixed the linking for the static build.

The change in behavior from 2.10.9 to 2.10.10 was due to #593, which modified the workflow so that nauty is properly detected by configure. Previously, the nauty package was being installed, but nauty was not detected by configure and so not included in the build.

@fontanf
Copy link
Author

fontanf commented Aug 21, 2023

Thank you for your quick reply.

My guess is that you had libnauty2 on your system already, but that package only provides dynamic libraries. libnauty2-dev provides the static libraries and so the linking would have only failed in the static build before installing the latter package. Installing that fixed the linking for the static build.

Indeed, that sounds right. Sorry for the inconvenience

@fontanf fontanf closed this as completed Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants