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

autoconf build does not version the library #196

Closed
ahundt opened this issue Jun 11, 2017 · 21 comments
Closed

autoconf build does not version the library #196

ahundt opened this issue Jun 11, 2017 · 21 comments

Comments

@ahundt
Copy link

ahundt commented Jun 11, 2017

./configure; make install and cmake ..; make install produce different libraries

The cmake version doesn't create this missing library/symlink:

  /usr/local/opt/glog/lib/libglog.0.dylib

discovered in:
Homebrew/homebrew-core#14379

ahundt added a commit to ahundt/homebrew-core that referenced this issue Jun 11, 2017
@ilovezfs
Copy link

@shinh any idea what the problem here is? Thanks!

@andyleejordan
Copy link
Contributor

CMake, not being Autotools, doesn't make use of libtool to version shared libraries (I imagine this is what's happening here). CMake can certainly be setup to add versions to libraries; it's just up to the owner to decide if they want that.

@sergiud
Copy link
Collaborator

sergiud commented Jul 31, 2017

Actually, CMake does set the library version. However, I don't understand why libglog.0.dylib is expected instead of libglog.3.dylib? @ahundt Can you elaborate?

Edit: Mixed up major and minor version in library's name.

@andyleejordan
Copy link
Contributor

(I stand corrected, Glog's is even setup to version the libraries. Nice!)

@ahundt
Copy link
Author

ahundt commented Jul 31, 2017

Homebrew has automated compilation and install scripts. Forgive if I misunderstand because this is from memory and skimming the issues again. As of the latest release at the time of writing the dylib file that was placed in the folder by the make script was libglog.0.dylib, which the CMake script did not create. I think the issue is that:

  1. installed library names should be consistent between the build tools
  2. installed CMake config files (if any), such as a glogConfig.cmake should also be set up in a manner consistent with item 1.

I think the other aspect of the issue in Homebrew/homebrew-core#14379 is something I should report to github.com/facebook/folly:

failed: brew linkage --test folly
Stacktrace

        Missing libraries:
  /usr/local/opt/glog/lib/libglog.0.dylib

Since /usr/local/opt/glog/lib/libglog.0.dylib is apparently what was generated in the past. However I think that depends on a correction here first to ensure the library name is correct for each build tool.

@ahundt
Copy link
Author

ahundt commented Jul 31, 2017

I created an equivalent folly issue:
facebook/folly#648

@sergiud
Copy link
Collaborator

sergiud commented Jul 31, 2017

autoconf build of glog does not seem to version the library. Hence, all version components are zero.

With regard to CMake build of glog. What are the issues exactly? I would at least expect a libglog.0.dylib to be generated. Is this not the case? If so, can you attach the build and install log for the CMake version of glog?

Edit: Why do you need both the autoconf and the CMake version of glog to package it?

@ahundt
Copy link
Author

ahundt commented Aug 1, 2017

Edit: Why do you need both the autoconf and the CMake version of glog to package it?

The names of library versions need to be consistent across installers in a single release so other packages that use glog can find and link against it correctly regardless of the installer used.

In my case, once that is fixed I can switch homebrew from installing with autoconf to CMake. In particular, I'm looking for glogConfig.cmake to be generated. However, because the version name changes with the build tool, a library I'm not using breaks (folly). For that reason my downstream change can't be merged because homebrew considers this an upstream issue with glog.

@sergiud
Copy link
Collaborator

sergiud commented Aug 1, 2017

CMake already generates a package config for glog called glog-config.cmake. So now I'm really confused what are the issues here.

Again, I'm asking you to attach the log for make and make install steps for the CMake build so I can understand what is going on.

@ahundt
Copy link
Author

ahundt commented Aug 1, 2017

The issue is the library name, which needs to be consistent with different build systems.

@sergiud
Copy link
Collaborator

sergiud commented Aug 1, 2017

OK, please attach the log. Otherwise I'm not able to help you.

@ahundt
Copy link
Author

ahundt commented Aug 1, 2017

my understanding is autoconf will create:
/usr/local/opt/glog/lib/libglog.0.dylib

and cmake will create:
/usr/local/opt/glog/lib/libglog.3.dylib

Is anything still unclear?

@sergiud
Copy link
Collaborator

sergiud commented Aug 1, 2017

Yes, please post the log. This is the fourth time I'm asking you to do so.

@ahundt
Copy link
Author

ahundt commented Aug 1, 2017

@sergiud
Copy link
Collaborator

sergiud commented Aug 1, 2017

From the log:

-- Installing: /usr/local/lib/libglog.0.dylib

You need to set CMAKE_PREFIX_PATH=/usr/local/opt if you want the files to be installed there.

@ahundt
Copy link
Author

ahundt commented Aug 1, 2017

As mentioned in the original post, the installers still created different dylibs/symlinks. autoconf did not create /usr/local/lib/libglog.0.3.5.dylib. I didn't really worry about the path I set since that's not the issue.

@sergiud
Copy link
Collaborator

sergiud commented Aug 1, 2017

As mentioned in the original post, the installers still created different dylibs/symlinks. autoconf did not create /usr/local/lib/libglog.0.3.5.dylib.

You actually didn't. This is what you reported:

The cmake version doesn't create this missing library/symlink: /usr/local/opt/glog/lib/libglog.0.dylib

which is obviously not true.

Could please change the issue's title to something along the lines "autoconf build does not version the library"? Thanks!

@ahundt ahundt changed the title ./configure; make install and cmake ..; make install produce different libraries autoconf build does not version the library Aug 1, 2017
@ahundt
Copy link
Author

ahundt commented Aug 5, 2017

@sergiud done, sorry about the mistake.

@sergiud
Copy link
Collaborator

sergiud commented Aug 5, 2017

@ahundt Thanks!

@ahundt
Copy link
Author

ahundt commented Dec 7, 2017

Are there any next steps for this?

@sergiud
Copy link
Collaborator

sergiud commented Dec 9, 2017

Not until someone provides a patch. In the meantime you can use the CMake build.

@sergiud sergiud closed this as completed Mar 30, 2021
@sergiud sergiud mentioned this issue May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants