2016-10-15 23:53:45 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= ceres-solver
|
2018-03-26 01:05:20 +00:00
|
|
|
DISTVERSION= 1.14.0
|
2018-05-15 20:42:31 +00:00
|
|
|
PORTREVISION= 3
|
2016-10-15 23:53:45 +00:00
|
|
|
CATEGORIES= math
|
|
|
|
|
2017-08-13 14:25:27 +00:00
|
|
|
MAINTAINER= jbeich@FreeBSD.org
|
|
|
|
COMMENT= Nonlinear least squares minimizer
|
|
|
|
|
2016-10-15 23:53:45 +00:00
|
|
|
LICENSE= BSD3CLAUSE
|
|
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
|
|
|
|
|
|
|
LIB_DEPENDS= libglog.so:devel/glog
|
|
|
|
RUN_DEPENDS:= ${BUILD_DEPENDS:Meigen*}
|
|
|
|
|
2018-01-02 16:49:24 +00:00
|
|
|
USES= cmake:outsource compiler:${OPENMP}c++11-lib eigen:3 localbase shebangfix
|
2016-10-15 23:53:45 +00:00
|
|
|
USE_GITHUB= yes
|
|
|
|
USE_LDCONFIG= yes
|
|
|
|
SHEBANG_FILES= examples/slam/pose_graph_*/plot_results.py \
|
|
|
|
scripts/make_docs.py
|
2018-01-01 13:42:54 +00:00
|
|
|
CMAKE_ON= CXX11 BUILD_SHARED_LIBS
|
2018-03-26 01:05:20 +00:00
|
|
|
CMAKE_OFF= BUILD_BENCHMARKS
|
2016-10-15 23:53:45 +00:00
|
|
|
LDFLAGS+= -Wl,--as-needed # -lccolamd -lcholmod -lrt from suitesparse
|
2016-11-13 12:44:25 +00:00
|
|
|
PLIST_SUB= VERSION=${DISTVERSION:C/rc.*//}
|
2016-10-15 23:53:45 +00:00
|
|
|
EXAMPLESDIR= ${PREFIX}/share/examples/${PORTNAME:S/-solver//}
|
|
|
|
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME:S/-solver//}
|
|
|
|
PORTDOCS= *
|
|
|
|
PORTEXAMPLES= *
|
|
|
|
|
2018-04-15 23:57:29 +00:00
|
|
|
OPTIONS_DEFINE= CUSTOM_BLAS EXAMPLES DOCS GFLAGS LAPACK SCHUR TEST
|
2018-03-26 01:05:06 +00:00
|
|
|
OPTIONS_DEFAULT=CUSTOM_BLAS CXSPARSE OPENBLAS OPENMP SCHUR SUITESPARSE
|
2018-03-26 01:05:20 +00:00
|
|
|
OPTIONS_RADIO= LAPACK THREADS
|
2016-10-15 23:53:45 +00:00
|
|
|
OPTIONS_RADIO_LAPACK= ATLAS GOTOBLAS NETLIB OPENBLAS
|
2018-03-26 01:05:20 +00:00
|
|
|
OPTIONS_RADIO_THREADS= OPENMP TBB
|
2016-10-15 23:53:45 +00:00
|
|
|
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
|
2017-11-30 15:50:30 +00:00
|
|
|
DOCS_USES= python:2.7,build
|
2016-10-15 23:53:45 +00:00
|
|
|
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
|
2016-12-06 22:53:54 +00:00
|
|
|
# XXX ports/199603 + ports/210337
|
|
|
|
OPENMP_VARS= OPENMP=gcc-
|
2016-10-15 23:53:45 +00:00
|
|
|
|
|
|
|
SCHUR_DESC= Fixed-size schur specializations
|
|
|
|
SCHUR_CMAKE_BOOL= SCHUR_SPECIALIZATIONS
|
|
|
|
|
2018-03-26 01:05:20 +00:00
|
|
|
TBB_DESC= Intel threading building blocks
|
|
|
|
TBB_LIB_DEPENDS= libtbb.so:devel/tbb
|
|
|
|
TBB_CMAKE_BOOL= TBB
|
|
|
|
|
2016-10-15 23:53:45 +00:00
|
|
|
# XXX Unbundle googletest/googlemock
|
|
|
|
TEST_CMAKE_BOOL= BUILD_TESTING
|
|
|
|
TEST_TEST_TARGET= test ARGS="-V"
|
|
|
|
TEST_IMPLIES= GFLAGS
|
|
|
|
|
|
|
|
LAPACK_DESC= Linear Algebra PACKage
|
|
|
|
LAPACK_USES= fortran # LDFLAGS
|
|
|
|
LAPACK_CMAKE_BOOL= LAPACK
|
2018-05-15 20:42:31 +00:00
|
|
|
LAPACK_CMAKE_ON= -DCMAKE_POLICY_DEFAULT_CMP0056:STRING=NEW # USES=fortran
|
2018-05-15 20:42:51 +00:00
|
|
|
# Avoid conflict with Ceres threading by using single-threaded BLAS library.
|
|
|
|
# BLASLIB from USES=blaslapack cannot be used as it's multi-threaded.
|
|
|
|
# https://github.com/xianyi/OpenBLAS/wiki/faq#multi-threaded
|
2016-10-15 23:53:45 +00:00
|
|
|
ATLAS_USES= blaslapack:atlas
|
2018-05-15 20:41:52 +00:00
|
|
|
ATLAS_CMAKE_ON= -DBLA_VENDOR:STRING="ATLAS" \
|
|
|
|
-DLAPACK_LIBRARIES:STRING=alapack
|
2016-10-15 23:53:45 +00:00
|
|
|
ATLAS_IMPLIES= LAPACK
|
|
|
|
GOTOBLAS_DESC= Goto blas implementation
|
2016-10-16 00:15:07 +00:00
|
|
|
GOTOBLAS_USES= blaslapack:gotoblas
|
2018-05-15 20:41:52 +00:00
|
|
|
GOTOBLAS_CMAKE_ON= -DBLA_VENDOR:STRING="Goto"
|
2016-10-15 23:53:45 +00:00
|
|
|
GOTOBLAS_IMPLIES= LAPACK
|
|
|
|
NETLIB_USES= blaslapack:netlib
|
2018-05-15 20:41:52 +00:00
|
|
|
NETLIB_CMAKE_ON= -DBLA_VENDOR:STRING="Generic"
|
2016-10-15 23:53:45 +00:00
|
|
|
NETLIB_IMPLIES= LAPACK
|
|
|
|
OPENBLAS_USES= blaslapack:openblas
|
2018-05-15 20:41:52 +00:00
|
|
|
OPENBLAS_CMAKE_ON= -DBLA_VENDOR:STRING="OpenBLAS"
|
2016-10-15 23:53:45 +00:00
|
|
|
OPENBLAS_IMPLIES= LAPACK
|
|
|
|
|
|
|
|
SPARSE_DESC= Sparse linear algebra library
|
|
|
|
CXSPARSE_DESC= CXSparse support
|
|
|
|
CXSPARSE_LIB_DEPENDS= libcxsparse.so:math/suitesparse
|
2018-01-01 13:42:54 +00:00
|
|
|
CXSPARSE_CMAKE_ON= -DCXSPARSE_INCLUDE_DIR:PATH="${LOCALBASE}/include/suitesparse"
|
2016-10-15 23:53:45 +00:00
|
|
|
CXSPARSE_CMAKE_BOOL= CXSPARSE
|
2016-10-16 17:00:02 +00:00
|
|
|
EIGENSPARSE_DESC= Simplicial Cholesky factorization in Eigen
|
2016-10-15 23:53:45 +00:00
|
|
|
EIGENSPARSE_CMAKE_BOOL= EIGENSPARSE
|
2016-10-16 17:00:02 +00:00
|
|
|
EIGENSPARSE_VARS= LICENSE+=LGPL21+ LICENSE_COMB=multi \
|
|
|
|
LICENSE_FILE_BSD3CLAUSE="${LICENSE_FILE}"
|
2016-10-15 23:53:45 +00:00
|
|
|
SUITESPARSE_DESC= SuiteSparse support
|
|
|
|
SUITESPARSE_LIB_DEPENDS=libspqr.so:math/suitesparse
|
|
|
|
SUITESPARSE_CMAKE_BOOL= SUITESPARSE
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-01-03 08:44:59 +00:00
|
|
|
.include <bsd.port.mk>
|