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

copycat: Change magic-static to magic #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fix the error:
ld: library not found for -lmagic-static
@kwrodarmer
Copy link
Contributor

copycat is an NCBI internal tool that is statically linked - we cannot have a dynamic link here. You're welcome to use it if you can figure out something useful, but it is not for external use.

@kwrodarmer kwrodarmer closed this Dec 15, 2017
@sjackman
Copy link
Author

sjackman commented Dec 15, 2017

I have no particular need for copycat. I simply want to run make without it failing. Any suggestions?

@kwrodarmer
Copy link
Contributor

If you are unable to build, then let's file a bug against configuration that it doesn't pick up on the fact that you don't have a static libmagic.

I'm glad you got the build to work, and we're close to a new release - so we can probably make this adjustment quickly.

By the way, we've been planning a big overhaul of the whole make system for a while...

@kwrodarmer kwrodarmer reopened this Dec 15, 2017
@sjackman
Copy link
Author

Why is this option -smagic-static rather than the usual -lmagic-static? I couldn't find a relevant option for -s in the man page for either gcc or ld.

@sjackman
Copy link
Author

Ubuntu does install a static library named libmagic.a.
See https://packages.ubuntu.com/search?mode=filename&suite=xenial&section=all&arch=amd64&keywords=libmagic.a&searchon=contents
I don't know of any distribution of Linux that installs a file named libmagic-static.a.

@sjackman
Copy link
Author

By the way, we've been planning a big overhaul of the whole make system for a while...

I prefer the autotools myself, autoconf and automake.

@sjackman
Copy link
Author

If you are unable to build, then let's file a bug against configuration that it doesn't pick up on the fact that you don't have a static libmagic.

Looks like this line should be -lmagic-static:

-            $library = '-lmagic';
+            $library = '-lmagic-static';

$library = '-lmagic';

@kwrodarmer
Copy link
Contributor

kwrodarmer commented Dec 15, 2017

So many comments! Let's see:

  1. the option -smagic is interpreted by a linker driver that knows it must perform a static link for this library. We produce our own internal builds of several libraries, and used to build libmagic before this began to break across several hosts. Our own build produces a libmagic-static.a symlink to libmagic.a and it's used as a kludge to prevent the linker from preferring a shared library.

  2. Yes, nobody does the *-static.a link trick, and we don't try to depend upon it. I don't know why we're trying to build copycat for you (something I have to look into), but the correct behavior for the build in your case is to not try to build it.

  3. Many people prefer autoconf tools. We don't, for many (good) reasons. First, we don't need it; our build was originally perfectly able to do everything it needed with just make. So many people complained that it didn't have a configure step that we added it. Second, autoconf tools are great for producing builds for a particular host, or a golden host for distribution; we build tools that have a much wider distribution than that, and the idea of configuring for a host is absurd. So autoconf is not on the table.

  4. I think probably the line should read -smagic.

@klymenko
Copy link
Contributor

How can I reproduce the problem with library not found for -lmagic-static?

I can build copycat on Ubuntu after I installed libmagic-dev.

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

Successfully merging this pull request may close these issues.

3 participants