# $NetBSD: Makefile.common,v 1.19 2024/01/08 21:28:55 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 WRKSRC= ${WRKDIR}/${DISTNAME} .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 \ -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 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 "../../devel/cmake/build.mk" .include "../../math/lapack/version.mk"