TianZerL / Anime4KCPP

A high performance anime upscaler
MIT License
1.76k stars 138 forks source link

Compile error on macOS #70

Closed samuel21119 closed 3 years ago

samuel21119 commented 3 years ago

I followed the instructions in the wiki. But when I run compile it using make, it occurred error 'use of undeclared identifier'

[  5%] Building CXX object Anime4KCore/CMakeFiles/Anime4KCPPCore.dir/src/ACOpenCL.cpp.o
cd /Users/samuel/Documents/Anime4KCPP/Anime4KCore && /usr/local/opt/llvm/bin/clang++ -DAnime4KCPPCore_EXPORTS -DBUILT_IN_KERNEL -DENABLE_IMAGE_IO -DENABLE_OPENCL -DENABLE_PREVIEW_GUI -DENABLE_VIDEO -I/usr/local/opt/llvm/include -I/Users/samuel/Documents/Anime4KCPP/Anime4KCore/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -I/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl -isystem /usr/local/Cellar/opencv/4.5.2_4/include/opencv4 -pthread -march=native -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -fPIC -std=gnu++17 -MD -MT Anime4KCore/CMakeFiles/Anime4KCPPCore.dir/src/ACOpenCL.cpp.o -MF CMakeFiles/Anime4KCPPCore.dir/src/ACOpenCL.cpp.o.d -o CMakeFiles/Anime4KCPPCore.dir/src/ACOpenCL.cpp.o -c /Users/samuel/Documents/Anime4KCPP/Anime4KCore/src/ACOpenCL.cpp
In file included from /Users/samuel/Documents/Anime4KCPP/Anime4KCore/src/ACOpenCL.cpp:12:
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_QUEUE_ON_HOST_PROPERTIES'
CL_HPP_PARAM_NAME_INFO_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_)
^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1340:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, cl_command_queue_properties) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1341:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, cl_command_queue_properties) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1342:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1343:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_MAX_ON_DEVICE_QUEUES'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1344:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_MAX_ON_DEVICE_QUEUES, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_MAX_ON_DEVICE_EVENTS'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1345:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_MAX_ON_DEVICE_EVENTS, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_MAX_PIPE_ARGS'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1346:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_MAX_PIPE_ARGS, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1347:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_PIPE_MAX_PACKET_SIZE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1348:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_PIPE_MAX_PACKET_SIZE, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_SVM_CAPABILITIES'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1349:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_SVM_CAPABILITIES, cl_device_svm_capabilities) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1350:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1351:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1352:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT, cl_uint) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1355:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, cl_uint ) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1356:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, size_type ) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1357:23: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_device_info, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, size_type ) \
                      ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_PROFILING_COMMAND_COMPLETE'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1358:26: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_profiling_info, CL_PROFILING_COMMAND_COMPLETE, cl_ulong) \
                         ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1359:28: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, cl_bool) \
                           ^
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1456:1: error: use of undeclared identifier 'CL_KERNEL_EXEC_INFO_SVM_PTRS'
/Users/samuel/Documents/Anime4KCPP/ThirdParty/include/opencl/CL/opencl.hpp:1360:28: note: expanded from macro 'CL_HPP_PARAM_NAME_INFO_2_0_'
    F(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_SVM_PTRS, void**) \
                           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
TianZerL commented 3 years ago

This is because Apple only support OpenCL 1.2, will fix soon.

TianZerL commented 3 years ago

You can also add this to CMake : -DUse_Legacy_OpenCL_API=ON. It should work. Please help test it

samuel21119 commented 3 years ago

It works, thanks!