sayakpaul / portfolio

Personal site of Sayak Paul. Deployed here 👉
https://sayak.dev/
24 stars 16 forks source link

Building and Installing OpenCV 4.5.0 on an M1 Mac | Sayak Paul #7

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Building and Installing OpenCV 4.5.0 on an M1 Mac | Sayak Paul

This post shows how to build and install OpenCV 4.5.0 on a MacBook Pro that comes with an M1 chip.

https://sayak.dev/install-opencv-m1/

ntlex commented 3 years ago

Hi, thanks for the tutorial. I followed your steps and everything went smooth untill I ran mdfind cv2.cpython which was returned empty. Any ideas as to why would that be happening?

sayakpaul commented 3 years ago

That is very strange. If the compilation was successful thre process should have generated the .so files. Maybe you could look into the paths manually? You can get an idea of the paths from the post itself.

wzh4464 commented 3 years ago

Thanks a lot! This really helps.

pasmat commented 3 years ago

@ntlex it might be that your numpy and python3 lib path may not be configured, at least this was the case for me.. Even after the fact, mfind wasn't working, but the objects were generated at the paths provided opencv-4.5.0/build/lib/python3/cv2.cpython-38-darwin.so

memina commented 3 years ago

Thanks for the tutorial @sayakpaul. But after a while after typing make -j8 command I get the following error. Do you have an idea?

[ 71%] Linking CXX shared library ../../lib/libopencv_sfm.dylib ld: warning: ignoring file /usr/local/lib/libglog.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 ld: warning: ignoring file /usr/local/lib/libglog.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 ld: warning: ignoring file /usr/local/lib/libceres.1.14.0.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 ld: warning: ignoring file /usr/local/lib/libgflags.2.2.2.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 [ 71%] Building CXX object modules/optflow/CMakeFiles/opencv_optflow.dir/src/sparsetodenseflow.cpp.o Undefined symbols for architecture arm64: ... ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [lib/libopencv_sfm.4.5.0.dylib] Error 1 make[1]: [modules/sfm/CMakeFiles/opencv_sfm.dir/all] Error 2

sayakpaul commented 3 years ago

ld: warning: ignoring file /usr/local/lib/libglog.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

This tells me that the architecture you are building on is not based on ARM6.

memina commented 3 years ago

I did not understand. I do these operations on Macbook Air M1. The cmake code I ran is as follows


/opt/homebrew/Cellar/cmake/3.19.3/bin/cmake \
-DCMAKE_SYSTEM_PROCESSOR=arm64 \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DWITH_OPENJPEG=OFF \ -DWITH_IPP=OFF \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=/Users/eminarvas/deeplearning/opencv_contrib-4.5.0/modules \ -D PYTHON3_EXECUTABLE=/Users/eminarvas/miniforge3/envs/deeplearning/bin/python3 \ -D PYTHON_LIBRARY=/Users/eminarvas/miniforge3/envs/deeplearning/lib/libpython3.8.dylib \ -D PYTHON_NUMPY_INCLUDE_DIR=/Users/eminarvas/miniforge3/envs/deeplearning/lib/python3.8/site-packages/numpy/core/include \ -D BUILD_opencv_python2=OFF \ -D BUILD_opencv_python3=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D BUILD_EXAMPLES=ON ..

sayakpaul commented 3 years ago

From your comment here https://github.com/sayakpaul/portfolio/issues/7#issuecomment-767517870, it appears that CMAKE is picking up the architecture as x86_64 and not as ARM64. This, I believe, is the primary cause of why your build is failing.

luuqh commented 3 years ago

Thanks @sayakpaul. I solve the problem encoutered by Memina by:

  1. Use the latest OpenCV (current build is 4.5.1-dev): Just download directly OpenCV and unzip from the links

    https://github.com/opencv/opencv https://github.com/opencv/opencv_contrib

  2. Make sure you install Cmake properly. Maybe the easiest way is to follow instruction to download Universal Cmake version

    https://cmake.org/download/

and then configure

sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

  1. When compiling, don't forget to do it under ARM architecture (instead of Resetta) Adding "arch -arm64" to all statements

    arch -arm64 cmake ... arch -arm64 make -j8 arch -arm64 sudo make install

sayakpaul commented 3 years ago

Thanks for passing this along @luuqh.

surya-x commented 3 years ago

@sayakpaul Everything worked fine and installed as you mentioned, except on typing

mdfind cv2.cpython

this is not returning anything, please help me out.

sayakpaul commented 3 years ago

You will probably need to do a bit of trial and error for that. Look for the path I have mentioned in my blog post and start your search from there. I am not exactly sure why mdfind behaves weirdly sometimes. Probably there's an updatedb like command which I am not aware of.

francishunger commented 3 years ago

Sayak, thanks for the great description. Honestly, I have used venv instead of conda and that might be my problem. I would prefer to use venv in order to not mix several different environment manages.

Now the make process breaks at 23% with the following output:

'ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [lib/libopencv_hdf.4.5.1.dylib] Error 1 make[1]: [modules/hdf/CMakeFiles/opencv_hdf.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 23%] Built target opencv_imgproc make: [all] Error 2'

Maybe you have an idea what to look at. Thanks in advance.

sayakpaul commented 3 years ago

ld: symbol(s) not found for architecture arm64

The above line from the logs might suggest that it's an architecture mismatch but I am not sure.

surya-x commented 3 years ago

@sayakpaul I resolved my issue of mdfind cv2.cpython returning empty string by deleting the build folder and compiling opencv again. Thanks for the help.

muhmdakml commented 3 years ago

Hi @sayakpaul I'm a newcomer in terms of python, conda, numpy and have zero knowledge in environment programming other than C/C++. On my m1 mac, I've installed conda and python 3.8.6 but when I'm trying to install NumPy I got several errors.

1st problem, when I execute :

pip install --upgrade --no-dependencies --force numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl

it returns as zsh: command not found:pip

After some googling, people on stackoverflow suggest to use pip3 instead of pip.

Hence when I execute: pip3 install --upgrade --no-dependencies --force numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl

it returns as WARNING: Requirement 'numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl' looks like a filename, but the file does not exist ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.

I'm extremely new in this installation (literally installed homebrew a few hours ago). Any help would be highly appreciate. Thanks !

sayakpaul commented 3 years ago

@muhmdakml seems like you have not downloaded this file - numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl. If you untar tensorflow_macos-0.1alpha0.tar.gz you will find it inside tensorflow_macos/arm64 directory.

muhmdakml commented 3 years ago

@sayakpaul thank you for your feedback. I deleted the original tensorflow_macos folder and re-download it from github. Extracting the newly downloaded .tar.gz now runs smoothly.

The only issue I face now is the same as others, where running mdfind cv2.python returns nothing.

I'm trying to find the paths manually as per suggested. But manually path searching (enabled show hidden folders) into

/Users/xxx/opencv-4.5.0/build/lib/
/usr/local/lib

only files with ".dylib" extensions are shown. No other folders inside this lib and no 'python3' folder are shown. However, I did install python 3.8.6 as per the tutorial.

Is there anything more installation that I could've missed? Or am I looking in the wrong path direction ? Thank you so much.

Edit : Upon further inspection when running CMake (just before running make), I noticed my :

Python 3:

> Interpreter  : NO
> Libraries : NO
> numpy : NO (Python3 wrappers can not be generated)
> Install Path : -

Could this be the issue? When I execute python3 --version it does return as python 3.8.6.

sayakpaul commented 3 years ago

I would suggest activating your conda environment first and then try redoing all the installations. You probably forgot to activate conda environment before starting all the other installations which is not recommended for this blog post.

I think if you follow through this tutorial sequentially you would be successful installing OpenCV on your M1 Mac.

louy2 commented 3 years ago

Now that conda install opencv is available, what's the difference between that one and this one?

sayakpaul commented 3 years ago

@louy2 when I wrote this blog post it was not available. I believe with conda install opencv the process is easier. So, there won't likely be any difference.

sakshamgupta1074 commented 3 years ago

I am still getting the error of module not found when I import cv2.

When I ran "ls -l cv2.so" I got the exact same output as "/usr/local/lib/python3.8/site-packages/cv2/python-3.8/cv2.cpython-38-darwin.so". But when I went to look at the "venv/lib/python3.8/site-packages/cv2.so" file from finder, it showed that the original item for cv2.so could not be found.

Please help me resolve this issue.

sayakpaul commented 3 years ago

You probably forgot to sym-link the .so file.

becali12 commented 3 years ago

Thank you for the tutorial, @sayakpaul! I was wondering if after doing the above steps (which worked perfectly for me) it is possible for me to use opencv in pycharm, or only in the terminal?

Sorry for the noob question :D

sayakpaul commented 3 years ago

As long as the Python interpreter inside your PyCharm is pointed to the one where you installed OpenCV, you should be able to use it inside PyCharm. In fact, this is exactly what I do as well.

ritikjainx commented 3 years ago

I did every step successfully but the command - "mdfind cv2.cpython" is not giving location of the .so file . and I not able to symlink I looked myself manually in many folders but nothing could be found . can u help me ?

sayakpaul commented 3 years ago

Try looking here - /usr/local/lib/python3.8/site-packages/cv2/python-3.8 (of course, the path might be different in your case).

becali12 commented 3 years ago

Thanks, it worked! For future people asking this you must check the 'previously created interpreter' when creating a new project and fill in the location of the environment configured with @sayakpaul 's tutorial.

Screenshot 2021-02-27 at 14 59 19
gerardsimons commented 3 years ago

If mdfind doesn't work for you, you could also try to do:

python -c "import cv2; print(cv2.__file__)"

ritikjainx commented 3 years ago

thanks @sayakpaul @gerardsimons I just removed everything and did the process again and it worked

lgeralds commented 3 years ago

I use python3 from Homebrew; no conda. I added the following lines to cmake command:

-D PYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ -D PYTHON3_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \ -D PYTHON3_EXECUTABLE=/opt/homebrew/bin/python3 \

Without the first line, the build process will skip the Python package. This line tells it where to find Python.h.

This might explain why mdfind cv2.cpython returns empty.

kenbeek commented 3 years ago

HI Sayak, thanks for the tutorial.

I managed to install it and when I import the package I can run print(cv2.__version__), but when I try to install another package that hasopencv-python` as a dependency, it doesn't seem to recognize that it is already installed. It then tries to install the default pip version, which of course fails.

Any idea how to fix this? Greatly appreciated. Thanks.

sayakpaul commented 3 years ago

Are you using any Python virtual environments to manage the dependencies?

ghost commented 3 years ago

I'm getting: " ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.

When running: pip install --upgrade --no-dependencies --force numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl

virtual environment activated

ghost commented 3 years ago

@muhmdakml which file did you download from github? A different one from the one in the tutorial?

lisahu005 commented 3 years ago

while using cmake to compile, it says "configuring incomplete, errors occurred". Has anyone experiences the same? OPENCV_EXTRA_MODULES_PATH and PYTHON3_EXECUTABLE have been changed to the correct paths. Any idea what is my problem and how to solve it? here is the CMakerError.log: Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /Library/Developer/CommandLineTools/usr/bin/c++ Build flags: Id flags:

The output was: 1 ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /Library/Developer/CommandLineTools/usr/bin/cc Build flags: Id flags:

The output was: 1 ld: library not found for -lSystem clang: error: linker command failed with exit code 1 (use -v to see invocation)

Compilation failed: source file: '/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.cxx' check option: '' ===== BUILD LOG ===== Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b6de8/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_b6de8.dir/build.make CMakeFiles/cmTC_b6de8.dir/build Building CXX object CMakeFiles/cmTC_b6de8.dir/src.cxx.o /Library/Developer/CommandLineTools/usr/bin/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -std=c++11 -MD -MT CMakeFiles/cmTC_b6de8.dir/src.cxx.o -MF CMakeFiles/cmTC_b6de8.dir/src.cxx.o.d -o CMakeFiles/cmTC_b6de8.dir/src.cxx.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.cxx Linking CXX executable cmTC_b6de8 /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b6de8.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,--as-needed CMakeFiles/cmTC_b6de8.dir/src.cxx.o -o cmTC_b6de8 ld: unknown option: --as-needed clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [cmTC_b6de8] Error 1 make: [cmTC_b6de8/fast] Error 2

===== END =====

Determining if the include file malloc.h exists failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_9e417/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_9e417.dir/build.make CMakeFiles/cmTC_9e417.dir/build Building C object CMakeFiles/cmTC_9e417.dir/CheckIncludeFile.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_9e417.dir/CheckIncludeFile.c.o -MF CMakeFiles/cmTC_9e417.dir/CheckIncludeFile.c.o.d -o CMakeFiles/cmTC_9e417.dir/CheckIncludeFile.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'malloc.h' file not found

include

     ^~~~~~~~~~

1 error generated. make[1]: [CMakeFiles/cmTC_9e417.dir/CheckIncludeFile.c.o] Error 1 make: [cmTC_9e417/fast] Error 2

Determining size of off64_t failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_34922/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_34922.dir/build.make CMakeFiles/cmTC_34922.dir/build Building C object CMakeFiles/cmTC_34922.dir/OFF64_T.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_34922.dir/OFF64_T.c.o -MF CMakeFiles/cmTC_34922.dir/OFF64_T.c.o.d -o CMakeFiles/cmTC_34922.dir/OFF64_T.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:29:12: error: use of undeclared identifier 'off64_t' ('0' + ((SIZE / 10000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(off64_t))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:30:12: error: use of undeclared identifier 'off64_t' ('0' + ((SIZE / 1000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(off64_t))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:31:12: error: use of undeclared identifier 'off64_t' ('0' + ((SIZE / 100)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(off64_t))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:32:12: error: use of undeclared identifier 'off64_t' ('0' + ((SIZE / 10)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(off64_t))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:33:12: error: use of undeclared identifier 'off64_t' ('0' + (SIZE % 10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(off64_t))

                 ^

5 errors generated. make[1]: [CMakeFiles/cmTC_34922.dir/OFF64_T.c.o] Error 1 make: [cmTC_34922/fast] Error 2

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/OFF64_T.c:

include <sys/types.h>

include

include

undef KEY

if defined(__i386)

define KEY '','','i','3','8','6'

elif defined(__x86_64)

define KEY '','','x','8','6','_','6','4'

elif defined(PPC64)

define KEY '','','P','P','C','6','4','',''

elif defined(ppc64)

define KEY '','','p','p','c','6','4','',''

elif defined(PPC)

define KEY '','','P','P','C','',''

elif defined(ppc)

define KEY '','','p','p','c','',''

elif defined(aarch64)

define KEY '','','a','a','r','c','h','6','4','',''

elif defined(ARM_ARCH_7A)

define KEY '','','A','R','M','','A','R','C','H','','7','A','',''

elif defined(ARM_ARCH_7S)

define KEY '','','A','R','M','','A','R','C','H','','7','S','',''

endif

define SIZE (sizeof(off64_t))

static char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%10)), ('0' + ((SIZE / 1000)%10)), ('0' + ((SIZE / 100)%10)), ('0' + ((SIZE / 10)%10)), ('0' + (SIZE % 10)), ']',

ifdef KEY

' ','k','e','y','[', KEY, ']',

endif

'\0'};

ifdef __CLASSIC_C__

int main(argc, argv) int argc; char *argv[];

else

int main(int argc, char *argv[])

endif

{ int require = 0; require += info_size[argc]; (void)argv; return require; }

Determining if the include file io.h exists failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_45f44/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_45f44.dir/build.make CMakeFiles/cmTC_45f44.dir/build Building C object CMakeFiles/cmTC_45f44.dir/CheckIncludeFile.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_45f44.dir/CheckIncludeFile.c.o -MF CMakeFiles/cmTC_45f44.dir/CheckIncludeFile.c.o.d -o CMakeFiles/cmTC_45f44.dir/CheckIncludeFile.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'io.h' file not found

include

     ^~~~~~

1 error generated. make[1]: [CMakeFiles/cmTC_45f44.dir/CheckIncludeFile.c.o] Error 1 make: [cmTC_45f44/fast] Error 2

Determining size of INT8 failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_083ed/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_083ed.dir/build.make CMakeFiles/cmTC_083ed.dir/build Building C object CMakeFiles/cmTC_083ed.dir/int8.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_083ed.dir/int8.c.o -MF CMakeFiles/cmTC_083ed.dir/int8.c.o.d -o CMakeFiles/cmTC_083ed.dir/int8.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:29:12: error: use of undeclared identifier 'INT8' ('0' + ((SIZE / 10000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT8))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:30:12: error: use of undeclared identifier 'INT8' ('0' + ((SIZE / 1000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT8))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:31:12: error: use of undeclared identifier 'INT8' ('0' + ((SIZE / 100)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT8))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:32:12: error: use of undeclared identifier 'INT8' ('0' + ((SIZE / 10)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT8))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:33:12: error: use of undeclared identifier 'INT8' ('0' + (SIZE % 10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT8))

                 ^

5 errors generated. make[1]: [CMakeFiles/cmTC_083ed.dir/int8.c.o] Error 1 make: [cmTC_083ed/fast] Error 2

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int8.c:

include <sys/types.h>

include

include

undef KEY

if defined(__i386)

define KEY '','','i','3','8','6'

elif defined(__x86_64)

define KEY '','','x','8','6','_','6','4'

elif defined(PPC64)

define KEY '','','P','P','C','6','4','',''

elif defined(ppc64)

define KEY '','','p','p','c','6','4','',''

elif defined(PPC)

define KEY '','','P','P','C','',''

elif defined(ppc)

define KEY '','','p','p','c','',''

elif defined(aarch64)

define KEY '','','a','a','r','c','h','6','4','',''

elif defined(ARM_ARCH_7A)

define KEY '','','A','R','M','','A','R','C','H','','7','A','',''

elif defined(ARM_ARCH_7S)

define KEY '','','A','R','M','','A','R','C','H','','7','S','',''

endif

define SIZE (sizeof(INT8))

static char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%10)), ('0' + ((SIZE / 1000)%10)), ('0' + ((SIZE / 100)%10)), ('0' + ((SIZE / 10)%10)), ('0' + (SIZE % 10)), ']',

ifdef KEY

' ','k','e','y','[', KEY, ']',

endif

'\0'};

ifdef __CLASSIC_C__

int main(argc, argv) int argc; char *argv[];

else

int main(int argc, char *argv[])

endif

{ int require = 0; require += info_size[argc]; (void)argv; return require; }

Determining size of INT16 failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_e97a7/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e97a7.dir/build.make CMakeFiles/cmTC_e97a7.dir/build Building C object CMakeFiles/cmTC_e97a7.dir/int16.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_e97a7.dir/int16.c.o -MF CMakeFiles/cmTC_e97a7.dir/int16.c.o.d -o CMakeFiles/cmTC_e97a7.dir/int16.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:29:12: error: use of undeclared identifier 'INT16' ('0' + ((SIZE / 10000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT16))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:30:12: error: use of undeclared identifier 'INT16' ('0' + ((SIZE / 1000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT16))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:31:12: error: use of undeclared identifier 'INT16' ('0' + ((SIZE / 100)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT16))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:32:12: error: use of undeclared identifier 'INT16' ('0' + ((SIZE / 10)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT16))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:33:12: error: use of undeclared identifier 'INT16' ('0' + (SIZE % 10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT16))

                 ^

5 errors generated. make[1]: [CMakeFiles/cmTC_e97a7.dir/int16.c.o] Error 1 make: [cmTC_e97a7/fast] Error 2

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int16.c:

include <sys/types.h>

include

include

undef KEY

if defined(__i386)

define KEY '','','i','3','8','6'

elif defined(__x86_64)

define KEY '','','x','8','6','_','6','4'

elif defined(PPC64)

define KEY '','','P','P','C','6','4','',''

elif defined(ppc64)

define KEY '','','p','p','c','6','4','',''

elif defined(PPC)

define KEY '','','P','P','C','',''

elif defined(ppc)

define KEY '','','p','p','c','',''

elif defined(aarch64)

define KEY '','','a','a','r','c','h','6','4','',''

elif defined(ARM_ARCH_7A)

define KEY '','','A','R','M','','A','R','C','H','','7','A','',''

elif defined(ARM_ARCH_7S)

define KEY '','','A','R','M','','A','R','C','H','','7','S','',''

endif

define SIZE (sizeof(INT16))

static char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%10)), ('0' + ((SIZE / 1000)%10)), ('0' + ((SIZE / 100)%10)), ('0' + ((SIZE / 10)%10)), ('0' + (SIZE % 10)), ']',

ifdef KEY

' ','k','e','y','[', KEY, ']',

endif

'\0'};

ifdef __CLASSIC_C__

int main(argc, argv) int argc; char *argv[];

else

int main(int argc, char *argv[])

endif

{ int require = 0; require += info_size[argc]; (void)argv; return require; }

Determining size of INT32 failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_88d75/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_88d75.dir/build.make CMakeFiles/cmTC_88d75.dir/build Building C object CMakeFiles/cmTC_88d75.dir/int32.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_88d75.dir/int32.c.o -MF CMakeFiles/cmTC_88d75.dir/int32.c.o.d -o CMakeFiles/cmTC_88d75.dir/int32.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:29:12: error: use of undeclared identifier 'INT32' ('0' + ((SIZE / 10000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT32))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:30:12: error: use of undeclared identifier 'INT32' ('0' + ((SIZE / 1000)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT32))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:31:12: error: use of undeclared identifier 'INT32' ('0' + ((SIZE / 100)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT32))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:32:12: error: use of undeclared identifier 'INT32' ('0' + ((SIZE / 10)%10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT32))

                 ^

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:33:12: error: use of undeclared identifier 'INT32' ('0' + (SIZE % 10)), ^ /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:27:22: note: expanded from macro 'SIZE'

define SIZE (sizeof(INT32))

                 ^

5 errors generated. make[1]: [CMakeFiles/cmTC_88d75.dir/int32.c.o] Error 1 make: [cmTC_88d75/fast] Error 2

/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CheckTypeSize/int32.c:

include <sys/types.h>

include

include

undef KEY

if defined(__i386)

define KEY '','','i','3','8','6'

elif defined(__x86_64)

define KEY '','','x','8','6','_','6','4'

elif defined(PPC64)

define KEY '','','P','P','C','6','4','',''

elif defined(ppc64)

define KEY '','','p','p','c','6','4','',''

elif defined(PPC)

define KEY '','','P','P','C','',''

elif defined(ppc)

define KEY '','','p','p','c','',''

elif defined(aarch64)

define KEY '','','a','a','r','c','h','6','4','',''

elif defined(ARM_ARCH_7A)

define KEY '','','A','R','M','','A','R','C','H','','7','A','',''

elif defined(ARM_ARCH_7S)

define KEY '','','A','R','M','','A','R','C','H','','7','S','',''

endif

define SIZE (sizeof(INT32))

static char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', ('0' + ((SIZE / 10000)%10)), ('0' + ((SIZE / 1000)%10)), ('0' + ((SIZE / 100)%10)), ('0' + ((SIZE / 10)%10)), ('0' + (SIZE % 10)), ']',

ifdef KEY

' ','k','e','y','[', KEY, ']',

endif

'\0'};

ifdef __CLASSIC_C__

int main(argc, argv) int argc; char *argv[];

else

int main(int argc, char *argv[])

endif

{ int require = 0; require += info_size[argc]; (void)argv; return require; }

Build output check failed: Regex: 'unknown .*option' Output line: 'warning: unknown warning option '-Wno-unused-but-set-variable', did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]' Compilation failed: source file: '/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c' check option: ' -Wno-unused-but-set-variable' ===== BUILD LOG ===== Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_a9948/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_a9948.dir/build.make CMakeFiles/cmTC_a9948.dir/build Building C object CMakeFiles/cmTC_a9948.dir/src.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -Wno-unused-but-set-variable -MD -MT CMakeFiles/cmTC_a9948.dir/src.c.o -MF CMakeFiles/cmTC_a9948.dir/src.c.o.d -o CMakeFiles/cmTC_a9948.dir/src.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c:1:8: warning: unknown pragma ignored [-Wunknown-pragmas]

pragma

   ^

2 warnings generated. Linking C executable cmTC_a9948 /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a9948.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip CMakeFiles/cmTC_a9948.dir/src.c.o -o cmTC_a9948

===== END =====

Build output check failed: Regex: 'unknown .*option' Output line: 'warning: unknown warning option '-Wno-maybe-uninitialized', did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]' Compilation failed: source file: '/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c' check option: ' -Wno-maybe-uninitialized' ===== BUILD LOG ===== Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_f4b3b/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_f4b3b.dir/build.make CMakeFiles/cmTC_f4b3b.dir/build Building C object CMakeFiles/cmTC_f4b3b.dir/src.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wstrict-prototypes -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-missing-prototypes -Wno-missing-declarations -Wno-undef -Wno-unused -Wno-sign-compare -Wno-cast-align -Wno-shadow -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -Wno-maybe-uninitialized -MD -MT CMakeFiles/cmTC_f4b3b.dir/src.c.o -MF CMakeFiles/cmTC_f4b3b.dir/src.c.o.d -o CMakeFiles/cmTC_f4b3b.dir/src.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option] /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c:1:8: warning: unknown pragma ignored [-Wunknown-pragmas]

pragma

   ^

2 warnings generated. Linking C executable cmTC_f4b3b /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f4b3b.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wstrict-prototypes -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-missing-prototypes -Wno-missing-declarations -Wno-undef -Wno-unused -Wno-sign-compare -Wno-cast-align -Wno-shadow -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip CMakeFiles/cmTC_f4b3b.dir/src.c.o -o cmTC_f4b3b

===== END =====

Build output check failed: Regex: 'unknown .*option' Output line: 'warning: unknown warning option '-Wno-unused-but-set-parameter', did you mean '-Wno-unused-parameter'? [-Wunknown-warning-option]' Compilation failed: source file: '/Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c' check option: ' -Wno-unused-but-set-parameter' ===== BUILD LOG ===== Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_93936/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_93936.dir/build.make CMakeFiles/cmTC_93936.dir/build Building C object CMakeFiles/cmTC_93936.dir/src.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-implicit-function-declaration -Wno-uninitialized -Wno-missing-prototypes -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -Wno-unused-but-set-parameter -MD -MT CMakeFiles/cmTC_93936.dir/src.c.o -MF CMakeFiles/cmTC_93936.dir/src.c.o.d -o CMakeFiles/cmTC_93936.dir/src.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c warning: unknown warning option '-Wno-unused-but-set-parameter'; did you mean '-Wno-unused-parameter'? [-Wunknown-warning-option] /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/src.c:1:8: warning: unknown pragma ignored [-Wunknown-pragmas]

pragma

   ^

2 warnings generated. Linking C executable cmTC_93936 /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_93936.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-implicit-function-declaration -Wno-uninitialized -Wno-missing-prototypes -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip CMakeFiles/cmTC_93936.dir/src.c.o -o cmTC_93936

===== END =====

Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)": Apple clang version 12.0.5 (clang-1205.0.22.9) Target: arm64-apple-darwin20.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin Determining if the function sgemm_ exists failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_16123/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_16123.dir/build.make CMakeFiles/cmTC_16123.dir/build Building C object CMakeFiles/cmTC_16123.dir/CheckFunctionExists.c.o /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -DCHECK_FUNCTIONEXISTS=sgemm -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_16123.dir/CheckFunctionExists.c.o -MF CMakeFiles/cmTC_16123.dir/CheckFunctionExists.c.o.d -o CMakeFiles/cmTC_16123.dir/CheckFunctionExists.c.o -c /opt/homebrew/Cellar/cmake/3.20.2/share/cmake/Modules/CheckFunctionExists.c Linking C executable cmTC_16123 /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_16123.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -DCHECK_FUNCTIONEXISTS=sgemm -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip CMakeFiles/cmTC_16123.dir/CheckFunctionExists.c.o -o cmTC_16123 Undefined symbols for architecture arm64: "sgemm", referenced from: _main in CheckFunctionExists.c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [cmTC_16123] Error 1 make: [cmTC_16123/fast] Error 2

Determining if the CL_VERSION_2_2 exist failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_a163d/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_a163d.dir/build.make CMakeFiles/cmTC_a163d.dir/build Building C object CMakeFiles/cmTC_a163d.dir/CheckSymbolExists.c.o /Library/Developer/CommandLineTools/usr/bin/cc -F/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_a163d.dir/CheckSymbolExists.c.o -MF CMakeFiles/cmTC_a163d.dir/CheckSymbolExists.c.o.d -o CMakeFiles/cmTC_a163d.dir/CheckSymbolExists.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: use of undeclared identifier 'CL_VERSION_2_2' return ((int*)(&CL_VERSION_2_2))[argc]; ^ 1 error generated. make[1]: [CMakeFiles/cmTC_a163d.dir/CheckSymbolExists.c.o] Error 1 make: [cmTC_a163d/fast] Error 2

File /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include </Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenCL.framework/Headers/cl.h>

int main(int argc, char** argv) { (void)argv;

ifndef CL_VERSION_2_2

return ((int*)(&CL_VERSION_2_2))[argc];

else

(void)argc; return 0;

endif

} Determining if the CL_VERSION_2_1 exist failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_e22e6/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e22e6.dir/build.make CMakeFiles/cmTC_e22e6.dir/build Building C object CMakeFiles/cmTC_e22e6.dir/CheckSymbolExists.c.o /Library/Developer/CommandLineTools/usr/bin/cc -F/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_e22e6.dir/CheckSymbolExists.c.o -MF CMakeFiles/cmTC_e22e6.dir/CheckSymbolExists.c.o.d -o CMakeFiles/cmTC_e22e6.dir/CheckSymbolExists.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: use of undeclared identifier 'CL_VERSION_2_1' return ((int*)(&CL_VERSION_2_1))[argc]; ^ 1 error generated. make[1]: [CMakeFiles/cmTC_e22e6.dir/CheckSymbolExists.c.o] Error 1 make: [cmTC_e22e6/fast] Error 2

File /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include </Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenCL.framework/Headers/cl.h>

int main(int argc, char** argv) { (void)argv;

ifndef CL_VERSION_2_1

return ((int*)(&CL_VERSION_2_1))[argc];

else

(void)argc; return 0;

endif

} Determining if the CL_VERSION_2_0 exist failed with the following output: Change Dir: /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_75b2d/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_75b2d.dir/build.make CMakeFiles/cmTC_75b2d.dir/build Building C object CMakeFiles/cmTC_75b2d.dir/CheckSymbolExists.c.o /Library/Developer/CommandLineTools/usr/bin/cc -F/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fPIE -MD -MT CMakeFiles/cmTC_75b2d.dir/CheckSymbolExists.c.o -MF CMakeFiles/cmTC_75b2d.dir/CheckSymbolExists.c.o.d -o CMakeFiles/cmTC_75b2d.dir/CheckSymbolExists.c.o -c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: use of undeclared identifier 'CL_VERSION_2_0' return ((int*)(&CL_VERSION_2_0))[argc]; ^ 1 error generated. make[1]: [CMakeFiles/cmTC_75b2d.dir/CheckSymbolExists.c.o] Error 1 make: [cmTC_75b2d/fast] Error 2

File /Users/huxinyun/AI/opencv-4.5.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include </Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenCL.framework/Headers/cl.h>

int main(int argc, char** argv) { (void)argv;

ifndef CL_VERSION_2_0

return ((int*)(&CL_VERSION_2_0))[argc];

else

(void)argc; return 0;

endif

}

brandaohugo commented 3 years ago

I have exactly the same here.

The output was: 1 ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /Library/Developer/CommandLineTools/usr/bin/cc Build flags: Id flags:

The output was: 1 ld: library not found for -lSystem clang: error: linker command failed with exit code 1 (use -v to see invocation)

. . .

gerardsimons commented 3 years ago

Please format your output with code tags "```". Also as the output mentions, please include -v for more verbose logging

sayakpaul commented 3 years ago

Apologies for my late reply. I have tried to be as detailed as possible with the steps and my system setup. If you think you are exactly following the steps AND the system is similar to mine and then it's failing I think it might better to report it on OpenCV's GitHub.

mayankbatra-batra commented 3 years ago

@sayakpaul,

I am getting error while I am executing cmake statement. I think I have my directories correct as you mentioned above, Not sure how to resolve this. Can you suggest something to resolve this

" -- Configuring incomplete, errors occurred! See also "/Users/mayankbatra/Downloads/opencv-4.5.0 2/build/CMakeFiles/CMakeOutput.log". See also "/Users/mayankbatra/Downloads/opencv-4.5.0 2/build/CMakeFiles/CMakeError.log". "

mayankbatra-batra commented 3 years ago

@Sayakpaul,

Below is a detailed output that I got when I ran the cmake statement: (python38-demo-v2) mayankbatra@Mayanks-MacBook-Pro build % cmake \ -DCMAKE_SYSTEM_PROCESSOR=arm64 \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DWITH_OPENJPEG=OFF \ -DWITH_IPP=OFF \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=/Users/mayankbatra/Downloads/opencv-4.5.0 2/modules \ -D PYTHON3_EXECUTABLE=/Users/mayankbatra/miniforge3/envs/python38-demo-v2/bin/python3 \ -D BUILD_opencv_python2=OFF \ -D BUILD_opencv_python3=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D BUILD_EXAMPLES=ON .. -- Detected processor: arm64 -- Looking for ccache - not found -- Performing Test HAVE_CPU_BASELINE_FLAGS -- Performing Test HAVE_CPU_BASELINE_FLAGS - Success -- libjpeg-turbo: VERSION = 2.0.5, BUILD = opencv-4.5.0-libjpeg-turbo -- LAPACK(LAPACK/Apple): LAPACK_LIBRARIES: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Accelerate.framework;-lm;-ldl -- LAPACK(LAPACK/Apple): Support is enabled. -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- Could NOT find Pylint (missing: PYLINT_EXECUTABLE) -- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Deprecation Warning at 3rdparty/carotene/hal/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at 3rdparty/carotene/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- OpenCV Python: during development append to PYTHONPATH: /Users/mayankbatra/Downloads/opencv-4.5.0 2/build/python_loader CMake Warning at /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:112 (message): OpenCV: Variable has been removed from CMake scripts: MINGW64 Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:9223372036854775807 (_ocv_access_removed_variable) /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:117 (if) /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:123 (ocv_declare_removed_variable) /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVDetectCXXCompiler.cmake:23 (ocv_declare_removed_variables) /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:163 (include)

CMake Warning at /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:112 (message): OpenCV: Variable has been removed from CMake scripts: MSVC64 Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:9223372036854775807 (_ocv_access_removed_variable) /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:117 (if) /Users/mayankbatra/Downloads/opencv-4.5.0 2/cmake/OpenCVUtils.cmake:123 (ocv_declare_removed_variable) /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVDetectCXXCompiler.cmake:23 (ocv_declare_removed_variables) /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:163 (include)

-- Detected processor: arm64 -- Looking for ccache - not found -- Performing Test HAVE_CPU_BASELINE_FLAGS -- Performing Test HAVE_CPU_BASELINE_FLAGS - Success CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/zlib/CMakeLists.txt:79 (add_library): add_library cannot create target "zlib" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/zlib". See documentation for policy CMP0002 for more details.

-- libjpeg-turbo: VERSION = 2.0.5, BUILD = opencv-4.5.0-libjpeg-turbo CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libjpeg-turbo/CMakeLists.txt:109 (add_library): add_library cannot create target "libjpeg-turbo" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/libjpeg-turbo". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libtiff/CMakeLists.txt:465 (add_library): add_library cannot create target "libtiff" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/libtiff". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libtiff/CMakeLists.txt:466 (target_link_libraries): Attempt to add link library "zlib" to target "libtiff" which is not built in this directory.

This is allowed only when policy CMP0079 is set to NEW.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libwebp/CMakeLists.txt:37 (add_library): add_library cannot create target "libwebp" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/libwebp". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libjasper/CMakeLists.txt:20 (add_library): add_library cannot create target "libjasper" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/libjasper". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libpng/CMakeLists.txt:77 (add_library): add_library cannot create target "libpng" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/libpng". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/libpng/CMakeLists.txt:78 (target_link_libraries): Attempt to add link library "zlib" to target "libpng" which is not built in this directory.

This is allowed only when policy CMP0079 is set to NEW.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/openexr/CMakeLists.txt:128 (add_library): add_library cannot create target "IlmImf" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/openexr". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/openexr/CMakeLists.txt:129 (target_link_libraries): Attempt to add link library "zlib" to target "IlmImf" which is not built in this directory.

This is allowed only when policy CMP0079 is set to NEW.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/protobuf/CMakeLists.txt:143 (add_library): add_library cannot create target "libprotobuf" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/protobuf". See documentation for policy CMP0002 for more details.

-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/quirc/CMakeLists.txt:11 (add_library): add_library cannot create target "quirc" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/quirc". See documentation for policy CMP0002 for more details.

CMake Deprecation Warning at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/carotene/hal/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/carotene/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/carotene/CMakeLists.txt:30 (add_library): add_library cannot create target "carotene_objs" because another target with the same name already exists. The existing target is created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/carotene". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/carotene/CMakeLists.txt:44 (add_library): add_library cannot create target "carotene" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/carotene". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/carotene/hal/CMakeLists.txt:86 (add_library): add_library cannot create target "tegra_hal" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/carotene/hal". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/ittnotify/CMakeLists.txt:40 (add_library): add_library cannot create target "ittnotify" because another target with the same name already exists. The existing target is a static library created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2/3rdparty/ittnotify". See documentation for policy CMP0002 for more details.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/3rdparty/ittnotify/CMakeLists.txt:44 (target_link_libraries): Attempt to add link library "dl" to target "ittnotify" which is not built in this directory.

This is allowed only when policy CMP0079 is set to NEW.

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVExtraTargets.cmake:23 (add_custom_target): add_custom_target cannot create target "opencv_modules" because another target with the same name already exists. The existing target is a custom target created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:861 (include)

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVExtraTargets.cmake:33 (add_custom_target): add_custom_target cannot create target "opencv_tests" because another target with the same name already exists. The existing target is a custom target created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:861 (include)

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVExtraTargets.cmake:39 (add_custom_target): add_custom_target cannot create target "opencv_perf_tests" because another target with the same name already exists. The existing target is a custom target created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:861 (include)

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVExtraTargets.cmake:54 (add_custom_target): add_custom_target cannot create target "opencv_samples" because another target with the same name already exists. The existing target is a custom target created in source directory "/Users/mayankbatra/Downloads/opencv-4.5.0 2". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0/CMakeLists.txt:861 (include)

CMake Error at /Users/mayankbatra/Downloads/opencv-4.5.0/cmake/OpenCVModule.cmake:364 (message): OpenCV has already loaded its modules. Calling ocv_glob_modules second time is not allowed. Call Stack (most recent call first): /Users/mayankbatra/Downloads/opencv-4.5.0/modules/CMakeLists.txt:7 (ocv_glob_modules)

-- Configuring incomplete, errors occurred! See also "/Users/mayankbatra/Downloads/opencv-4.5.0 2/build/CMakeFiles/CMakeOutput.log". See also "/Users/mayankbatra/Downloads/opencv-4.5.0 2/build/CMakeFiles/CMakeError.log".

mayankbatra-batra commented 3 years ago

@Sayakpaul, Never mind, I was able to get it solved using conda install opencv. (reading through one of the comments on your post)

Thank you so much!

wilsoncharles commented 3 years ago

Hi, Im getting the below error. Im new to Mac environment. Could you please help

-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Deprecation Warning at 3rdparty/carotene/hal/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at 3rdparty/carotene/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

otaviomad commented 3 years ago

dude, you obfuscated your username in the mdfind command but your cmake has your username wide open.

surajkm94 commented 3 years ago

conda install opencv worked just fine!

Niranjanprasad12 commented 3 years ago

mkdir build && cd build' i'm having empty build folder after excuting this code , and i tried to compile opencv it shows me a error 'CMakelists.txt is not found' pls help me out to solve this problem

Applelong commented 3 years ago

conda install -y python==3.9 conda install opencv import cv2 Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Users/xulong/miniforge3/envs/tf25/lib/python3.9/site-packages/cv2.cpython-39-darwin.so, 2): Library not loaded: @rpath/liblapack.3.dylib Referenced from: /Users/xulong/miniforge3/envs/tf25/lib/libopencv_core.4.5.2.dylib Reason: image not found!! help me pls..

gregoryverghese commented 3 years ago

hi I followed steps above but I seem to get this error when I import cv2?

ImportError: dlopen(/Users/w2030634/miniforge3/envs/venv/lib/python3.8/site-packages/cv2.so, 2): Library not loaded: /opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib Referenced from: /Users/w2030634/miniforge3/envs/venv/lib/python3.8/site-packages/cv2.so Reason: image not found

gregoryverghese commented 3 years ago

I solved the above problem by reinstalling ffmpeg

$ brew uninstall ffmpeg

$ brew update $ brew upgrade $ brew cleanup

$ brew install ffmpeg --force $ brew link ffmpeg

Nadlada commented 2 years ago

I can't make -j8