error with jrtplib 3.11 - c++

I need help. I try to build JRTPLIB 3.1.1 with SRTP 2.1.0 and OpenSSL 1.1.0 but got linker error while try to make JRTPLIB.
Dependencies:
Debian 9 (also tried on Ubuntu 16.04 LTS)
JRTPLIB v.3_1_11(from git+changes)
JTHREAD v.1_3_3 (from git)
LIBSRTP v.2_1_0 (by tag)
LIBSSL v.1_1_0 Stable (by branch)
Source changes:
JRTPLIB v.3_1_11 (from git): changed srtp to srtp2; link to lib source archive: https://drive.google.com/drive/folders/0B_Q0HXvHrCzabVpsSUp0TXNka1U?usp=sharing
Cmake settings (image cmake_JRTPLIB.JPG): https://drive.google.com/drive/folders/0B_Q0HXvHrCzabVpsSUp0TXNka1U?usp=sharing
Build:
1)OpenSSL:
build from source and also tried on a Virtual Machine to install libssl1.1 and libssl-dev by sudo apt-get install libssl1.1 libssl-dev)
2)libSRTP:
$./configure --enable-debug-logging --enable-log-stdout --enable-openssl
3)JTHREAD: build with cmake
4)JRTPLIB: Cmake config - see image cmake_JRTPLIB.JPG
$make
Error log:
Scanning dependencies of target jrtplib-static
[ 1%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpapppacket.cpp.o
[ 2%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpbyepacket.cpp.o
[ 3%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpcompoundpacket.cpp.o
[ 4%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpcompoundpacketbuilder.cpp.o
[ 4%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcppacket.cpp.o
[ 5%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcppacketbuilder.cpp.o
[ 6%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcprrpacket.cpp.o
[ 7%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpscheduler.cpp.o
[ 8%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsdesinfo.cpp.o
[ 8%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsdespacket.cpp.o
[ 9%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsrpacket.cpp.o
[ 10%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpcollisionlist.cpp.o
[ 11%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpdebug.cpp.o
[ 12%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtperrors.cpp.o
[ 12%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpinternalsourcedata.cpp.o
[ 13%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv4address.cpp.o
[ 14%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv6address.cpp.o
[ 15%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv4destination.cpp.o
[ 16%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv6destination.cpp.o
[ 16%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtplibraryversion.cpp.o
[ 17%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppacket.cpp.o
[ 18%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppacketbuilder.cpp.o
[ 19%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppollthread.cpp.o
[ 20%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandom.cpp.o
[ 20%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomrand48.cpp.o
[ 21%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomrands.cpp.o
[ 22%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomurandom.cpp.o
[ 23%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsession.cpp.o
[ 24%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsessionparams.cpp.o
[ 25%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsessionsources.cpp.o
[ 25%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsourcedata.cpp.o
[ 26%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsources.cpp.o
[ 27%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptimeutilities.cpp.o
[ 28%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpudpv4transmitter.cpp.o
[ 29%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpudpv6transmitter.cpp.o
[ 29%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpbyteaddress.cpp.o
[ 30%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpexternaltransmitter.cpp.o
[ 31%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsecuresession.cpp.o
[ 32%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpabortdescriptors.cpp.o
[ 33%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptcpaddress.cpp.o
[ 33%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptcptransmitter.cpp.o
[ 34%] Building CXX object src/CMakeFiles/jrtplib-static.dir/extratransmitters/rtpfaketransmitter.cpp.o
[ 35%] Linking CXX static library libjrtp.a
[ 35%] Built target jrtplib-static
Scanning dependencies of target jrtplib-shared
[ 35%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpapppacket.cpp.o
[ 36%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpbyepacket.cpp.o
[ 37%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpcompoundpacket.cpp.o
[ 38%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpcompoundpacketbuilder.cpp.o
[ 39%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcppacket.cpp.o
[ 39%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcppacketbuilder.cpp.o
[ 40%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcprrpacket.cpp.o
[ 41%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpscheduler.cpp.o
[ 42%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsdesinfo.cpp.o
[ 43%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsdespacket.cpp.o
[ 44%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsrpacket.cpp.o
[ 44%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpcollisionlist.cpp.o
[ 45%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpdebug.cpp.o
[ 46%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtperrors.cpp.o
[ 47%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpinternalsourcedata.cpp.o
[ 48%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv4address.cpp.o
[ 48%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv6address.cpp.o
[ 49%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv4destination.cpp.o
[ 50%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv6destination.cpp.o
[ 51%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtplibraryversion.cpp.o
[ 52%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppacket.cpp.o
[ 52%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppacketbuilder.cpp.o
[ 53%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppollthread.cpp.o
[ 54%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandom.cpp.o
[ 55%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomrand48.cpp.o
[ 56%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomrands.cpp.o
[ 56%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomurandom.cpp.o
[ 57%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsession.cpp.o
[ 58%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsessionparams.cpp.o
[ 59%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsessionsources.cpp.o
[ 60%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsourcedata.cpp.o
[ 60%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsources.cpp.o
[ 61%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptimeutilities.cpp.o
[ 62%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpudpv4transmitter.cpp.o
[ 63%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpudpv6transmitter.cpp.o
[ 64%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpbyteaddress.cpp.o
[ 64%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpexternaltransmitter.cpp.o
[ 65%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsecuresession.cpp.o
[ 66%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpabortdescriptors.cpp.o
[ 67%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptcpaddress.cpp.o
[ 68%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptcptransmitter.cpp.o
[ 69%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/extratransmitters/rtpfaketransmitter.cpp.o
[ 69%] Linking CXX shared library libjrtp.so
[ 69%] Built target jrtplib-shared
Scanning dependencies of target example4
[ 69%] Building CXX object examples/CMakeFiles/example4.dir/example4.cpp.o
[ 70%] Linking CXX executable example4
[ 70%] Built target example4
Scanning dependencies of target example2
[ 71%] Building CXX object examples/CMakeFiles/example2.dir/example2.cpp.o
[ 72%] Linking CXX executable example2
[ 72%] Built target example2
Scanning dependencies of target example5
[ 73%] Building CXX object examples/CMakeFiles/example5.dir/example5.cpp.o
[ 74%] Linking CXX executable example5
[ 74%] Built target example5
Scanning dependencies of target example8
[ 75%] Building CXX object examples/CMakeFiles/example8.dir/example8.cpp.o
[ 76%] Linking CXX executable example8
[ 76%] Built target example8
Scanning dependencies of target example1
[ 77%] Building CXX object examples/CMakeFiles/example1.dir/example1.cpp.o
[ 77%] Linking CXX executable example1
[ 77%] Built target example1
Scanning dependencies of target example6
[ 78%] Building CXX object examples/CMakeFiles/example6.dir/example6.cpp.o
[ 78%] Linking CXX executable example6
[ 78%] Built target example6
Scanning dependencies of target example7
[ 79%] Building CXX object examples/CMakeFiles/example7.dir/example7.cpp.o
[ 80%] Linking CXX executable example7
/usr/local/lib/libsrtp2.a(datatypes.o): In function octet_string_set_to_zero': datatypes.c:(.text+0x1d91): undefined reference toOPENSSL_cleanse'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_set_iv': aes_icm_ossl.c:(.text+0x77): undefined reference toEVP_EncryptInit_ex'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_encrypt': aes_icm_ossl.c:(.text+0xe8): undefined reference toEVP_EncryptUpdate'
aes_icm_ossl.c:(.text+0x113): undefined reference to EVP_EncryptFinal_ex' /usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In functionsrtp_aes_icm_openssl_context_init':
aes_icm_ossl.c:(.text+0x1f9): undefined reference to EVP_aes_128_ctr' aes_icm_ossl.c:(.text+0x20d): undefined reference toEVP_EncryptInit_ex'
aes_icm_ossl.c:(.text+0x231): undefined reference to EVP_aes_256_ctr' aes_icm_ossl.c:(.text+0x241): undefined reference toEVP_aes_192_ctr'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_dealloc': aes_icm_ossl.c:(.text+0x26c): undefined reference toEVP_CIPHER_CTX_free'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_alloc': aes_icm_ossl.c:(.text+0x36a): undefined reference toEVP_CIPHER_CTX_new'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_get_tag': aes_gcm_ossl.c:(.text+0x18): undefined reference toEVP_Cipher'
aes_gcm_ossl.c:(.text+0x2c): undefined reference to EVP_CIPHER_CTX_ctrl' /usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In functionsrtp_aes_gcm_openssl_set_aad':
aes_gcm_ossl.c:(.text+0x71): undefined reference to EVP_CIPHER_CTX_ctrl' aes_gcm_ossl.c:(.text+0x81): undefined reference toEVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_context_init': aes_gcm_ossl.c:(.text+0xeb): undefined reference toEVP_aes_256_gcm'
aes_gcm_ossl.c:(.text+0x102): undefined reference to EVP_CipherInit_ex' aes_gcm_ossl.c:(.text+0x129): undefined reference toEVP_aes_128_gcm'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_dealloc': aes_gcm_ossl.c:(.text+0x147): undefined reference toEVP_CIPHER_CTX_free'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_encrypt': aes_gcm_ossl.c:(.text+0x19e): undefined reference toEVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_decrypt': aes_gcm_ossl.c:(.text+0x1e3): undefined reference toEVP_CIPHER_CTX_ctrl'
aes_gcm_ossl.c:(.text+0x1f9): undefined reference to EVP_Cipher' aes_gcm_ossl.c:(.text+0x208): undefined reference toEVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_set_iv': aes_gcm_ossl.c:(.text+0x293): undefined reference toEVP_CipherInit_ex'
aes_gcm_ossl.c:(.text+0x2c1): undefined reference to EVP_CIPHER_CTX_ctrl' aes_gcm_ossl.c:(.text+0x2db): undefined reference toEVP_CIPHER_CTX_ctrl'
aes_gcm_ossl.c:(.text+0x2f2): undefined reference to EVP_CIPHER_CTX_ctrl' /usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In functionsrtp_aes_gcm_openssl_alloc':
aes_gcm_ossl.c:(.text+0x3cb): undefined reference to EVP_CIPHER_CTX_new' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In functionsrtp_hmac_start':
hmac_ossl.c:(.text+0xe): undefined reference to HMAC_Init_ex' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In functionsrtp_hmac_update':
hmac_ossl.c:(.text+0x61): undefined reference to HMAC_Update' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In functionsrtp_hmac_init':
hmac_ossl.c:(.text+0x8e): undefined reference to EVP_sha1' hmac_ossl.c:(.text+0xa2): undefined reference toHMAC_Init_ex'
/usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_dealloc': hmac_ossl.c:(.text+0xc9): undefined reference toHMAC_CTX_free'
/usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_compute': hmac_ossl.c:(.text+0x129): undefined reference toHMAC_Update'
hmac_ossl.c:(.text+0x142): undefined reference to HMAC_Final' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In functionsrtp_hmac_alloc':
hmac_ossl.c:(.text+0x21c): undefined reference to `HMAC_CTX_new'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/example7.dir/build.make:96: ошибка выполнения рецепта для цели «examples/example7»
make[2]: *** [examples/example7] Ошибка 1
CMakeFiles/Makefile2:415: ошибка выполнения рецепта для цели «examples/CMakeFiles/example7.dir/all»
make[1]: *** [examples/CMakeFiles/example7.dir/all] Ошибка 2
Makefile:127: ошибка выполнения рецепта для цели «all»
make: *** [all] Ошибка 2

Related

NLOPT importing and using C++

I have been trying on and off for the past year to import the NLopt library into my work. I have been unsuccessful, and I am desperate for help.
Here is some of my CMAKE file
cmake_minimum_required(VERSION 3.21)
project(DynamicRRT)
set(CMAKE_CXX_STANDARD 17)
set(CONAN_CMAKE_CXX_STANDARD 17)
include_directories(/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3/)
find_library(nlopt /Users/brandon/Extern/nlopt_install/ NAMES libnlopt nlopt NLopt)
include_directories(/Users/brandon/Extern/nlopt_install/include/ )
link_directories(/Users/brandon/Extern/nlopt_install/include/ )
#INCLUDE_DIRECTORIES(/Users/brandon/CLionProjects/nlopt/)
#INCLUDE_DIRECTORIES(/opt/homebrew/Cellar/nlopt/2.7.1/include/)
#include_directories(/usr/local/include/)
#add_library(nlopt /Users/brandon/Extern/nlopt_install/include)
#add_compile_options(-Wa,-mbig-obj)¡
add_executable(DynamicRRT main.cpp utilities.cpp utilities.h rrt_star.cpp rrt_star.h tree.cpp tree.h Nodes.cpp Nodes.h Obstacles.cpp Obstacles.h macro_rrt_star.cpp macro_rrt_star.h collisions.cpp collisions.h dynamic_rrt_star.cpp dynamic_rrt_star.h trajectory.cpp trajectory.h transformer.cpp transformer.h print_utilities.cpp print_utilities.h random_utilities.cpp random_utilities.h)# inverse_kinematics.cpp inverse_kinematics.h)# rrt_star.cpp rrt_star.h)#rrt_star_util.cpp rrt_star_util.h
target_link_libraries(DynamicRRT nlopt)
You can see that I've commented out a number of attempts at getting this imported. CMake does not throw any errors. However, if I try building the project, I get:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/brandonmeng/CLionProjects/DynamicRRT/cmake-build-default-gcc --target all -- -j 8
[ 14%] Building CXX object CMakeFiles/DynamicRRT.dir/Obstacles.cpp.o
[ 14%] Building CXX object CMakeFiles/DynamicRRT.dir/utilities.cpp.o
[ 35%] Building CXX object CMakeFiles/DynamicRRT.dir/rrt_star.cpp.o
[ 35%] Building CXX object CMakeFiles/DynamicRRT.dir/macro_rrt_star.cpp.o
[ 35%] Building CXX object CMakeFiles/DynamicRRT.dir/Nodes.cpp.o
[ 42%] Building CXX object CMakeFiles/DynamicRRT.dir/main.cpp.o
[ 50%] Building CXX object CMakeFiles/DynamicRRT.dir/tree.cpp.o
[ 57%] Building CXX object CMakeFiles/DynamicRRT.dir/collisions.cpp.o
[ 64%] Building CXX object CMakeFiles/DynamicRRT.dir/dynamic_rrt_star.cpp.o
[ 71%] Building CXX object CMakeFiles/DynamicRRT.dir/trajectory.cpp.o
[ 78%] Building CXX object CMakeFiles/DynamicRRT.dir/transformer.cpp.o
[ 85%] Building CXX object CMakeFiles/DynamicRRT.dir/print_utilities.cpp.o
[ 92%] Building CXX object CMakeFiles/DynamicRRT.dir/random_utilities.cpp.o
[100%] Linking CXX executable bin/DynamicRRT
ld: library not found for -lnlopt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/DynamicRRT] Error 1
make[1]: *** [CMakeFiles/DynamicRRT.dir/all] Error 2
make: *** [all] Error 2
link_directories(/Users/brandon/Extern/nlopt_install/include/ )
The library to link with is likely not in the include directory with the header files. It's more likely they're in a lib directory:
link_directories(/Users/brandon/Extern/nlopt_install/lib)

cmake linking library issue

Hello and thanks in advance for the help,
I have a linking issue with my cmake that I don't get. I'm trying to include a shared lib(modbuspp) in submodule which require another shared lib(libmodbus) on my computer. It seem simple but during exec linking it give me undefined reference to my computer lib (libmodbus) when I did add the includes. Does anyone has an idea why ? Here is my Cmake:
cmake_minimum_required(VERSION 3.10)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(This test)
project(${This} VERSION "0.1.0")
configure_file("${PROJECT_SOURCE_DIR}/src/config.h.in" "${PROJECT_SOURCE_DIR}/src/config.h")
#enable_testing()
#add_subdirectory(googletest)
#add_subdirectory(test)
file(GLOB Sources
"src/*.hpp"
"src/*.cpp"
)
add_executable(${This} ${Sources})
find_package(nlohmann_json 3.2.0 REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(Modbus REQUIRED)
message(TROLOLO:${MODBUS_INCLUDE_DIRS})
include_directories(${MODBUS_INCLUDE_DIRS})
#target_include_directories(${This} PRIVATE ${MODBUS_INCLUDE_DIRS})
#work on libmodbuspp exemple "-shared -fPIC -pthread -I/usr/local/include -I/usr/include/modbus -L/usr/local/lib -lmodbuspp -lmodbus"
#Configure: cmake -DMODBUSPP_USE_EXTERNAL_JSON=ON -DMODBUSPP_WITH_STATIC=1 -DINSTALL_LIB_DIR=libs -DMODBUSPP_UNIT_TESTS=0 -S . -B build
add_subdirectory(external/libmodbuspp)
include_directories(external/libmodbuspp/include)
#target_include_directories(${This} PRIVATE external/libmodbuspp/include)
link_directories(${This} PRIVATE ${PROJECT_BINARY_DIR}/external/libmodbuspp/lib)
target_link_libraries(${This} PRIVATE ${MODBUS_LIBRARIES} modbuspp-shared)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${This} PUBLIC Threads::Threads)
And here are the compile error:
Scanning dependencies of target objlib
[ 4%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/bufferedslave.cpp.o
[ 9%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/device.cpp.o
[ 14%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/master.cpp.o
[ 19%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/message.cpp.o
[ 23%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/netlayer.cpp.o
[ 28%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/request.cpp.o
[ 33%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/response.cpp.o
[ 38%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/router.cpp.o
[ 42%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/rtulayer.cpp.o
[ 47%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/server.cpp.o
/home/aurelia/git/test/external/libmodbuspp/src/server.cpp: In static member function ‘static void* Modbus::Server::Private::loop(std::future<void>, Modbus::Server::Private*)’:
/home/aurelia/git/test/external/libmodbuspp/src/server.cpp:434:3: warning: no return statement in function returning non-void [-Wreturn-type]
434 | }
| ^
[ 52%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/slave.cpp.o
[ 57%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/tcplayer.cpp.o
[ 61%] Building CXX object external/libmodbuspp/lib/CMakeFiles/objlib.dir/__/src/timeout.cpp.o
[ 61%] Built target objlib
Scanning dependencies of target modbuspp-shared
[ 66%] Linking CXX shared library libmodbuspp.so
[ 66%] Built target modbuspp-shared
Scanning dependencies of target test
[ 71%] Building CXX object CMakeFiles/test.dir/src/StaticDI.cpp.o
[ 76%] Building CXX object CMakeFiles/test.dir/src/StaticDO.cpp.o
[ 80%] Building CXX object CMakeFiles/test.dir/src/conf.cpp.o
[ 85%] Building CXX object CMakeFiles/test.dir/src/main.cpp.o
[ 90%] Building CXX object CMakeFiles/test.dir/src/modbusServer.cpp.o
[ 95%] Linking CXX executable test
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_rtu_set_rts_delay'
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_get_byte_timeout'
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_rtu_get_rts'
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_close'
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_mapping_free'
/usr/bin/ld: external/libmodbuspp/lib/libmodbuspp.so.1.0.0: undefined reference to `modbus_set_indication_time
But all those reference can be found in the include that was linked with include_directories :
/usr/include/modbus$ grep rtu_set_rts_delay ./*
./modbus-rtu.h:MODBUS_API int modbus_rtu_set_rts_delay(modbus_t *ctx, int us);

No libclang.a after successfull build for iOS?

I've extracted official llvm/clang sources for 3.7 release, did some minor patching (NSGetEnviron()), configured and build for iOS with cmake:
cmake ../llvm_37_ios \
-DCMAKE_INSTALL_PREFIX=/Volumes/Transcend/dev/src/llvm_37_ios_armv7_installed \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_THREADS=OFF \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
-DCMAKE_C_FLAGS="-stdlib=libc++ -arch armv7 -mios-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++ -arch armv7 -mios-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" \
-DCMAKE_CROSSCOMPILING=True \
-DLLVM_TABLEGEN=/Volumes/Transcend/dev/src/llvm_37_local_build/bin/llvm-tblgen \
-DCLANG_TABLEGEN=/Volumes/Transcend/dev/src/llvm_37_local_build/bin/clang-tblgen \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="ARM;X86"
However i did not find libclang.a but found another libclang*.a libs:
MBA-Anton:llvm_37_ios_armv7_build asmirnov$ find . -name "libclang.a"
MBA-Anton:llvm_37_ios_armv7_build asmirnov$ find . -name "libclang*.a"
./lib/libclangBasic.a
./lib/libclangLex.a
./lib/libclangASTMatchers.a
./lib/libclangParse.a
./lib/libclangDynamicASTMatchers.a
./lib/libclangAnalysis.a
./lib/libclangEdit.a
./lib/libclangRewrite.a
./lib/libclangAST.a
./lib/libclangDriver.a
./lib/libclangCodeGen.a
./lib/libclangSerialization.a
./lib/libclangRewriteFrontend.a
./lib/libclangSema.a
./lib/libclangFrontendTool.a
./lib/libclangARCMigrate.a
./lib/libclangToolingCore.a
./lib/libclangFrontend.a
./lib/libclangIndex.a
./lib/libclangTooling.a
./lib/libclangFormat.a
./lib/libclangStaticAnalyzerFrontend.a
./lib/libclangStaticAnalyzerCore.a
./lib/libclangStaticAnalyzerCheckers.a
For some reason shared library was created but static was not:
Linking CXX executable ../../../../bin/clang
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexDiagnostic.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexHigh.cpp.o
[ 98%] Built target clang
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexInclusionStack.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexUSRs.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexer.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXComment.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXCursor.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXCompilationDatabase.cpp.o
[ 98%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXLoadedDiagnostic.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXSourceLocation.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXStoredDiagnostic.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXString.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXType.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/IndexBody.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/IndexDecl.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/IndexTypeSourceInfo.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/Indexing.cpp.o
[100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/IndexingContext.cpp.o
Linking CXX shared library ../../../../lib/libclang.dylib
[100%] Built target libclang
Did i miss something or it's clang configuration bug?
libclang is built as a shared library by default because it simplifies consumption from other languages such as Python using FFI or similar mechanisms.
To build a static library use LIBCLANG_BUILD_STATIC CMake option defined in clang/tools/libclang/CMakeLists.txt:
option(LIBCLANG_BUILD_STATIC
"Build libclang as a static library (in addition to a shared one)" OFF)
You can use it as follows:
cmake -DLIBCLANG_BUILD_STATIC=ON ...

can not find <execinfo.h> when setup mlpack

I tried to install mlpack in cygwin and I have already installed armadillo, but I encountered following problems:
After running cmake ../ I run the make command and here is the process:
$ make
Scanning dependencies of target mlpack_headers
Moving header files to include/mlpack/
[ 0%] Built target mlpack_headers
Scanning dependencies of target mlpack
[ 0%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/dists/discrete_distribution.cpp.o
[ 1%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/dists/gaussian_distribution.cpp.o
[ 2%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/dists/laplace_distribution.cpp.o
[ 3%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/kernels/epanechnikov_kernel.cpp.o
[ 4%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/kernels/pspectrum_string_kernel.cpp.o
[ 5%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/math/lin_alg.cpp.o
[ 6%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/math/random.cpp.o
[ 6%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp.o
[ 7%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/optimizers/lbfgs/test_functions.cpp.o
[ 8%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/optimizers/lrsdp/lrsdp.cpp.o
[ 9%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/optimizers/lrsdp/lrsdp_function.cpp.o
[ 10%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/optimizers/sgd/test_function.cpp.o
[ 11%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/tree/cosine_tree/cosine_tree.cpp.o
[ 12%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/tree/mrkd_statistic.cpp.o
[ 12%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/util/cli.cpp.o
[ 13%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/util/cli_deleter.cpp.o
[ 14%] Building CXX object src/mlpack/CMakeFiles/mlpack.dir/core/util/log.cpp.o
/home/Administrator/mlpack-1.0.11/mlpack-1.0.11/src/mlpack/core/util/log.cpp:24:24: 致命错误:execinfo.h:No such file or directory
#include <execinfo.h>
编译中断。
src/mlpack/CMakeFiles/mlpack.dir/build.make:425: recipe for target 'src/mlpack/CMakeFiles/mlpack.dir/core/util/log.cpp.o' failed
make[2]: * [src/mlpack/CMakeFiles/mlpack.dir/core/util/log.cpp.o] Error 1
CMakeFiles/Makefile2:119: recipe for target 'src/mlpack/CMakeFiles/mlpack.dir/all' failed
make[1]: * [src/mlpack/CMakeFiles/mlpack.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: * [all] Error 2
I don't know how to deal with this problem.
Cygwin's gnulib does not provide execinfo.h, possibly due to compatibility issues with the underlying (Windows) system.
From the gnulib documentation:
This header file is missing on some platforms: Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS.
You may want to try a WinAPI function like CaptureStackBackTrace instead.

How to install OpenCV on OS X Lion using brew

i'm trying to install opencv libraries using brew.
i tried:
sudo brew install opencv
this is the output:
user$ sudo brew install opencv
sudo: /var/db/sudo writable by non-owner (040777), should be mode 0700
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
/usr/local/Library/Homebrew/global.rb:64: warning: Insecure world writable dir /opt/local in PATH, mode 040777
/usr/local/bin/brew:74: warning: Insecure world writable dir /opt/local in PATH, mode 040777
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
/usr/local/Library/Homebrew/build.rb:7: warning: Insecure world writable dir /opt/local in PATH, mode 040777
==> Downloading http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2
File already downloaded in /Library/Caches/Homebrew
==> Patching
patching file modules/highgui/src/grfmt_exr.hpp
==> cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/opencv/2.3.1a' -DCMAKE_BUILD_TYPE=None -Wno-dev -DPYTHON_LIBRARY='/System/Library/Frameworks/Python.framework/Versions/2.7/Python' -DP
==> make
Scanning dependencies of target opencv_core
[ 1%] [ 1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/arithm.o
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/alloc.o
[ 1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/array.o
[ 1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/cmdparser.o
[ 1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.o
[ 2%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/copy.o
[ 2%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/datastructs.o
[ 2%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/drawing.o
[ 2%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/dxt.o
[ 3%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/lapack.o
[ 3%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/mathfuncs.o
[ 3%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matmul.o
[ 3%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matop.o
[ 4%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matrix.o
[ 4%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/out.o
[ 4%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/persistence.o
[ 4%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/precomp.o
[ 5%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/rand.o
[ 5%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat.o
[ 5%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.o
[ 5%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/tables.o
Linking CXX shared library ../../lib/libopencv_core.dylib
[ 5%] Built target opencv_core
Scanning dependencies of target opencv_flann
[ 6%] Building CXX object modules/flann/CMakeFiles/opencv_flann.dir/src/flann.o
Scanning dependencies of target opencv_imgproc
[ 6%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/accum.o
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/src/flann.cpp:29:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/src/precomp.hpp:17:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/all_indices.h:42:
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/lsh_index.h:89:81: error: no matching constructor for initialization of 'cvflann::LshIndexParams'
LshIndex(const Matrix<ElementType>& input_data, const IndexParams& params = LshIndexParams(),
^
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/lsh_index.h:59:5: note: candidate constructor not viable: requires 3 arguments, but 0 were provided
LshIndexParams(unsigned int table_number, unsigned int key_size, unsigned int multi_probe_level)
^
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/lsh_index.h:57:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
struct LshIndexParams : public IndexParams
^
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/src/flann.cpp:29:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/src/precomp.hpp:10:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/index_testing.h:39:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/nn_index.h:39:
In file included from /tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/params.h:33:
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/any.h:88:67: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup
virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(*src); }
^
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/any.h:136:44: note: in instantiation of member function 'cdiggins::anyimpl::big_any_policy<cdiggins::anyimpl::empty_any>::print' requested here
static typename choose_policy<T>::type policy;
^
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/any.h:159:18: note: in instantiation of function template specialization 'cdiggins::anyimpl::get_policy<cdiggins::anyimpl::empty_any>' requested here
: policy(anyimpl::get_policy<anyimpl::empty_any>()), object(NULL)
^
/tmp/homebrew-opencv-2.3.1a-dWXV/OpenCV-2.3.1/modules/flann/include/opencv2/flann/any.h:276:22: note: 'operator<<' should be declared prior to the call site or in namespace 'cdiggins::anyimpl'
inline std::ostream& operator <<(std::ostream& out, const any& any_val)
^
2 errors generated.
make[2]: *** [modules/flann/CMakeFiles/opencv_flann.dir/src/flann.o] Error 1
make[1]: *** [modules/flann/CMakeFiles/opencv_flann.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 7%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/approx.o
[ 7%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/canny.o
[ 7%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/color.o
[ 7%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/contours.o
[ 8%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/convhull.o
[ 8%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/corner.o
[ 8%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/cornersubpix.o
[ 8%] [ 9%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/deriv.o
Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/distransform.o
[ 9%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/emd.o
[ 9%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/featureselect.o
[ 9%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/featuretree.o
[ 10%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/filter.o
[ 10%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/floodfill.o
[ 10%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/geometry.o
[ 10%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/grabcut.o
[ 11%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/histogram.o
[ 11%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/hough.o
[ 11%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/imgwarp.o
[ 11%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/inpaint.o
[ 12%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/kdtree.o
[ 12%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/linefit.o
[ 12%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/lsh.o
[ 12%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/matchcontours.o
[ 12%] [ 13%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/moments.o
Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/morph.o
[ 13%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/precomp.o
[ 13%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/pyramids.o
[ 13%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/pyrsegmentation.o
[ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/rotcalipers.o
[ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/samplers.o
[ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/segmentation.o
[ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/shapedescr.o
[ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.o
[ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/spilltree.o
[ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/subdivision2d.o
[ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/sumpixels.o
[ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/tables.o
[ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/templmatch.o
[ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/thresh.o
[ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/undistort.o
[ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/utils.o
Linking CXX shared library ../../lib/libopencv_imgproc.dylib
[ 17%] Built target opencv_imgproc
make: *** [all] Error 2
CMakeCache.txt was copied to /Users/turchijacopo/Library/Logs/Homebrew
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/opencv.rb#L76
==> Environment
HOMEBREW_VERSION: 0.8.1
HEAD: 3b771d09e48f4dfa88ef4c5d32f3b84ca2ae18ec
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: dual-core 64-bit penryn
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? /opt/local/bin/port
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
==> Build Flags
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j2
Error: Failed executing: make
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/10862
Otherwise, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
what can i do ?
You can start by reading the error message:
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/10862
That's probably not your problem, but one idea is to try to install OpenCV 32-bits:
brew install opencv --32-bit
And if that doesn't work:
please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
You can always download OpenCV source code and compile it yourself. It's what I did on Mac OS X.