рецепт для приложения, использующего dlib и opencv - PullRequest
0 голосов
/ 06 июля 2018

Я сделал yocto рецепт для dlib, а также добавил пакет opencv в local.conf. Теперь я хочу сделать рецепт для приложения, которое использует библиотеки dlib и opencv. Я попробовал следующий рецепт, но когда я пытаюсь собрать его с bitbake application, он выдает мне некоторые ошибки. dlib recipe

SUMMARY = "A toolkit for making real world machine learning and data analysis applications"
HOMEPAGE = "https://github.com/davisking/dlib"

LICENSE = "Boost-Software"
LIC_FILES_CHKSUM = "file://dlib/LICENSE.txt;md5=2c7a3fa82e66676005cd4ee2608fd7d2 \
                    file://dlib/external/pybind11/LICENSE;md5=beb87117af69fd10fbf9fb14c22a2e62 \
                    file://dlib/external/libpng/LICENSE;md5=243135ddedf702158f9170807cbcfb66 \
                    file://docs/docs/license.xml;md5=2e6ff4080dcb217d4d300b90e9aabb5b \
                    file://examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=57eee82829ed297e23d84de5f905afee \
                    file://examples/video_frames/license.txt;md5=127ee508b60a6be9dea8af3b441993dc \
                    file://python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=064f53ab40ea2b6a4bba1324149e4fde"

SRC_URI = "git://github.com/davisking/dlib.git;protocol=https"

PV = "1.0+git${SRCPV}"
SRCREV = "3b794540baeabbcd033b544230401967106d5483"

S = "${WORKDIR}/git"

do_compile() {
        cd ${S}
        cd dlib
        mkdir build
        cd build
        cmake ..
        sudo make install
}

FILES_${PN} += "/${base_prefix}"
inherit cmake

application recipe

DESCRIPTION = "Simple application"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://application.cpp;md5=df22013877ba7d830e9993ae1d77d724"

SRC_URI = "file://application.cpp"

S = "${WORKDIR}"

do_compile() {
        ${CXX}  -std=c++11 -O3 -L${libdir}/libdlib.a -I${includedir}/dlib/ -lpthread -lX11  application.cpp ${LDFLAGS} `pkg-config --cflags --libs opencv` -o application
}

do_install() {
        install -d ${D}${bindir}
        install -m 0755 application ${D}${bindir}
}

некоторые errors, когда я пытаюсь bitbake application:

| application.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x1a8): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
| application.cpp:(.text._ZN4dlib11pinv_helperINS_9matrix_opINS_8op_transINS_6matrixIdLl3ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEEEEEKNS3_INT_4typeEXsrSA_2NCEXsrSA_2NRENSA_16mem_manager_typeES6_EERKNS_10matrix_expISA_EEd[_ZN4dlib11pinv_helperINS_9matrix_opINS_8op_transINS_6matrixIdLl3ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEEEEEKNS3_INT_4typeEXsrSA_2NCEXsrSA_2NRENSA_16mem_manager_typeES6_EERKNS_10matrix_expISA_EEd]+0x4fc): undefined reference to `cblas_dgemm'
| application.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0x8e9c): undefined reference to `dlib::base64::~base64()'

Что я могу сделать, чтобы решить эту проблему?

1 Ответ

0 голосов
/ 07 июля 2018

Измените рецепт dlib на

SUMMARY = "A toolkit for making real world machine learning and data analysis applications"
HOMEPAGE = "https://github.com/davisking/dlib"

LICENSE = "Boost-Software"
LIC_FILES_CHKSUM = "file://dlib/LICENSE.txt;md5=2c7a3fa82e66676005cd4ee2608fd7d2 \
                    file://dlib/external/pybind11/LICENSE;md5=beb87117af69fd10fbf9fb14c22a2e62 \
                    file://dlib/external/libpng/LICENSE;md5=243135ddedf702158f9170807cbcfb66 \
                    file://docs/docs/license.xml;md5=2e6ff4080dcb217d4d300b90e9aabb5b \
                    file://examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=57eee82829ed297e23d84de5f905afee \
                    file://examples/video_frames/license.txt;md5=127ee508b60a6be9dea8af3b441993dc \
                    file://python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=064f53ab40ea2b6a4bba1324149e4fde"

SRC_URI = "git://github.com/davisking/dlib.git;protocol=https"

PV = "1.0+git${SRCPV}"
SRCREV = "3b794540baeabbcd033b544230401967106d5483"

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE += "-DDLIB_NO_GUI_SUPPORT=ON -DBUILD_SHARED_LIBS=ON"

Тогда в вашем приложении рецепт

DESCRIPTION = "Simple application"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://application.cpp;md5=df22013877ba7d830e9993ae1d77d724"

inherit pkgconfig 
DEPENDS += "dlib opencv"

SRC_URI = "file://application.cpp"

S = "${WORKDIR}"

do_compile() {
        ${CXX} ${CXXFLAGS} -std=c++11 -O3 -I${STAGING_INCDIR}/dlib -pthread application.cpp -o application ${LDFLAGS} `pkg-config --cflags --libs opencv` -lX11 -ldlib
}

do_install() {
        install -D -m 0755 application ${D}${bindir}/application
}
...