pkgsrc/math/lapack/Makefile.common
2021-06-15 15:06:23 +00:00

74 lines
2.3 KiB
Makefile

# $NetBSD: Makefile.common,v 1.15 2021/06/15 15:06:23 thor Exp $
# used by math/blas/Makefile
# used by math/cblas/Makefile
# used by math/lapacke/Makefile
# used by math/lapack/Makefile
# used by math/blas64/Makefile
# used by math/cblas64/Makefile
# used by math/lapacke64/Makefile
# used by math/lapack64/Makefile
# Common Makefile for packages derived from the Netlib BLAS/LAPACK sources.
# Package Makefile sets LAPACK_COMPONENT and LAPACK_COMPONENT_CMAKE_ARGS to
# choose the library to install.
# LAPACK_COMPONENT can be "lapack", "lapacke", or "cblas",
# or any of those with 64 suffix for ILP64 mode (64 bit indexing).
DISTNAME= lapack-${NETLIB_BLAS_VERSION}
PKGNAME= ${LAPACK_COMPONENT}-${NETLIB_BLAS_VERSION}
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_GITHUB:=Reference-LAPACK/}
GITHUB_PROJECT= lapack
GITHUB_TAG= v${NETLIB_BLAS_VERSION}
HOMEPAGE= https://www.netlib.org/lapack/
LICENSE= modified-bsd
# All parts are in the same section
PATCHDIR= ${.CURDIR}/../../math/lapack/patches
DISTINFO_FILE= ${.CURDIR}/../../math/lapack/distinfo
USE_LANGUAGES= c fortran
USE_CMAKE= yes
WRKSRC= ${WRKDIR}/${DISTNAME}
CONFIGURE_DIRS= build
CMAKE_ARG_PATH= ${WRKSRC}
.include "../../mk/bsd.prefs.mk"
.if !empty(LAPACK_COMPONENT:M*64)
. if empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@)
PKG_FAIL_REASON+= "${LAPACK_COMPONENT} incompatible with non-64-bit platform"
. endif
HEADERDIR= netlib64
.else
HEADERDIR= netlib
.endif
# Note: We patch the build to install both static and
# shared libraries.
CMAKE_ARGS= -DBUILD_DEPRECATED=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_INSTALL_INCLUDEDIR=${PREFIX}/include/${HEADERDIR} \
${LAPACK_COMPONENT_CMAKE_ARGS}
# The cmake files are not ready for prime time.
post-install:
rm -rf "${DESTDIR}${PREFIX}/lib/cmake"
.if ${HEADERDIR} == netlib
# Install all headers into subdirectories netlib or netlib64, link
# the default ones to include, so that simple #include <cblas.h> works
# as before, as well as with matching -Iincludedir.
# This also gives us the option of selecting a different symlinked
# default on the next reworking of BLAS stuff.
if ${TEST} -e "${DESTDIR}${PREFIX}/include/${HEADERDIR}"; then \
cd "${DESTDIR}${PREFIX}/include"; for f in ${HEADERDIR}/*.h; do ln -s $$f .; done \
fi
.endif
.include "../../math/lapack/version.mk"
post-extract:
${RUN} ${MKDIR} ${WRKSRC}/build