Bug 252162

Summary: science/wannier90: libwannier is not registered by ldconfig
Product: Ports & Packages Reporter: Thierry Thomas <thierry>
Component: Individual Port(s)Assignee: Yuri Victorovich <yuri>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (yuri)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 252221    
Attachments:
Description Flags
Register the library + add a test target.
none
Register libwannier90 none

Description Thierry Thomas freebsd_committer freebsd_triage 2020-12-26 15:22:23 UTC
Created attachment 220950 [details]
Register the library + add a test target.

science/wannier90 installs a shared library, but it is not registered: the attached patch fix that.

Since I'm there, replace LIB_DEPENDS by USES+=blaslapack and add a test target.

Note: some tests fail.
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2020-12-26 22:13:18 UTC
Created attachment 220969 [details]
Register libwannier90

Actually it seems that the commonly expected name is rather libwannier90.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-27 02:31:02 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-12-27 02:31:36 UTC
A commit references this bug:

Author: yuri
Date: Sun Dec 27 02:31:01 UTC 2020
New revision: 559333
URL: https://svnweb.freebsd.org/changeset/ports/559333

Log:
  science/wannier90: Fix registration of libwannier in ldconfig by adding the symlink; Add the 'test' target.

  PR:		252162
  Submitted by:	thierry

Changes:
  head/science/wannier90/Makefile
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2020-12-27 11:19:29 UTC
Yuri, sorry for the inconvenience, but it seems that we also need a libwannier.so, because this is the soname:

$ objdump -p /usr/local/lib/libwannier90.so.0 | grep SONAME
  SONAME               libwannier.so

Please accept my additional patch to add it:

Index: science/wannier90/Makefile
===================================================================
--- science/wannier90/Makefile  (revision 559348)
+++ science/wannier90/Makefile  (working copy)
@@ -3,7 +3,7 @@
 PORTNAME=      wannier90
 DISTVERSIONPREFIX=     v
 DISTVERSION=   3.1.0
-PORTREVISION=  1
+PORTREVISION=  2
 CATEGORIES=    science
 
 MAINTAINER=    yuri@FreeBSD.org
@@ -29,6 +29,7 @@
 PLIST_FILES=   bin/postw90.x \
                bin/w90chk2chk.x \
                bin/wannier90.x \
+               lib/libwannier.so \
                lib/libwannier90.so \
                lib/libwannier90.so.0
 
@@ -43,5 +44,6 @@
 .endfor
        ${INSTALL_LIB} ${WRKSRC}/src/obj/libwannier.so ${STAGEDIR}${PREFIX}/lib/libwannier90.so.0
        ${LN} -sf libwannier90.so.0 ${STAGEDIR}${PREFIX}/lib/libwannier90.so
+       ${LN} -sf libwannier90.so ${STAGEDIR}${PREFIX}/lib/libwannier.so
 
 .include <bsd.port.mk>
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-27 22:24:19 UTC
I think that this is simply a case of broken shared library.

SONAME=libwannier.so which is a non-existent file name.

I am not sure that adding it solves the problem:
> $ ldconfig -r | grep wannier
> 	953:-lwannier90.0 => /usr/local/lib/libwannier90.so.0

ldconfig ignores libwannier.so.
Comment 6 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-27 22:30:53 UTC
The library name should be without "90". I will fix this.
Comment 7 Thierry Thomas freebsd_committer freebsd_triage 2020-12-27 22:44:57 UTC
This is not a problem with ldconfig (this one was fixed yesterday by r559333).

But if you build a program linked with libwannier90.so, the linker register the library named according to it soname. ldd will show it to you.

I noticed it when building abinit: I've just sent a PR about it, see PR 252221.
Comment 8 Thierry Thomas freebsd_committer freebsd_triage 2020-12-27 22:46:57 UTC
(In reply to Yuri Victorovich from comment #6)
It is known as libwannier90 and abinit looks for it.
If you prefer to not create another symlink, another possibility is to patch the makefile to change the soname.