C++Builder (RAD Studio 10.2.3 Tokyo)用CMAKE编译Opencv3.4的源代码的尝试
jdwxy 2018-03-19 10:31:10 编译环境:RAD Studio 10.2.3 Tokyo
openCV:3.4.1
CBuilder中CMake的使用方法:http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Using_CMake_with_C%2B%2B_Builder
这是一次尝试,结果没有成功。
期待哪位高手早日解决OpenCV 3.4在 C++Builder中的使用问题。
过程记录 2018年3月17日
1.在RAD Studio Command Prompt提示行中,执行下面的语句
cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja D:\4 OpenCV3.4\opencv\sources
命令行文本拷贝如下:
C:\Program Files (x86)\Embarcadero\Studio\19.0\bin>cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja D:\4 OpenCV3.4\opencv\sources
CMake Error: The source directory "C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/OpenCV3.4/opencv/sources" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
2.上文中报错是找不到源文件路径,因此手工拷贝下载的opencv源文件到它提示的路径:"C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/OpenCV3.4/opencv/sources"
再执行下面的语句
cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja D:\4 OpenCV3.4\opencv\sources
提示错误:意思是没有权限。
以管理员身份运行cmd,再尝试命令:
C:\Windows> cd C:\Program Files (x86)\Embarcadero\Studio\19.0\bin
C:\Program Files (x86)\Embarcadero\Studio\19.0\bin>cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja D:\4 OpenCV3.4\opencv\sources
开始比较正常的编译了。9:34分开始的,9:35分结束。生成的文件都放在“C:\Program Files (x86)\Embarcadero\Studio\19.0\bin”,和原来的文件搅在一起,很麻烦。
不过新生成的文件都是2018年3月17日9:34-9:35之间的。可以区分出来。
3.上面的编译完成后,拷贝提示如下:
Microsoft Windows [版本 10.0.16299.15]
(c) 2017 Microsoft Corporation。保留所有权利。
C:\WINDOWS\system32> cd ..
C:\Windows> cd C:\Program Files (x86)\Embarcadero\Studio\19.0\bin
C:\Program Files (x86)\Embarcadero\Studio\19.0\bin>cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja D:\4 OpenCV3.4\opencv\sources
-- The CXX compiler identification is Embarcadero 7.30.36015
-- The C compiler identification is Embarcadero 7.30.36015
-- Check for working CXX compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1)
-- Performing Test HAVE_CXX11 (check file: cmake/checks/cxx11.cpp)
-- Performing Test HAVE_CXX11 - Success
-- Can't detect runtime and/or arch
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7")
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.6")
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.4")
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2")
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
CMake Warning at cmake/OpenCVCompilerOptimizations.cmake:249 (message):
TODO: Unsupported compiler
Call Stack (most recent call first):
cmake/OpenCVCompilerOptions.cmake:235 (include)
CMakeLists.txt:558 (include)
-- Performing Test HAVE_CPU_SSE_SUPPORT (check file: cmake/checks/cpu_sse.cpp)
-- Performing Test HAVE_CPU_SSE_SUPPORT - Failed
-- SSE is not supported by C++ compiler
-- Performing Test HAVE_CPU_SSE2_SUPPORT (check file: cmake/checks/cpu_sse2.cpp)
-- Performing Test HAVE_CPU_SSE2_SUPPORT - Failed
-- SSE2 is not supported by C++ compiler
-- Performing Test HAVE_CPU_SSE3_SUPPORT (check file: cmake/checks/cpu_sse3.cpp)
-- Performing Test HAVE_CPU_SSE3_SUPPORT - Failed
-- SSE3 is not supported by C++ compiler
-- Performing Test HAVE_CPU_SSSE3_SUPPORT (check file: cmake/checks/cpu_ssse3.cpp)
-- Performing Test HAVE_CPU_SSSE3_SUPPORT - Failed
-- SSSE3 is not supported by C++ compiler
-- Performing Test HAVE_CPU_SSE4_1_SUPPORT (check file: cmake/checks/cpu_sse41.cpp)
-- Performing Test HAVE_CPU_SSE4_1_SUPPORT - Failed
-- SSE4_1 is not supported by C++ compiler
-- Performing Test HAVE_CPU_POPCNT_SUPPORT (check file: cmake/checks/cpu_popcnt.cpp)
-- Performing Test HAVE_CPU_POPCNT_SUPPORT - Failed
-- POPCNT is not supported by C++ compiler
-- Performing Test HAVE_CPU_SSE4_2_SUPPORT (check file: cmake/checks/cpu_sse42.cpp)
-- Performing Test HAVE_CPU_SSE4_2_SUPPORT - Failed
-- SSE4_2 is not supported by C++ compiler
-- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CPU_FP16_SUPPORT - Failed
-- FP16 is not supported by C++ compiler
-- Performing Test HAVE_CPU_AVX_SUPPORT (check file: cmake/checks/cpu_avx.cpp)
-- Performing Test HAVE_CPU_AVX_SUPPORT - Failed
-- AVX is not supported by C++ compiler
-- Optimization SSE2 is not available, skipped
-- Dispatch optimization SSE4_1 is not available, skipped
-- Dispatch optimization SSE4_2 is not available, skipped
-- Dispatch optimization AVX is not available, skipped
-- Dispatch optimization FP16 is not available, skipped
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for assert.h
-- Looking for assert.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for io.h
-- Looking for io.h - found
-- Looking for limits.h
-- Looking for limits.h - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for search.h
-- Looking for search.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Performing Test C_HAS_inline
-- Performing Test C_HAS_inline - Success
-- Check size of signed short
-- Check size of signed short - done
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Check size of signed int
-- Check size of signed int - done
-- Check size of unsigned int
-- Check size of unsigned int - done
-- Check size of signed long
-- Check size of signed long - done
-- Check size of unsigned long
-- Check size of unsigned long - done
-- Check size of signed long long
-- Check size of signed long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Check size of unsigned char *
-- Check size of unsigned char * - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ptrdiff_t
-- Check size of ptrdiff_t - done
-- Check size of INT8
-- Check size of INT8 - failed
-- Check size of INT16
-- Check size of INT16 - failed
-- Check size of INT32
-- Check size of INT32 - failed
-- Looking for floor
-- Looking for floor - found
-- Looking for pow
-- Looking for pow - found
-- Looking for sqrt
-- Looking for sqrt - found
-- Looking for isascii
-- Looking for isascii - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mmap
-- Looking for mmap - not found
-- Looking for getopt
-- Looking for getopt - not found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for setmode
-- Looking for setmode - found
-- Looking for strcasecmp
-- Looking for strcasecmp - not found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for lfind
-- Looking for lfind - found
-- Performing Test HAVE_SNPRINTF
-- Performing Test HAVE_SNPRINTF - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- FFMPEG: Download: opencv_ffmpeg.dll
-- FFMPEG: Download: opencv_ffmpeg_64.dll
-- FFMPEG: Download: ffmpeg_version.cmake
-- Looking for DShow.h
-- Looking for DShow.h - found
-- IPPICV: Download: ippicv_2017u3_win_ia32_general_20170822.zip
-- found Intel IPP (ICV version): 2017.0.3 [2017.0.3]
-- at: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/3rdparty/ippicv/ippicv_win
-- found Intel IPP IW sources: 2017.0.3
-- at: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/3rdparty/ippicv/ippiw_win
-- CUDA compilation is disabled (due to only Visual Studio compiler supported on your platform).
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.