error compiling vkdt

I have this (new) error when i try to compile vkdt from github:

…/vkdt/src/pipe/modules/i-raw/rawspeed/src/librawspeed/common/DngOpcodes.cpp:66:3: error: ‘switch’ missing ‘default’ label [-Werror,-Wswitch-default]
66 | switch (ri->getDataType()) {
| ^
1 error generated.

is it dependencies problem (see under) or any idea ?

ps :
– The CXX compiler identification is Clang 18.0.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/clang++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Checking for -mtune=generic support
– Performing Test MTUNEGENERIC
– Performing Test MTUNEGENERIC - Success
– Checking for -mtune=generic support - works
– Performing Test CLANG_CXX_THREAD_SAFETY_ANALYSIS_NEGATIVE_CAPABILITIES_WORK
– Performing Test CLANG_CXX_THREAD_SAFETY_ANALYSIS_NEGATIVE_CAPABILITIES_WORK - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WALL
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WALL - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEXTRA
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEXTRA - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEVERYTHING
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEVERYTHING - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CXX98_COMPAT
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CXX98_COMPAT - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CXX98_COMPAT_PEDANTIC
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CXX98_COMPAT_PEDANTIC - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CONVERSION
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_CONVERSION - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_COVERED_SWITCH_DEFAULT
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_COVERED_SWITCH_DEFAULT - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_DEPRECATED
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_DEPRECATED - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_DOUBLE_PROMOTION
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_DOUBLE_PROMOTION - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_OLD_STYLE_CAST
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_OLD_STYLE_CAST - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_PADDED
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_PADDED - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_SWITCH_ENUM
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_SWITCH_ENUM - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNUSED_MACROS
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNUSED_MACROS - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNUSED_PARAMETER
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNUSED_PARAMETER - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_WEAK_VTABLES
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_WEAK_VTABLES - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNSAFE_BUFFER_USAGE
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WNO_UNSAFE_BUFFER_USAGE - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEXTRA_SEMI
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WEXTRA_SEMI - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WSTACK_USAGE_4096
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WSTACK_USAGE_4096 - Failed
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WFRAME_LARGER_THAN_4096
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WFRAME_LARGER_THAN_4096 - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WLARGER_THAN_32768
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WLARGER_THAN_32768 - Success
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WERROR
– Performing Test RAWSPEED_HAVE_CXX_FLAG_WERROR - Success
– Looking for OpenMP
– Found OpenMP_CXX: -fopenmp=libomp (found suitable version “4.5”, minimum required is “4.5”)
– Found OpenMP: TRUE (found suitable version “4.5”, minimum required is “4.5”)
– Looking for OpenMP - found (system)
– Looking for pugixml
– Found Pugixml 1.13
– Looking for pugixml - found (system)
– Looking for JPEG
– Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version “80”)
– Looking for JPEG - found
– Looking for jpeg_mem_src
– Looking for jpeg_mem_src - found
– Looking for ZLIB
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version “1.2.13”, minimum required is “1.2.11”)
– The C compiler identification is Clang 18.0.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/bin/clang - skipped
– Detecting C compile features
– Detecting C compile features - done
– Looking for C++ include zlib.h
– Looking for C++ include zlib.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 uLongf
– Check size of uLongf - done
– Looking for Z_OK
– Looking for Z_OK - found
– Checking prototype uncompress for HAVE_ZLIB_UNCOMPRESS_PROTOTYPE
– Checking prototype uncompress for HAVE_ZLIB_UNCOMPRESS_PROTOTYPE - True
– Checking prototype zError for HAVE_ZLIB_ZERROR_PROTOTYPE
– Checking prototype zError for HAVE_ZLIB_ZERROR_PROTOTYPE - True
– Looking for uncompress
– Looking for uncompress - found
– Looking for zError
– Looking for zError - found
– Looking for ZLIB - found (system)
– Looking for malloc
– Looking for malloc - found
– Looking for free
– Looking for free - found
– Looking for aligned_alloc
– Looking for aligned_alloc - found
– Performing Test HAVE_CXX_THREAD_LOCAL
– Performing Test HAVE_CXX_THREAD_LOCAL - Success
– Trying to query CPU L1d cache line size
– Performing binary package build, using hardcoded value.
– Deciding that the CPU L1d cache line size is 64 bytes
– Trying to query CPU page size
– Performing binary package build, using hardcoded value.
– Deciding that the CPU page size is 4096 bytes
– Trying to query CPU large page size
– Performing binary package build, using hardcoded value.
– Deciding that the CPU large page size is 4096 bytes
– Found XMLLINT: /usr/bin/xmllint
– The following features have been enabled:

  • OpenMP-based threading, used for parallelization of the library
  • XML reading, used for loading of data/cameras.xml
  • Lossy JPEG decoding, used for DNG Lossy JPEG compression decoding
  • ZLIB decoding, used for DNG Deflate compression decoding

– The following OPTIONAL packages have been found:

– The following RECOMMENDED packages have been found:

  • OpenMP (required version >= 4.5), Open Multi-Processing, https://www.openmp.org/
    Used for parallelization of the library
  • JPEG, free library for handling the JPEG image data format, implements a JPEG codec
    Used for decoding DNG Lossy JPEG compression
  • ZLIB (required version >= 1.2.11), software library used for data compression
    Used for decoding DNG Deflate compression

– The following REQUIRED packages have been found:

  • Pugixml (required version >= 1.8), Light-weight, simple and fast XML parser, http://pugixml.org/
    Used for loading of data/cameras.xml

– Configuring done
– Generating done

heya,

probably a new default compiler warning? i suppose i could probably update rawspeed, but that would mean losing CR3 support.

if you’re adventurous you could try to use the rawler backend instead (this is what the appimage does as well):

put this in your bin/config.mk:

VKDT_USE_EXIV2=0
export VKDT_USE_EXIV2

VKDT_USE_RAWINPUT=2
export VKDT_USE_RAWINPUT

and then make clean && make -j20 again. maybe you’ll have to install rustc or cargo. i like this backend because it replaces rawspeed and exiv2 with a single library.

… did that work? let me know if you’d prefer rawspeed without CR3, i can post instructions how to update the submodule. might have to do that in the long run anyways, so CR3 will only be supported by the other codepath.

Yes with the modifications of config.mk.defaults you propose, i succeed today to compile vkdt.
I don’t use CR3 files, only CR2.

I try today to compile vkdt for video options and i don’t succeed. I am on ubuntu 22.04 with ffmpeg version 4.4.2. and the libraries libavformat-dev an libavcodec-dev are correctly installed.
I have this error:
clang -Wall -pipe -I. -D_GNU_SOURCE -std=c11 -Ipipe -I. -fPIC -Wall -pipe -O3 -march=x86-64 -DNDEBUG -I/usr/include/x86_64-linux-gnu -shared pipe/modules/i-vid/main.c pipe/connector.c -o pipe/modules/i-vid/libi-vid.so -s -lavformat -lavcodec
pipe/modules/i-vid/main.c:437:42: error: no member named ‘ch_layout’ in ‘struct AVCodecContext’
437 | .snd_channels = d->actx ? d->actx->ch_layout.nb_channels : 0,
| ~~~~~~~ ^
pipe/modules/i-vid/main.c:474:42: error: no member named ‘frame_num’ in ‘struct AVCodecContext’; did you mean ‘frame_number’?
474 | if(mod->graph->frame + 1 != d->vctx->frame_num) // zero vs 1 based
| ^~~~~~~~~
| frame_number
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1227:9: note: ‘frame_number’ declared here
1227 | int frame_number;
| ^
pipe/modules/i-vid/main.c:605:29: error: no member named ‘ch_layout’ in ‘struct AVCodecContext’
605 | int channels = d->actx->ch_layout.nb_channels;
| ~~~~~~~ ^
3 errors generated.
make[2]: *** [Makefile:161 : pipe/modules/i-vid/libi-vid.so] Erreur 1

Thanks

hmm… my ffmpeg claims to be 6.1.1-1 ii libavcodec-dev:amd64 7:6.1.1-1 amd64 <= says dpkg -l. normally people have newer software than i do. maybe this time yours is much older?

Yes i think so. I try to install a newer version of ffmpeg but i don’t succeed. I think i will wait for the next Ubuntu LTS in next april and install it.

I was stuck because of ffmpeg 4.4 too
Trying again to compile vkdt gave me the opportunity to see what was holding back the ffmpeg upgrade and it was … video cd support on gst-plugins (dragging libquicktime) maybe it’s time to get rid of this :smiley:

CR3 support seems broken though

[i-raw] (/home/clind/vkdt/J12A0599.CR3) virtual void rawspeed::Cr3Decoder::checkSupportInternal(const CameraMetaData *), line 603: CR3 compressor version (CNCV: CanonCR3_001/00.11.00/00.00.00) is not supported

Raw from this thread Another try in vkdt

wow video cd! i had forgotten about this one. i suppose it’s better than vhs.

anyways, you can disable the ffmpeg stuff in a custom config.mk (set VKDT_USE_FFMPEG=0 and export that variable, see config.mk.defaults for examples).

as to CR3: rawspeed doesn’t support it. i backported some code that reads some older CR3 but reportedly not newer ones. going forward i’ll move to vanilla upstream rawspeed (completely without CR3) and you’ll need to compile with VKDT_USE_RAWINPUT=2 i.e. the rust/rawler backend to read CR3. i also made an appimage with this enabled now, i hope it works.

to compile with ffmpeg6 on ubuntu 22.04 (what github runners use) i enable this ffmpeg6 ppa:

sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg6

probably the .github/workflows/nightly.yml file holds good information about how to build from source in general.