1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00
freebsd-ports/math/ceres-solver/Makefile

110 lines
3.5 KiB
Makefile
Raw Normal View History

# $FreeBSD$
PORTNAME= ceres-solver
DISTVERSION= 1.12.0rc1
CATEGORIES= math
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Nonlinear least squares minimizer
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= eigen>=3.2.2:math/eigen3
LIB_DEPENDS= libglog.so:devel/glog
RUN_DEPENDS:= ${BUILD_DEPENDS:Meigen*}
USES= cmake:outsource compiler:${OPENMP}c++11-lib localbase shebangfix
USE_GITHUB= yes
USE_LDCONFIG= yes
SHEBANG_FILES= examples/slam/pose_graph_*/plot_results.py \
scripts/make_docs.py
CMAKE_ARGS= -DCXX11=on -DBUILD_SHARED_LIBS=on
LDFLAGS+= -Wl,--as-needed # -lccolamd -lcholmod -lrt from suitesparse
PLIST_SUB= VERSION=${PORTVERSION:R}
EXAMPLESDIR= ${PREFIX}/share/examples/${PORTNAME:S/-solver//}
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME:S/-solver//}
PORTDOCS= *
PORTEXAMPLES= *
OPTIONS_DEFINE= CUSTOM_BLAS EXAMPLES DOCS GFLAGS LAPACK OPENMP SCHUR TEST
OPTIONS_DEFAULT=CUSTOM_BLAS NETLIB OPENMP SCHUR ${OPTIONS_GROUP_SPARSE}
OPTIONS_RADIO= LAPACK
OPTIONS_RADIO_LAPACK= ATLAS GOTOBLAS NETLIB OPENBLAS
OPTIONS_GROUP= SPARSE
OPTIONS_GROUP_SPARSE= CXSPARSE EIGENSPARSE SUITESPARSE
CUSTOM_BLAS_DESC= Handcoded BLAS routines instead of Eigen
CUSTOM_BLAS_CMAKE_BOOL= CUSTOM_BLAS
DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
DOCS_USES= python:build
DOCS_CMAKE_BOOL= BUILD_DOCUMENTATION
EXAMPLES_CMAKE_BOOL= BUILD_EXAMPLES
EXAMPLES_IMPLIES= GFLAGS
GFLAGS_DESC= Google Flags support
GFLAGS_LIB_DEPENDS= libgflags.so:devel/gflags
GFLAGS_CMAKE_BOOL= GFLAGS
OPENMP_USES= compiler:openmp
OPENMP_CMAKE_BOOL= OPENMP
OPENMP_VARS= OPENMP=gcc- # XXX ports/210337
SCHUR_DESC= Fixed-size schur specializations
SCHUR_CMAKE_BOOL= SCHUR_SPECIALIZATIONS
# XXX Unbundle googletest/googlemock
TEST_CMAKE_BOOL= BUILD_TESTING
TEST_TEST_TARGET= test ARGS="-V"
TEST_IMPLIES= GFLAGS
# XXX Move to USES=cmake
TEST_VARS= TEST_WRKSRC="${CONFIGURE_WRKSRC}"
LAPACK_DESC= Linear Algebra PACKage
LAPACK_USES= fortran # LDFLAGS
LAPACK_CMAKE_ON= -DBLAS_LIBRARIES="${BLASLIB}" -DLAPACK_LIBRARIES="${LAPACKLIB}"
LAPACK_CMAKE_BOOL= LAPACK
ATLAS_USES= blaslapack:atlas
2016-10-16 00:03:35 +00:00
ATLAS_CMAKE_ON= -DBLA_VENDOR="ATLAS"
ATLAS_IMPLIES= LAPACK
GOTOBLAS_DESC= Goto blas implementation
2016-10-16 00:15:07 +00:00
GOTOBLAS_USES= blaslapack:gotoblas
2016-10-16 00:03:35 +00:00
GOTOBLAS_CMAKE_ON= -DBLA_VENDOR="Goto"
GOTOBLAS_IMPLIES= LAPACK
NETLIB_USES= blaslapack:netlib
2016-10-16 00:03:35 +00:00
NETLIB_CMAKE_ON= -DBLA_VENDOR="Generic"
NETLIB_IMPLIES= LAPACK
OPENBLAS_USES= blaslapack:openblas
2016-10-16 00:03:35 +00:00
OPENBLAS_CMAKE_ON= -DBLA_VENDOR="OpenBLAS"
OPENBLAS_IMPLIES= LAPACK
SPARSE_DESC= Sparse linear algebra library
CXSPARSE_DESC= CXSparse support
CXSPARSE_LIB_DEPENDS= libcxsparse.so:math/suitesparse
CXSPARSE_CMAKE_ON= -DCXSPARSE_INCLUDE_DIR="${LOCALBASE}/include/suitesparse"
CXSPARSE_CMAKE_BOOL= CXSPARSE
EIGENSPARSE_DESC= Eigen support
EIGENSPARSE_CMAKE_BOOL= EIGENSPARSE
SUITESPARSE_DESC= SuiteSparse support
SUITESPARSE_LIB_DEPENDS=libspqr.so:math/suitesparse
SUITESPARSE_CMAKE_BOOL= SUITESPARSE
SUITESPARSE_IMPLIES= LAPACK
post-patch-DOCS-on:
@${REINPLACE_CMD} -e 's,python,${PYTHON_CMD:T},' \
${WRKSRC}/docs/source/CMakeLists.txt
pre-install-TEST-on: do-test
post-install-EXAMPLES-on:
# Copy examples (stripped), their source and sample data but not tests programs
(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
(cd ${WRKSRC} && ${COPYTREE_SHARE} data ${STAGEDIR}${EXAMPLESDIR})
(cd ${BUILD_WRKSRC} && ${COPYTREE_SHARE} bin ${STAGEDIR}${EXAMPLESDIR})
@${RM} -r ${STAGEDIR}${EXAMPLESDIR}/bin/*_test
-@${STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/bin/* # may fail for non-root
.include <bsd.port.mk>