Skip to content

Commit

Permalink
math/dsdp: adding a SONAME to the shared library
Browse files Browse the repository at this point in the history
When building math/py-cvxopt the following error is displayed:
Error: /usr/local/lib/python3.9/site-packages/cvxopt/dsdp.cpython-39.so is
linked to /usr/local/lib/libdsdp.so which does not have a SONAME.
math/dsdp needs to be fixed.

Since I’m there, also install the static library.

PR:		274851
Approved by:	yuri 'maintainer)
  • Loading branch information
thierry-FreeBSD committed Nov 1, 2023
1 parent 8f238ff commit 2a236ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions math/dsdp/Makefile
@@ -1,6 +1,6 @@
PORTNAME= dsdp
DISTVERSION= 5.8
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= math
MASTER_SITES= https://www.mcs.anl.gov/hs/software/${PORTNAME:tu}/
DISTNAME= ${PORTNAME:tu}${DISTVERSION}
Expand All @@ -23,7 +23,7 @@ USE_LDCONFIG= yes
ALL_TARGET= all oshared all oshared

BINARY_ALIAS= make=${GMAKE} gcc=${CC}
MAKE_ENV= DSDPROOT=${WRKSRC} SH_LD="${CC} -shared"
MAKE_ENV= DSDPROOT=${WRKSRC} SH_LD="${CC} -shared -Wl,-soname,libdsdp.so.0"
CFLAGS+= -fPIC

PLIST_FILES= bin/dsdp5 \
Expand All @@ -32,6 +32,7 @@ PLIST_FILES= bin/dsdp5 \
include/dsdp/dsdplapack.h \
include/dsdp/dsdpmem.h \
include/dsdp/dsdpsys.h \
lib/libdsdp.a \
lib/libdsdp.so.0 \
lib/libdsdp.so

Expand All @@ -42,6 +43,7 @@ do-build: # the build fails to build all binaries without being called twice due
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/include/dsdp
${INSTALL_PROGRAM} ${WRKSRC}/bin/dsdp5 ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/lib/libdsdp.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${WRKSRC}/lib/libdsdp.so ${STAGEDIR}${PREFIX}/lib/libdsdp.so.0
(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -s libdsdp.so.0 libdsdp.so)
${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/dsdp
Expand Down
2 changes: 1 addition & 1 deletion math/dsdp/files/patch-Makefile
Expand Up @@ -9,6 +9,6 @@
- ${SH_LD} ${DSDPLIBSO} *.o -o ${DSDPLIBSO}; \
+ echo "building ${DSDPLIBSO}"
+ ${AR} x ${DSDPLIB}
+ $(CC) -shared $(LDFLAGS) -llapack -lblas -lm *.o -o ${DSDPLIBSO}; \
+ $(SH_LD) $(LDFLAGS) -llapack -lblas -lm *.o -o ${DSDPLIBSO}; \
cd ../ ; \
${RM} tmp

0 comments on commit 2a236ba

Please sign in to comment.