conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
948 stars 1.73k forks source link

Syntax error when installing OpenCV(Jasper) in debug #22864

Open AoGao-Kedoka opened 8 months ago

AoGao-Kedoka commented 8 months ago

What is your question?

I get syntax error when install opencv (Jasper) and I can't really figure out why this is happening. With conan build_type Release it works. Here is the shortened log:


 conan install .. -s build_type=Debug --build=missing

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

-------- Installing package jasper/4.0.0 (27 of 44) --------
jasper/4.0.0: Building from source
jasper/4.0.0: Package jasper/4.0.0:69669f41e67cf780e0141fa22574b10f39a43302
jasper/4.0.0: Copying sources to build folder
jasper/4.0.0: Building your package in C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b
jasper/4.0.0: Calling generate()
jasper/4.0.0: Generators folder: C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\build\Debug\generators
jasper/4.0.0: CMakeToolchain generated: conan_toolchain.cmake
jasper/4.0.0: CMakeToolchain generated: CMakePresets.json
jasper/4.0.0: CMakeToolchain generated: ..\..\..\src\CMakeUserPresets.json
jasper/4.0.0: Generating aggregated env files
jasper/4.0.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
jasper/4.0.0: Calling build()
jasper/4.0.0: Apply patch (conan): Do not enforce rpath configuration
jasper/4.0.0: Apply patch (conan): No generator dependent libname
jasper/4.0.0: Running CMake.configure()
jasper/4.0.0: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:/Users/aogao/.conan2/p/b/jaspe75492755d4772/b/build/Debug/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/aogao/.conan2/p/b/jaspe75492755d4772/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\src"
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[vcvarsall.bat] Environment initialized for: 'x64'
Software version: 4.0.0
Shared library ABI version: 7
Shared library build version: 7.0.0
CMAKE_VERSION: 3.28.1
-- Using Conan toolchain: C:/Users/aogao/.conan2/p/b/jaspe75492755d4772/b/build/Debug/generators/conan_toolchain.cmake
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is MSVC 19.38.33134.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMAKE_C_COMPILER_ID: MSVC
CMAKE_C_COMPILER_VERISON: 19.38.33134.0
-- Performing Test JAS_HAVE_FSANITIZE_LEAK
-- Performing Test JAS_HAVE_FSANITIZE_LEAK - Failed
-- Performing Test JAS_HAVE_FSANITIZE_UNDEFINED
-- Performing Test JAS_HAVE_FSANITIZE_UNDEFINED - Failed
-- Performing Test JAS_HAVE_MSVC_FSANITIZE_ADDRESS
-- Performing Test JAS_HAVE_MSVC_FSANITIZE_ADDRESS - Success
JAS_MULTICONFIGURATION_GENERATOR FALSE
CMAKE_BUILD_TYPE: Debug
CMAKE_C_COMPILER_ID: MSVC
CMAKE_C_COMPILER: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe
CMAKE_LINKER: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/link.exe
CMAKE_C_FLAGS: /DWIN32 /D_WINDOWS /W3
CMAKE_C_FLAGS_RELEASE: /O2 /Ob2
CMAKE_C_FLAGS_DEBUG: /Zi /Ob0 /Od /RTC1
__STDC_VERSION__: 0L
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file io.h
-- Looking for include file io.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - not found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - not found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- 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 max_align_t
-- Check size of max_align_t - failed
JAS_HAVE_MAX_ALIGN_T: 0
-- Check size of char
-- Check size of char - done
JAS_SIZEOF_CHAR: 1
-- Check size of int
-- Check size of int - done
JAS_SIZEOF_INT: 4
-- Check size of long
-- Check size of long - done
JAS_SIZEOF_LONG: 4
-- Check size of long long
-- Check size of long long - done
JAS_SIZEOF_LLONG: 8
-- Check size of size_t
-- Check size of size_t - done
JAS_SIZEOF_SIZE_T: 8
-- Check size of ssize_t
-- Check size of ssize_t - failed
JAS_HAVE_SSIZE_T:
-- Check size of int_fast32_t
-- Check size of int_fast32_t - done
JAS_SIZEOF_INT_FAST32_T: 4
-- Check size of int_least32_t
-- Check size of int_least32_t - done
JAS_SIZEOF_INT_LEAST32_T: 4
-- Check size of int_fast64_t
-- Check size of int_fast64_t - done
JAS_SIZEOF_INT_FAST64_T: 8
-- Check size of int_least64_t
-- Check size of int_least64_t - done
JAS_SIZEOF_INT_LEAST64_T: 8
-- Check size of __int128_t
-- Check size of __int128_t - failed
JAS_SIZEOF_INT128_T:
-- Looking for nanosleep
-- Looking for nanosleep - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - not found
-- Looking for getrusage
-- Looking for getrusage - not found
-- Looking for mkostemp
-- Looking for mkostemp - not found
-- Looking for snprintf
-- Looking for snprintf - found
JAS_ENABLE_MIF_CODEC: OFF
Support for all native codecs has been included.
-- Performing Test JAS_TRY_COMPILE_C11_THREADS
-- Performing Test JAS_TRY_COMPILE_C11_THREADS - Success
-- Performing Test JAS_TRY_COMPILE_THREAD_LOCAL
-- Performing Test JAS_TRY_COMPILE_THREAD_LOCAL - Success
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
Threading support enabled.
Threads_FOUND: TRUE
Pthread library:
Prefer POSIX threading support: ON
Threading support found: TRUE
C11 threading support detected: TRUE
POSIX threading support detected: FALSE
WIN32 threading support detected: TRUE
C11 threading support selected: TRUE
POSIX threading support selected: FALSE
Win32 threading support selected: FALSE
Threading library:
_Thread_local: TRUE
-- Conan: Target declared 'JPEG::JPEG'
target: JPEG::JPEG
JPEG::JPEG: adding include directory $<$<CONFIG:Debug>:C:/Users/aogao/.conan2/p/b/libjp1e1ae59626853/p/include>
JAS_INCLUDE_JPG_CODEC: ON
JAS_INCLUDE_HEIC_CODEC: 0
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Success
-- Configuring done (34.4s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/aogao/.conan2/p/b/jaspe75492755d4772/b/build/Debug

jasper/4.0.0: Running CMake.build()
jasper/4.0.0: RUN: cmake --build "C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\build\Debug" -- -j8
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[vcvarsall.bat] Environment initialized for: 'x64'
[2/54] Building C object src\libjasper\CMakeFiles\libjasper.dir\base\jas_cm.c.obj
FAILED: src/libjasper/CMakeFiles/libjasper.dir/base/jas_cm.c.obj
C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe  /nologo -DLIBJPEG_STATIC -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -IC:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\build\Debug\src\libjasper\include -IC:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\src\src\libjasper\include -external:IC:\Users\aogao\.conan2\p\b\libjp1e1ae59626853\p\include -external:W0 /DWIN32 /D_WINDOWS /W3 /Zi /Ob0 /Od /RTC1 -std:c11 -MDd /wd4244 /wd4090 /wd4018 /wd4996 /wd4267 /showIncludes /Fosrc\libjasper\CMakeFiles\libjasper.dir\base\jas_cm.c.obj /Fdsrc\libjasper\CMakeFiles\libjasper.dir\libjasper.pdb /FS -c C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\src\src\libjasper\base\jas_cm.c
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2061: syntax error: identifier 'atomic_bool'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2061: syntax error: identifier 'atomic_char'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(38): error C2061: syntax error: identifier 'atomic_schar'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(38): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(39): error C2061: syntax error: identifier 'atomic_uchar'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(39): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(40): error C2061: syntax error: identifier 'atomic_short'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(40): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(41): error C2061: syntax error: identifier 'atomic_ushort'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(41): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(42): error C2061: syntax error: identifier 'atomic_int'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(42): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(43): error C2061: syntax error: identifier 'atomic_uint'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(43): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(44): error C2061: syntax error: identifier 'atomic_long'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(44): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(45): error C2061: syntax error: identifier 'atomic_ulong'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(45): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(46): error C2061: syntax error: identifier 'atomic_llong'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(46): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(47): error C2061: syntax error: identifier 'atomic_ullong'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(47): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(48): error C2061: syntax error: identifier 'atomic_char16_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(48): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(49): error C2061: syntax error: identifier 'atomic_char32_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(49): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(50): error C2061: syntax error: identifier 'atomic_wchar_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(50): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(51): error C2061: syntax error: identifier 'atomic_int_least8_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(51): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(52): error C2061: syntax error: identifier 'atomic_uint_least8_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(52): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(53): error C2061: syntax error: identifier 'atomic_int_least16_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(53): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(54): error C2061: syntax error: identifier 'atomic_uint_least16_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(54): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(55): error C2061: syntax error: identifier 'atomic_int_least32_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(55): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(56): error C2061: syntax error: identifier 'atomic_uint_least32_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(56): error C2059: syntax error: ';'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(57): error C2061: syntax error: identifier 'atomic_int_least64_t'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(57): error C2059: syntax error: ';'
C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\src\src\libjasper\include\jasper/jas_malloc.h(333): fatal error C1003: error count exceeds 100; stopping compilation
ninja: build stopped: subcommand failed.

jasper/4.0.0: ERROR:
Package '69669f41e67cf780e0141fa22574b10f39a43302' build failed
jasper/4.0.0: WARN: Build folder C:\Users\aogao\.conan2\p\b\jaspe75492755d4772\b\build\Debug
ERROR: jasper/4.0.0: Error in build() method, line 94
        cmake.build()
        ConanException: Error 1 while executing
memsharded commented 8 months ago

Hi @AoGao-Kedoka

Thanks for your report. This might be a recipe issue (in that case we need to transfer it to conan-center-index repo instead), but I am having a look first.

So far I have been able to build it locally with:

conan install --requires=jasper/4.0.0 --build=missing -s build_type=Debug

That means, with the default "Visual Studio" generator instead of the Ninja one. Could you please try the above also in your machine? Just to rule out other possible issues.

memsharded commented 8 months ago

Seems to also work with Ninja:

conan install --requires=jasper/4.0.0 --build=missing -s build_type=Debug -c tools.cmake.cmaketoolchain:generator=Ninja

If you can try that one too, that would help.

Please remove all previous packages from your cache, just to make sure too.

AoGao-Kedoka commented 8 months ago

Hi, i actually already tried both with or without the Ninja. The command fails with the same error. Also tried completely remove ~/.conan2 (this should remove all previous packages I guess?)

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2061: syntax error: identifier 'atomic_bool'

Since it looks like a visual studio include problem, I also tried reinstalling the vs2022.

memsharded commented 8 months ago

Also tried completely remove ~/.conan2 (this should remove all previous packages I guess?)

Yes, that will remove all packages

memsharded commented 8 months ago

I have been checking and comparing the output and the differences in my logs are:

-- Performing Test JAS_TRY_COMPILE_C11_THREADS - Failed
...
Threads_FOUND: TRUE
Pthread library:
Prefer POSIX threading support: ON
Threading support found: TRUE
C11 threading support detected: TRUE
POSIX threading support detected: FALSE
WIN32 threading support detected: TRUE
C11 threading support selected: TRUE
POSIX threading support selected: FALSE
Win32 threading support selected: FALSE

Which look related, as the error comes from vcruntime_c11_stdatomic

AoGao-Kedoka commented 8 months ago

Thanks. It actually works for me 1-2 months ago so I thought the package was updated. This looks like a configuration issue from my environment then 🤔. I will take a deeper look into it.

memsharded commented 8 months ago

I have managed to reproduce. I have updated my VS 2022 to the very latest update and now it failed!

I was running just the previous update, so it seems the latest one changed something that broke this recipe.

memsharded commented 8 months ago

Seems related: https://developercommunity.visualstudio.com/t/C11-atomic-types-are-broken-in-CL/10560673?sort=newest

AoGao-Kedoka commented 8 months ago

Seems related: https://developercommunity.visualstudio.com/t/C11-atomic-types-are-broken-in-CL/10560673?sort=newest

Seems like /experimental:c11atomics need to be added to the build recipe🤔

memsharded commented 8 months ago

Well, it did work in the previous update of VS... I am concerned that this might break other recipes as well

elvisdukaj commented 7 months ago

Same issue here while trying to build freeimage. Jasper is coming from libraw and with the same configuration I’ve the same build issue.

memsharded commented 7 months ago

Confirmed this is a recipe issue:

$ conan install --requires=jasper/4.0.0 --build=jasper*

Fails since last update While

$ conan install --requires=jasper/4.0.0 --build=jasper* -c tools.build:cflags="['/experimental:c11atomics']"

Works.

This was also not a recipe issue some time ago, the last VS update broke builds that were working in the past. As this is not a Conan issue, I am moving this to conan-center-index

memsharded commented 7 months ago

I have just realized that 4.0.0 is an older version from 2022.

I have just tried:

conan install --requires=jasper/4.2.0 --build=jasper*

And this builds correctly. This is kind of expected, older jasper version do not support latest versions of the compiler and will fail to build.

The recipe could introduce a validate() to raise an error if an older jasper/4.0.0 version is being used with the latest VS 2022, that could help with the UX with a better and more explicit error message, but the solution would be in any case to update to jasper/4.0.2