How to compile cr2hdr compilation in linux?

Started by zenny, February 22, 2024, 06:17:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zenny

Hi,

I could not find MLV-app like utility for editing images taken with dual iso feature for Linux. Please correct me if I have missed something.

So I just pulled @Danne's repo from https://bitbucket.org/Dannephoto/magiclantern_hg_02.git in order to compile cr2hdr in order to process the images captured with dual iso feature, but I could not figure out exactly how to compile in Linux?

It would be nice if @Danne or @Bilal explain a bit about the compilation process because I could not figure out anything specific to EOS-M and particularly to compile and build cr2hdr binary.

Thanks and cheers,

/z

Walter Schulz

Quote from: zenny on February 22, 2024, 06:17:28 PMI could not find MLV-app like utility for editing images taken with dual iso feature for Linux. Please correct me if I have missed something.

https://mlv.app first link.

zenny

Quote from: Walter Schulz on February 22, 2024, 08:10:23 PMhttps://mlv.app first link.

Thanks!

If I am not wrong, MLV-app is to process only the MLV videos, right? I trying to edit raw images with .CR2 extensions, pictured in dual iso mode with horizontal lines.

names_are_hard

Don't be surprised if someone tells you how to find MLVApp for Linux, if you say you can't find that ;)

Assuming you're using a modern linux, to get cr2hdr I would recommend you do this:
git clone https://github.com/reticulatedpines/magiclantern_simplified
cd magiclantern_simplified/modules/dual_iso
make cr2hdr

zenny

Quote from: names_are_hard on February 23, 2024, 04:01:28 AMDon't be surprised if someone tells you how to find MLVApp for Linux, if you say you can't find that ;)

Assuming you're using a modern linux, to get cr2hdr I would recommend you do this:
git clone https://github.com/reticulatedpines/magiclantern_simplified
cd magiclantern_simplified/modules/dual_iso
make cr2hdr

Thanks for the input. I tried to do accordingly, but I am not aware of the list of libraries (32-bit?) that fails the compilation, particularly module_strings.h is not found anywhere in any library!

I appreciate if you share particular libraries required to compile and build.

Cheers,
/z

names_are_hard

You will get an error around missing module_strings.h if you don't have rst2html in path.  On a debian based distro you can install this via:

apt install python3-docutils

zenny

Quote from: names_are_hard on February 23, 2024, 05:58:00 AMYou will get an error around missing module_strings.h if you don't have rst2html in path.  On a debian based distro you can install this via:

apt install python3-docutils

Thanks for prompt response.

I have the python3-docutils installed, but still get the error as follows:

cr2hdr.c:58:10: fatal error: module_strings.h: No such file or directory
   58 | #include "module_strings.h"

names_are_hard


zenny


names_are_hard

The only reason I've ever seen before for that error is missing rst2html from path, so I may not be able to help you much further.

When you're in the dual_iso directory, what's the output from this command?
python3 ../readme2modulestrings.py > module_strings.h

Frank7D

Quote from: zenny on February 23, 2024, 06:21:45 AMThanks for prompt response.

I have the python3-docutils installed, but still get the error as follows:

cr2hdr.c:58:10: fatal error: module_strings.h: No such file or directory
   58 | #include "module_strings.h"


IIRC, I got that message, and I resolved it by switching to an older version of Linux (Ubuntu).

Edit: Here's the thread with my issue: https://www.magiclantern.fm/forum/index.php?topic=20214.msg245901#msg245901

names_are_hard

That shouldn't be relevant here.  You were trying to build an old repo that expects old tooling, and there was confusion around python2 and python3.

If zenny followed my instructions, they're using a modern repo that works fine with python3.

zenny

Quote from: names_are_hard on February 23, 2024, 04:07:55 PMThe only reason I've ever seen before for that error is missing rst2html from path, so I may not be able to help you much further.

When you're in the dual_iso directory, what's the output from this command?
$ python3 ../readme2modulestrings.py > module_strings.h

$ python3 ../readme2modulestrings.py > module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html | python3 ../html2text.py -b 70$//"sed "s/
# Dual ISO

Increases dynamic range by sampling the sensor at two different
ISOs, switching ISO for every other line pair. This trick cleans up
shadow noise, resulting in a dynamic range improvement of
around 3 stops, at the cost of reduced vertical resolution,
aliasing and moire.

Works for both raw photos (CR2) and raw videos (DNG). You need
to postprocess these files with a tool called **cr2hdr**.

After postprocessing, you will get a DNG that looks like a dark ISO
100 shot, but you can bring the exposure back up and be
delighted by how little noise is present in those recovered
shadows.

# Quick start

 *  Start at ISO 100 in Canon menu
 *  Expose to the right by changing shutter and aperture
 *  If the image is still dark, enable dual ISO
 *  Adjust recovery ISO: higher values = cleaner shadows, but more
    artifacts
 *  Try not to go past ISO 1600; you will not see any major
    improvements, but you will get more interpolation artifacts and
    hot pixels.

# Tips and tricks

 *  Do not use dual ISO for regular scenes that don't require a very
    high dynamic range.
 *  Raw zebras are aware of dual ISO: weak zebras are displayed
    where only the high ISO is overexposed, strong (solid) zebras are
    displayed where both ISOs are overexposed.
 *  Raw histogram will display only the low-ISO half of the image
    (since the high-ISO data is used for cleaning up shadow noise).
 *  For optimal exposure (minimal noise without clipped highlights),
    try both dual ISO and ETTR.
 *  Do not be afraid of less aggressive settings like 100/400. They
    are almost as good as 100/1600 regarding shadow noise, but
    with much less aliasing artifacts.
 *  Be careful with long exposures, you may get lots of hot pixels.


/Downloads/gitrepos/magiclantern_simplified/modules/dual_iso/../html2text.py:630: SyntaxWarni
ng: invalid escape sequence '\s'
  data = re.sub('\s+', ' ', data)

(<class 'SystemExit'>, SystemExit(1), <traceback object at 0x7f3d6eb82140>)


zenny

Quote from: Frank7D on February 23, 2024, 04:25:54 PMIIRC, I got that message, and I resolved it by switching to an older version of Linux (Ubuntu).

Edit: Here's the thread with my issue: https://www.magiclantern.fm/forum/index.php?topic=20214.msg245901#msg245901

@Frank7d Thanks for the pointer. But I do not plan to go back to older versions of Ubuntu.

I use a rolling release distro, voidlinux which has got the latest python3 and therefore following @names_are_hard's advice.

Cheers,
/z

names_are_hard

Ah, good, we have found the real error:

modules/dual_iso/../html2text.py:630: SyntaxWarning: invalid escape sequence '\s'
  data = re.sub('\s+', ' ', data)

You are using a version of Python too modern for the build system.  A change in 3.12 has introduced this error:
https://docs.python.org/3/whatsnew/3.12.html
A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning,
instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning
 ("\d" is an invalid escape sequence, use raw strings for regular expression:
 re.compile(r"\d+\.\d+")). In a future Python version, SyntaxError will eventually be raised,
 instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

Using a bleeding edge distro for doing builds may not be a good idea, you'll hit these kinds of problems fairly frequently.

Fixed: https://github.com/reticulatedpines/magiclantern_simplified/commit/09d3fddeb7f462d1dd61098e55abc1b81dd6433d

zenny

Quote from: names_are_hard on February 23, 2024, 11:44:08 PMAh, good, we have found the real error:

modules/dual_iso/../html2text.py:630: SyntaxWarning: invalid escape sequence '\s'
  data = re.sub('\s+', ' ', data)

You are using a version of Python too modern for the build system.  A change in 3.12 has introduced this error:
https://docs.python.org/3/whatsnew/3.12.html
A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning,
instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning
 ("\d" is an invalid escape sequence, use raw strings for regular expression:
 re.compile(r"\d+\.\d+")). In a future Python version, SyntaxError will eventually be raised,
 instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

Using a bleeding edge distro for doing builds may not be a good idea, you'll hit these kinds of problems fairly frequently.

Fixed: https://github.com/reticulatedpines/magiclantern_simplified/commit/09d3fddeb7f462d1dd61098e55abc1b81dd6433d


Didn't go well at all. Is there a binary of cr2hdr that works? Else I have to create a ubuntu vm to build the binary.

Which version of ubuntu is ideal to use? (\22.04? 16.04? 64-bit? 32-bit?

Thanks!

names_are_hard

Quote from: zenny on February 24, 2024, 07:17:02 AMDidn't go well at all

I need more info than that in order to fix it :)

You've helped me find one real problem, which is now fixed for everyone.  If there are more problems remaining, we can fix those too.  This helps everyone who uses ML.

I have a binary that works for me, but that doesn't mean it will work on your system, because it's designed to load the libraries it was built against.  Yours will differ.  Sometimes this works, sometimes it doesn't.

zenny

Quote from: names_are_hard on February 24, 2024, 07:44:32 AMI need more info than that in order to fix it :)

You've helped me find one real problem, which is now fixed for everyone.  If there are more problems remaining, we can fix those too.  This helps everyone who uses ML.

I have a binary that works for me, but that doesn't mean it will work on your system, because it's designed to load the libraries it was built against.  Yours will differ.  Sometimes this works, sometimes it doesn't.

Thanks for your pro bono intention. Here comes the next iteration of error:

$ make cr2hdr
Using /usr/bin/arm-none-eabi-gcc (from PATH).
[ gcc      ]   cr2hdr
cr2hdr.c:59:1: warning: return type defaults to 'int' [-Wimplicit-int]
   59 | MODULE_STRINGS()
      | ^~~~~~~~~~~~~~
cr2hdr.c: In function 'MODULE_STRINGS':
cr2hdr.c:63:1: error: parameter 'interp_method' is initialized
   63 | int interp_method = 0;          /* 0:amaze-edge, 1:mean23 */
      | ^~~
cr2hdr.c:64:1: error: parameter 'chroma_smooth_method' is initialized
   64 | int chroma_smooth_method = 2;
      | ^~~
cr2hdr.c:65:1: error: parameter 'fix_pink_dots' is initialized
   65 | int fix_pink_dots = 0;
      | ^~~
cr2hdr.c:66:1: error: parameter 'fix_bad_pixels' is initialized
   66 | int fix_bad_pixels = 1;
      | ^~~
cr2hdr.c:67:1: error: parameter 'use_fullres' is initialized
   67 | int use_fullres = 1;
      | ^~~
cr2hdr.c:68:1: error: parameter 'use_alias_map' is initialized
   68 | int use_alias_map = 1;
      | ^~~
cr2hdr.c:69:1: error: parameter 'use_stripe_fix' is initialized
   69 | int use_stripe_fix = 1;
      | ^~~
cr2hdr.c:70:1: error: parameter 'soft_film_ev' is initialized
   70 | float soft_film_ev = 0;
      | ^~~~~
cr2hdr.c:72:1: error: parameter 'exif_wb' is initialized
   72 | int exif_wb = 0;
      | ^~~
cr2hdr.c:73:1: error: parameter 'custom_wb' is initialized
   73 | float custom_wb[3] = {0, 0, 0};
      | ^~~~~
cr2hdr.c:73:22: error: variable-sized object may not be initialized except with an empty initializer
   73 | float custom_wb[3] = {0, 0, 0};
      |                      ^
cr2hdr.c:73:26: warning: excess elements in scalar initializer
   73 | float custom_wb[3] = {0, 0, 0};
      |                          ^
cr2hdr.c:73:26: note: (near initialization for 'custom_wb')
cr2hdr.c:73:29: warning: excess elements in scalar initializer
   73 | float custom_wb[3] = {0, 0, 0};
      |                             ^
cr2hdr.c:73:29: note: (near initialization for 'custom_wb')
cr2hdr.c:74:1: error: parameter 'debug_wb' is initialized
   74 | int debug_wb = 0;
      | ^~~
cr2hdr.c:78:1: error: parameter 'gray_wb' is initialized
   78 | int gray_wb = WB_GRAY_MAX;
      | ^~~
cr2hdr.c:80:1: error: parameter 'debug_black' is initialized
   80 | int debug_black = 0;
      | ^~~
cr2hdr.c:81:1: error: parameter 'debug_blend' is initialized
   81 | int debug_blend = 0;
      | ^~~
cr2hdr.c:82:1: error: parameter 'debug_amaze' is initialized
   82 | int debug_amaze = 0;
      | ^~~
cr2hdr.c:83:1: error: parameter 'debug_edge' is initialized
   83 | int debug_edge = 0;
      | ^~~
cr2hdr.c:84:1: error: parameter 'debug_alias' is initialized
   84 | int debug_alias = 0;
      | ^~~
cr2hdr.c:85:1: error: parameter 'debug_bad_pixels' is initialized
   85 | int debug_bad_pixels = 0;
      | ^~~
cr2hdr.c:86:1: error: parameter 'debug_rggb' is initialized
   86 | int debug_rggb = 0;
      | ^~~
cr2hdr.c:87:1: error: parameter 'debug_bddb' is initialized
   87 | int debug_bddb = 0;
      | ^~~
cr2hdr.c:88:1: error: parameter 'plot_iso_curve' is initialized
   88 | int plot_iso_curve = 0;
      | ^~~
cr2hdr.c:89:1: error: parameter 'plot_mix_curve' is initialized
   89 | int plot_mix_curve = 0;
      | ^~~
cr2hdr.c:90:1: error: parameter 'plot_fullres_curve' is initialized
   90 | int plot_fullres_curve = 0;
      | ^~~
cr2hdr.c:92:1: error: parameter 'compress' is initialized
   92 | int compress = 0;
      | ^~~
cr2hdr.c:93:1: error: parameter 'same_levels' is initialized
   93 | int same_levels = 0;
      | ^~~
cr2hdr.c:94:1: error: parameter 'skip_existing' is initialized
   94 | int skip_existing = 0;
      | ^~~
cr2hdr.c:95:1: error: parameter 'embed_original' is initialized
   95 | int embed_original = 0;
      | ^~~
cr2hdr.c:97:1: error: parameter 'shortcut_fast' is initialized
   97 | int shortcut_fast = 0;
      | ^~~
cr2hdr.c:100:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  100 | {
      | ^
cr2hdr.c:113:1: warning: empty declaration
  113 | struct cmd_option
      | ^~~~~~
cr2hdr.c:123:1: warning: empty declaration
  123 | struct cmd_group
      | ^~~~~~
cr2hdr.c:130:8: error: parameter 'options' is initialized
  130 | struct cmd_group options[] = {
      |        ^~~~~~~~~
cr2hdr.c:130:30: error: variable-sized object may not be initialized except with an empty initializer
  130 | struct cmd_group options[] = {
      |                              ^
cr2hdr.c:131:5: warning: braces around scalar initializer
  131 |     {
      |     ^
cr2hdr.c:131:5: note: (near initialization for 'options')
cr2hdr.c:132:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  132 |         "Shortcuts", (struct cmd_option []) {
      |         ^~~~~~~~~~~
cr2hdr.c:132:9: note: (near initialization for 'options')
cr2hdr.c:132:22: warning: excess elements in scalar initializer
  132 |         "Shortcuts", (struct cmd_option []) {
      |                      ^
cr2hdr.c:132:22: note: (near initialization for 'options')
cr2hdr.c:138:5: warning: braces around scalar initializer
  138 |     {
      |     ^
cr2hdr.c:138:5: note: (near initialization for 'options')
cr2hdr.c:139:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  139 |         "Interpolation methods", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:139:9: note: (near initialization for 'options')
cr2hdr.c:139:34: warning: excess elements in scalar initializer
  139 |         "Interpolation methods", (struct cmd_option[]) {
      |                                  ^
cr2hdr.c:139:34: note: (near initialization for 'options')
cr2hdr.c:138:5: warning: excess elements in scalar initializer
  138 |     {
      |     ^
cr2hdr.c:138:5: note: (near initialization for 'options')
cr2hdr.c:145:5: warning: braces around scalar initializer
  145 |     {
      |     ^
cr2hdr.c:145:5: note: (near initialization for 'options')
cr2hdr.c:146:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  146 |         "Chroma smoothing", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~
cr2hdr.c:146:9: note: (near initialization for 'options')
cr2hdr.c:146:29: warning: excess elements in scalar initializer
  146 |         "Chroma smoothing", (struct cmd_option[]) {
      |                             ^
cr2hdr.c:146:29: note: (near initialization for 'options')
cr2hdr.c:145:5: warning: excess elements in scalar initializer
  145 |     {
      |     ^
cr2hdr.c:145:5: note: (near initialization for 'options')
cr2hdr.c:154:5: warning: braces around scalar initializer
  154 |     {
      |     ^
cr2hdr.c:154:5: note: (near initialization for 'options')
cr2hdr.c:155:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  155 |         "Bad pixel handling", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~
cr2hdr.c:155:9: note: (near initialization for 'options')
cr2hdr.c:155:31: warning: excess elements in scalar initializer
  155 |         "Bad pixel handling", (struct cmd_option[]) {
      |                               ^
cr2hdr.c:155:31: note: (near initialization for 'options')
cr2hdr.c:154:5: warning: excess elements in scalar initializer
  154 |     {
      |     ^
cr2hdr.c:154:5: note: (near initialization for 'options')
cr2hdr.c:164:5: warning: braces around scalar initializer
  164 |     {
      |     ^
cr2hdr.c:164:5: note: (near initialization for 'options')
cr2hdr.c:165:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  165 |         "Highlight/shadow handling", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:165:9: note: (near initialization for 'options')
cr2hdr.c:165:38: warning: excess elements in scalar initializer
  165 |         "Highlight/shadow handling", (struct cmd_option[]) {
      |                                      ^
cr2hdr.c:165:38: note: (near initialization for 'options')
cr2hdr.c:164:5: warning: excess elements in scalar initializer
  164 |     {
      |     ^
cr2hdr.c:164:5: note: (near initialization for 'options')
cr2hdr.c:171:5: warning: braces around scalar initializer
  171 |     {
      |     ^
cr2hdr.c:171:5: note: (near initialization for 'options')
cr2hdr.c:172:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  172 |         "White balance", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~
cr2hdr.c:172:9: note: (near initialization for 'options')
cr2hdr.c:172:26: warning: excess elements in scalar initializer
  172 |         "White balance", (struct cmd_option[]) {
      |                          ^
cr2hdr.c:172:26: note: (near initialization for 'options')
cr2hdr.c:171:5: warning: excess elements in scalar initializer
  171 |     {
      |     ^
cr2hdr.c:171:5: note: (near initialization for 'options')
cr2hdr.c:180:5: warning: braces around scalar initializer
  180 |     {
      |     ^
cr2hdr.c:180:5: note: (near initialization for 'options')
cr2hdr.c:181:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  181 |         "Other postprocessing steps", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:181:9: note: (near initialization for 'options')
cr2hdr.c:181:39: warning: excess elements in scalar initializer
  181 |         "Other postprocessing steps", (struct cmd_option[]) {
      |                                       ^
cr2hdr.c:181:39: note: (near initialization for 'options')
cr2hdr.c:180:5: warning: excess elements in scalar initializer
  180 |     {
      |     ^
cr2hdr.c:180:5: note: (near initialization for 'options')
cr2hdr.c:191:5: warning: braces around scalar initializer
  191 |     {
      |     ^
cr2hdr.c:191:5: note: (near initialization for 'options')
cr2hdr.c:192:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  192 |         "Flicker handling", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~
cr2hdr.c:192:9: note: (near initialization for 'options')
cr2hdr.c:192:29: warning: excess elements in scalar initializer
  192 |         "Flicker handling", (struct cmd_option[]) {
      |                             ^
cr2hdr.c:192:29: note: (near initialization for 'options')
cr2hdr.c:191:5: warning: excess elements in scalar initializer
  191 |     {
      |     ^
cr2hdr.c:191:5: note: (near initialization for 'options')
cr2hdr.c:200:5: warning: braces around scalar initializer
  200 |     {
      |     ^
cr2hdr.c:200:5: note: (near initialization for 'options')
cr2hdr.c:201:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  201 |         "DNG compression (requires Adobe DNG Converter)", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:201:9: note: (near initialization for 'options')
cr2hdr.c:201:59: warning: excess elements in scalar initializer
  201 |         "DNG compression (requires Adobe DNG Converter)", (struct cmd_option[]) {
      |                                                           ^
cr2hdr.c:201:59: note: (near initialization for 'options')
cr2hdr.c:200:5: warning: excess elements in scalar initializer
  200 |     {
      |     ^
cr2hdr.c:200:5: note: (near initialization for 'options')
cr2hdr.c:207:5: warning: braces around scalar initializer
  207 |     {
      |     ^
cr2hdr.c:207:5: note: (near initialization for 'options')
cr2hdr.c:208:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  208 |         "Misc settings", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~
cr2hdr.c:208:9: note: (near initialization for 'options')
cr2hdr.c:208:26: warning: excess elements in scalar initializer
  208 |         "Misc settings", (struct cmd_option[]) {
      |                          ^
cr2hdr.c:208:26: note: (near initialization for 'options')
cr2hdr.c:207:5: warning: excess elements in scalar initializer
  207 |     {
      |     ^
cr2hdr.c:207:5: note: (near initialization for 'options')
cr2hdr.c:219:5: warning: braces around scalar initializer
  219 |     {
      |     ^
cr2hdr.c:219:5: note: (near initialization for 'options')
cr2hdr.c:220:9: warning: initialization of 'struct cmd_group *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
  220 |         "Troubleshooting options", (struct cmd_option[]) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:220:9: note: (near initialization for 'options')
cr2hdr.c:220:36: warning: excess elements in scalar initializer
  220 |         "Troubleshooting options", (struct cmd_option[]) {
      |                                    ^
cr2hdr.c:220:36: note: (near initialization for 'options')
cr2hdr.c:219:5: warning: excess elements in scalar initializer
  219 |     {
      |     ^
cr2hdr.c:219:5: note: (near initialization for 'options')
cr2hdr.c:241:5: warning: braces around scalar initializer
  241 |     OPTION_GROUP_EOL
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:241:5: note: (near initialization for 'options')
cr2hdr.c:128:31: warning: excess elements in scalar initializer
  128 | #define OPTION_GROUP_EOL { 0, 0 }
      |                               ^
cr2hdr.c:241:5: note: in expansion of macro 'OPTION_GROUP_EOL'
  241 |     OPTION_GROUP_EOL
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:128:31: note: (near initialization for 'options')
  128 | #define OPTION_GROUP_EOL { 0, 0 }
      |                               ^
cr2hdr.c:241:5: note: in expansion of macro 'OPTION_GROUP_EOL'
  241 |     OPTION_GROUP_EOL
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:128:26: warning: excess elements in scalar initializer
  128 | #define OPTION_GROUP_EOL { 0, 0 }
      |                          ^
cr2hdr.c:241:5: note: in expansion of macro 'OPTION_GROUP_EOL'
  241 |     OPTION_GROUP_EOL
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:128:26: note: (near initialization for 'options')
  128 | #define OPTION_GROUP_EOL { 0, 0 }
      |                          ^
cr2hdr.c:241:5: note: in expansion of macro 'OPTION_GROUP_EOL'
  241 |     OPTION_GROUP_EOL
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:246:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  246 | {
      | ^
cr2hdr.c:255:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  255 | {
      | ^
cr2hdr.c:288:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  288 | {
      | ^
cr2hdr.c:320:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  320 | {
      | ^
cr2hdr.c:357:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  357 | {
      | ^
cr2hdr.c:374:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  374 | {
      | ^
cr2hdr.c:380:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  380 | {
      | ^
cr2hdr.c:414:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  414 | {
      | ^
cr2hdr.c:448:8: error: parameter 'raw_info' is initialized
  448 | struct raw_info raw_info = {
      |        ^~~~~~~~
cr2hdr.c:457:12: error: storage class specified for parameter 'hdr_check'
  457 | static int hdr_check();
      |            ^~~~~~~~~
cr2hdr.c:458:12: error: storage class specified for parameter 'hdr_interpolate'
  458 | static int hdr_interpolate();
      |            ^~~~~~~~~~~~~~~
cr2hdr.c:459:12: error: storage class specified for parameter 'black_subtract'
  459 | static int black_subtract(int left_margin, int top_margin);
      |            ^~~~~~~~~~~~~~
cr2hdr.c:460:12: error: storage class specified for parameter 'black_subtract_simple'
  460 | static int black_subtract_simple(int left_margin, int top_margin);
      |            ^~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:461:13: error: storage class specified for parameter 'white_detect'
  461 | static void white_detect(int* white_dark, int* white_bright);
      |             ^~~~~~~~~~~~
cr2hdr.c:462:13: error: storage class specified for parameter 'white_balance_gray'
  462 | static void white_balance_gray(float* red_balance, float* blue_balance, int method);
      |             ^~~~~~~~~~~~~~~~~~
cr2hdr.c:465:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  465 | {
      | ^
cr2hdr.c:472:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  472 | {
      | ^
cr2hdr.c:478:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  478 | {
      | ^
cr2hdr.c:485:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  485 | {
      | ^
cr2hdr.c:491:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  491 | {
      | ^
cr2hdr.c:498:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  498 | {
      | ^
cr2hdr.c:503:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  503 | int raw_get_pixel(int x, int y) {
      |                                 ^
cr2hdr.c:508:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  508 | int raw_get_pixel_14to16(int x, int y) {
      |                                        ^
cr2hdr.c:513:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  513 | int raw_get_pixel_14to20(int x, int y) {
      |                                        ^
cr2hdr.c:518:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  518 | int raw_get_pixel_20to16(int x, int y) {
      |                                        ^
cr2hdr.c:522:52: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  522 | void raw_set_pixel_20to16(int x, int y, int value) {
      |                                                    ^
cr2hdr.c:526:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  526 | void raw_set_pixel_20to16_rand(int x, int y, int value) {
      |                                                         ^
cr2hdr.c:533:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  533 | {
      | ^
cr2hdr.c:545:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  545 | {
      | ^
cr2hdr.c:557:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  557 | {
      | ^
cr2hdr.c:571:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  571 | {
      | ^
cr2hdr.c:920:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  920 | {
      | ^
cr2hdr.c:970:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  970 | {
      | ^
cr2hdr.c:1174:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1174 | {
      | ^
cr2hdr.c:1207:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1207 | {
      | ^
cr2hdr.c:1247:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1247 | {
      | ^
cr2hdr.c:1286:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1286 | {
      | ^
cr2hdr.c:1358:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1358 | {
      | ^
cr2hdr.c:1539:12: error: storage class specified for parameter 'mean2'
 1539 | static int mean2(int a, int b, int white, int* err);
      |            ^~~~~
cr2hdr.c:1542:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1542 | {
      | ^
cr2hdr.c:1799:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1799 | {
      | ^
cr2hdr.c:1815:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1815 | {
      | ^
In file included from cr2hdr.c:1831:
chroma_smooth.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   19 | {
      | ^
In file included from cr2hdr.c:1835:
chroma_smooth.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   19 | {
      | ^
In file included from cr2hdr.c:1839:
chroma_smooth.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   19 | {
      | ^
cr2hdr.c:1843:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1843 | {
      | ^
cr2hdr.c:1859:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1859 | {
      | ^
cr2hdr.c:1869:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1869 | {
      | ^
cr2hdr.c:1983:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 1983 | {
      | ^
cr2hdr.c:2000:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 2000 | {
      | ^
cr2hdr.c:2008:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 2008 | {
      | ^
cr2hdr.c:3360:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 3360 | {
      | ^
cr2hdr.c:3388:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 3388 | {
      | ^
cr2hdr.c:1539:12: error: declaration for parameter 'mean2' but no such parameter
 1539 | static int mean2(int a, int b, int white, int* err);
      |            ^~~~~
cr2hdr.c:462:13: error: declaration for parameter 'white_balance_gray' but no such parameter
  462 | static void white_balance_gray(float* red_balance, float* blue_balance, int method);
      |             ^~~~~~~~~~~~~~~~~~
cr2hdr.c:461:13: error: declaration for parameter 'white_detect' but no such parameter
  461 | static void white_detect(int* white_dark, int* white_bright);
      |             ^~~~~~~~~~~~
cr2hdr.c:460:12: error: declaration for parameter 'black_subtract_simple' but no such parameter
  460 | static int black_subtract_simple(int left_margin, int top_margin);
      |            ^~~~~~~~~~~~~~~~~~~~~
cr2hdr.c:459:12: error: declaration for parameter 'black_subtract' but no such parameter
  459 | static int black_subtract(int left_margin, int top_margin);
      |            ^~~~~~~~~~~~~~
cr2hdr.c:458:12: error: declaration for parameter 'hdr_interpolate' but no such parameter
  458 | static int hdr_interpolate();
      |            ^~~~~~~~~~~~~~~
cr2hdr.c:457:12: error: declaration for parameter 'hdr_check' but no such parameter
  457 | static int hdr_check();
      |            ^~~~~~~~~
cr2hdr.c:448:17: error: declaration for parameter 'raw_info' but no such parameter
  448 | struct raw_info raw_info = {
      |                 ^~~~~~~~
cr2hdr.c:130:18: error: declaration for parameter 'options' but no such parameter
  130 | struct cmd_group options[] = {
      |                  ^~~~~~~
cr2hdr.c:97:5: error: declaration for parameter 'shortcut_fast' but no such parameter
   97 | int shortcut_fast = 0;
      |     ^~~~~~~~~~~~~
cr2hdr.c:95:5: error: declaration for parameter 'embed_original' but no such parameter
   95 | int embed_original = 0;
      |     ^~~~~~~~~~~~~~
cr2hdr.c:94:5: error: declaration for parameter 'skip_existing' but no such parameter
   94 | int skip_existing = 0;
      |     ^~~~~~~~~~~~~
cr2hdr.c:93:5: error: declaration for parameter 'same_levels' but no such parameter
   93 | int same_levels = 0;
      |     ^~~~~~~~~~~
cr2hdr.c:92:5: error: declaration for parameter 'compress' but no such parameter
   92 | int compress = 0;
      |     ^~~~~~~~
cr2hdr.c:90:5: error: declaration for parameter 'plot_fullres_curve' but no such parameter
   90 | int plot_fullres_curve = 0;
      |     ^~~~~~~~~~~~~~~~~~
cr2hdr.c:89:5: error: declaration for parameter 'plot_mix_curve' but no such parameter
   89 | int plot_mix_curve = 0;
      |     ^~~~~~~~~~~~~~
cr2hdr.c:88:5: error: declaration for parameter 'plot_iso_curve' but no such parameter
   88 | int plot_iso_curve = 0;
      |     ^~~~~~~~~~~~~~
cr2hdr.c:87:5: error: declaration for parameter 'debug_bddb' but no such parameter
   87 | int debug_bddb = 0;
      |     ^~~~~~~~~~
cr2hdr.c:86:5: error: declaration for parameter 'debug_rggb' but no such parameter
   86 | int debug_rggb = 0;
      |     ^~~~~~~~~~
cr2hdr.c:85:5: error: declaration for parameter 'debug_bad_pixels' but no such parameter
   85 | int debug_bad_pixels = 0;
      |     ^~~~~~~~~~~~~~~~
cr2hdr.c:84:5: error: declaration for parameter 'debug_alias' but no such parameter
   84 | int debug_alias = 0;
      |     ^~~~~~~~~~~
cr2hdr.c:83:5: error: declaration for parameter 'debug_edge' but no such parameter
   83 | int debug_edge = 0;
      |     ^~~~~~~~~~
cr2hdr.c:82:5: error: declaration for parameter 'debug_amaze' but no such parameter
   82 | int debug_amaze = 0;
      |     ^~~~~~~~~~~
cr2hdr.c:81:5: error: declaration for parameter 'debug_blend' but no such parameter
   81 | int debug_blend = 0;
      |     ^~~~~~~~~~~
cr2hdr.c:80:5: error: declaration for parameter 'debug_black' but no such parameter
   80 | int debug_black = 0;
      |     ^~~~~~~~~~~
cr2hdr.c:78:5: error: declaration for parameter 'gray_wb' but no such parameter
   78 | int gray_wb = WB_GRAY_MAX;
      |     ^~~~~~~
cr2hdr.c:74:5: error: declaration for parameter 'debug_wb' but no such parameter
   74 | int debug_wb = 0;
      |     ^~~~~~~~
cr2hdr.c:73:7: error: declaration for parameter 'custom_wb' but no such parameter
   73 | float custom_wb[3] = {0, 0, 0};
      |       ^~~~~~~~~
cr2hdr.c:72:5: error: declaration for parameter 'exif_wb' but no such parameter
   72 | int exif_wb = 0;
      |     ^~~~~~~
cr2hdr.c:70:7: error: declaration for parameter 'soft_film_ev' but no such parameter
   70 | float soft_film_ev = 0;
      |       ^~~~~~~~~~~~
cr2hdr.c:69:5: error: declaration for parameter 'use_stripe_fix' but no such parameter
   69 | int use_stripe_fix = 1;
      |     ^~~~~~~~~~~~~~
cr2hdr.c:68:5: error: declaration for parameter 'use_alias_map' but no such parameter
   68 | int use_alias_map = 1;
      |     ^~~~~~~~~~~~~
cr2hdr.c:67:5: error: declaration for parameter 'use_fullres' but no such parameter
   67 | int use_fullres = 1;
      |     ^~~~~~~~~~~
cr2hdr.c:66:5: error: declaration for parameter 'fix_bad_pixels' but no such parameter
   66 | int fix_bad_pixels = 1;
      |     ^~~~~~~~~~~~~~
cr2hdr.c:65:5: error: declaration for parameter 'fix_pink_dots' but no such parameter
   65 | int fix_pink_dots = 0;
      |     ^~~~~~~~~~~~~
cr2hdr.c:64:5: error: declaration for parameter 'chroma_smooth_method' but no such parameter
   64 | int chroma_smooth_method = 2;
      |     ^~~~~~~~~~~~~~~~~~~~
cr2hdr.c:63:5: error: declaration for parameter 'interp_method' but no such parameter
   63 | int interp_method = 0;          /* 0:amaze-edge, 1:mean23 */
      |     ^~~~~~~~~~~~~
cr2hdr.c:3664: error: expected '{' at end of input
cr2hdr.c:3664: warning: control reaches end of non-void function [-Wreturn-type]
In file included from cr2hdr.c:58:
module_strings.h: At top level:
module_strings.h:10:13: warning: '__module_string_e_value' defined but not used [-Wunused-variable]
   10 | static char __module_string_e_value[] MODULE_STRINGS_SECTION = "http://www.magiclantern.fm/forum/index.php?topic=7139.0";
      |             ^~~~~~~~~~~~~~~~~~~~~~~
module_strings.h:9:13: warning: '__module_string_e_name' defined but not used [-Wunused-variable]
    9 | static char __module_string_e_name [] MODULE_STRINGS_SECTION = "Forum";
      |             ^~~~~~~~~~~~~~~~~~~~~~
module_strings.h:8:13: warning: '__module_string_d_value' defined but not used [-Wunused-variable]
    8 | static char __module_string_d_value[] MODULE_STRINGS_SECTION = "Dynamic range improvement by using two ISOs in one picture";
      |             ^~~~~~~~~~~~~~~~~~~~~~~
module_strings.h:7:13: warning: '__module_string_d_name' defined but not used [-Wunused-variable]
    7 | static char __module_string_d_name [] MODULE_STRINGS_SECTION = "Summary";
      |             ^~~~~~~~~~~~~~~~~~~~~~
module_strings.h:6:13: warning: '__module_string_c_value' defined but not used [-Wunused-variable]
    6 | static char __module_string_c_value[] MODULE_STRINGS_SECTION = "GPL";
      |             ^~~~~~~~~~~~~~~~~~~~~~~
module_strings.h:5:13: warning: '__module_string_c_name' defined but not used [-Wunused-variable]
    5 | static char __module_string_c_name [] MODULE_STRINGS_SECTION = "License";
      |             ^~~~~~~~~~~~~~~~~~~~~~
module_strings.h:4:13: warning: '__module_string_b_value' defined but not used [-Wunused-variable]
    4 | static char __module_string_b_value[] MODULE_STRINGS_SECTION = "a1ex";
      |             ^~~~~~~~~~~~~~~~~~~~~~~
module_strings.h:3:13: warning: '__module_string_b_name' defined but not used [-Wunused-variable]
    3 | static char __module_string_b_name [] MODULE_STRINGS_SECTION = "Author";
      |             ^~~~~~~~~~~~~~~~~~~~~~
module_strings.h:2:13: warning: '__module_string_a_value' defined but not used [-Wunused-variable]
    2 | static char __module_string_a_value[] MODULE_STRINGS_SECTION = "Dual ISO";
      |             ^~~~~~~~~~~~~~~~~~~~~~~
module_strings.h:1:13: warning: '__module_string_a_name' defined but not used [-Wunused-variable]
    1 | static char __module_string_a_name [] MODULE_STRINGS_SECTION = "Name";
      |             ^~~~~~~~~~~~~~~~~~~~~~
In file included from cr2hdr.c:57:
../module_strings_wrapper.h:18:20: warning: 'module_get_string' defined but not used [-Wunused-function]
   18 | static const char* module_get_string(module_strpair_t *strings, const char* name)
      |                    ^~~~~~~~~~~~~~~~~
cr2hdr.c:29:12: warning: 'is_bright' defined but not used [-Wunused-variable]
   29 | static int is_bright[4];
      |            ^~~~~~~~~
../../src/chdk-dng.c: In function 'dng_set_camname':
../../src/chdk-dng.c:340:5: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
  340 |     strncpy(cam_name, str, sizeof(cam_name));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/chdk-dng.c: In function 'dng_set_camserial':
../../src/chdk-dng.c:345:5: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
  345 |     strncpy(cam_serial, str, sizeof(cam_serial));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/chdk-dng.c: In function 'dng_set_description':
../../src/chdk-dng.c:350:5: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
  350 |     strncpy(dng_image_desc, str, sizeof(dng_image_desc));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/chdk-dng.c: In function 'dng_set_lensmodel':
../../src/chdk-dng.c:355:5: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
  355 |     strncpy(dng_lens_model, str, sizeof(dng_lens_model));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/chdk-dng.c: In function 'dng_set_datetime':
../../src/chdk-dng.c:405:5: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation]
  405 |     strncpy(cam_datetime, datetime, sizeof(cam_datetime));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/chdk-dng.c:406:5: warning: 'strncpy' specified bound 4 equals destination size [-Wstringop-truncation]
  406 |     strncpy(cam_subsectime, subsectime, sizeof(cam_subsectime));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dcraw-bridge.c:101:3: warning: 'unique' defined but not used [-Wunused-const-variable=]
  101 | } unique[] = {
      |   ^~~~~~
In function 'verify_raw_embedding',
    inlined from 'embed_original_raw' at exiftool-bridge.c:210:10:
exiftool-bridge.c:192:13: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  192 |     if (fd) fclose(fd);
      |             ^~~~~~~~~~
exiftool-bridge.c:151:10: note: returned from 'popen'
  151 |     fd = popen(exif_cmd, "r");
      |          ^~~~~~~~~~~~~~~~~~~~
exiftool-bridge.c:192:13: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  192 |     if (fd) fclose(fd);
      |             ^~~~~~~~~~
exiftool-bridge.c:151:10: note: returned from 'popen'
  151 |     fd = popen(exif_cmd, "r");
      |          ^~~~~~~~~~~~~~~~~~~~
exiftool-bridge.c:192:13: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  192 |     if (fd) fclose(fd);
      |             ^~~~~~~~~~
exiftool-bridge.c:151:10: note: returned from 'popen'
  151 |     fd = popen(exif_cmd, "r");
      |          ^~~~~~~~~~~~~~~~~~~~
exiftool-bridge.c:192:13: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  192 |     if (fd) fclose(fd);
      |             ^~~~~~~~~~
exiftool-bridge.c:151:10: note: returned from 'popen'
  151 |     fd = popen(exif_cmd, "r");
      |          ^~~~~~~~~~~~~~~~~~~~
exiftool-bridge.c:192:13: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  192 |     if (fd) fclose(fd);
      |             ^~~~~~~~~~
exiftool-bridge.c:151:10: note: returned from 'popen'
  151 |     fd = popen(exif_cmd, "r");
      |          ^~~~~~~~~~~~~~~~~~~~
exiftool-bridge.c: In function 'dng_restore_metadata':
exiftool-bridge.c:284:60: warning: '%s' directive output may be truncated writing up to 999 bytes into a region of size 984 [-Wformat-truncation=]
  284 |     snprintf(exif_cmd, sizeof(exif_cmd), "exiftool \"-json=%s\" \"%s\" -q -overwrite_original", json_file, dng_file);
      |                                                            ^~                                   ~~~~~~~~~
exiftool-bridge.c:284:5: note: 'snprintf' output 44 or more bytes (assuming 1043) into a destination of size 1000
  284 |     snprintf(exif_cmd, sizeof(exif_cmd), "exiftool \"-json=%s\" \"%s\" -q -overwrite_original", json_file, dng_file);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adobedng-bridge.c: In function 'dng_compress':
adobedng-bridge.c:111:83: warning: '%s' directive output may be truncated writing up to 999 bytes into a region of size between 975 and 981 [-Wformat-truncation=]
  111 |     snprintf(compress_cmd, sizeof(compress_cmd), "%s\"%s\" -dng1.4 %s -o \"%s\" \"%s\"", start, adobe_dng, lossy ? "-lossy" : "", src_filename, tmp);
      |                                                                                   ^~                                                            ~~~
adobedng-bridge.c:111:5: note: 'snprintf' output 21 or more bytes (assuming 1026) into a destination of size 1000
  111 |     snprintf(compress_cmd, sizeof(compress_cmd), "%s\"%s\" -dng1.4 %s -o \"%s\" \"%s\"", start, adobe_dng, lossy ? "-lossy" : "", src_filename, tmp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile.cr2hdr:19: cr2hdr] Error 1

names_are_hard

This suggests the content of module_strings.h is bad.  Please put the file on pastebin or similar and send me the link.

zenny

Quote from: names_are_hard on February 24, 2024, 08:11:34 AMThis suggests the content of module_strings.h is bad.  Please put the file on pastebin or similar and send me the link.

Here comes the paste:
https://termbin.com/z5tn

I also checked whether it is multilib issue, yet no go as seen in the paste in:
https://termbin.com/ab4f

However, I installed lxle (based on18.04) in a vm and it went well both yours as well as Danne's. The binary worked alright in voidlinux too.

names_are_hard

From the module_strings.h file it's clear that a) it has bad content and b) where the code must stop early in order to generate that content.  I couldn't work out a reason why it might stop there, it doesn't look possible to me.

Given I can't reproduce the problem and you've given up, I will too.  I'm glad you got it working, but be warned it's likely to stop working on voidlinux; these kind of distros are likely to update some library the binary depends on in a breaking way.

zenny

Quote from: names_are_hard on February 24, 2024, 05:39:21 PMFrom the module_strings.h file it's clear that a) it has bad content

In that case, can you share me the right one or upload to github repo so that I can pull.

Quoteand b) where the code must stop early in order to generate that content.  I couldn't work out a reason why it might stop there, it doesn't look possible to me.

You know better as an avid developer. Hats off to you!

QuoteGiven I can't reproduce the problem and you've given up, I will too.

I have not given up. Just waiting for your inputs.

I tried to compile and build under platforms/EOSM.202 directory with the following error where it says there is stdin.h file

magiclantern_simplified/platform/EOSM.202 ]$ make
Using /usr/bin/arm-none-eabi-gcc (from PATH).
[ VERSION  ]   ../../platform/EOSM.202/version.bin
../../build_tools/git_summary.py >> ../../platform/EOSM.202/version.bin
[ CPP      ]   magiclantern.lds
mv tmp.lds magiclantern.lds
[ AS       ]   entry.o
[ AS       ]   ../../platform/EOSM.202/stubs.o
[ VERSION  ]   ../../platform/EOSM.202/version.c
../../build_tools/git_summary.py >> ../../platform/EOSM.202/version.c
[ CC       ]   version.o
[ CC       ]   task_utils.o
In file included from ../../src/arm-mcr.h:34,
                 from ../../src/compiler.h:59,
                 from ../../src/dryos.h:34,
                 from ../../src/task_utils.h:8,
                 from ../../src/task_utils.c:5:
/usr/lib/gcc/arm-none-eabi/9.3.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
    9 | # include_next <stdint.h>
      |                ^~~~~~~~~~
compilation terminated.
make: *** [../../Makefile.filerules:35: task_utils.o] Error 1

But the stated missing file does exist in the specified location:
$ ls -la /usr/lib/gcc/arm-none-eabi/9.3.0/include/stdint.h
-rw-r--r-- 1 root root 328 Mar 15  2020 /usr/lib/gcc/arm-none-eabi/9.3.0/include/stdint.h

Hmmm...?!

QuoteI'm glad you got it working, but be warned it's likely to stop working on voidlinux; these kind of distros are likely to update some library the binary depends on in a breaking way.


To be honest, Ubuntu broke many a times since it was first released in 2004, voidlinux has not broken in the last four years, and it is easy to compile than going for dependency hell ubuntu creates in every upgrade and the outdated software. Yet this may apply only to me. I consider generalizations are dangerous including this, imho without confirmation bias. ;-)

names_are_hard

QuoteIn that case, can you share me the right one
It's by design that module_strings.h is generated locally.  This is a slightly strange design, but that's the way it's supposed to work.  Giving you the file is not fixing the problem (and you already have the file, since you got it building on another system).

QuoteI have not given up. Just waiting for your inputs.
The problem here is that I want to fix this new error, but I can't reproduce it and don't have the time to install voidlinux and then hope I get the same broken config as you.  If you can determine the cause, I will fix it.

Quotevoidlinux has not broken in the last four years
I have nothing against bleeding edge distros - but I know from many years of experience that they are bad choices as build environments.  You will run into all kinds of difficulties due to cutting edge tools or libraries.  Essentially, you are asking me to support voidlinux as a build environment, and I don't want to, because I know it's going to cost me lots of effort for minimal gain.  You're choosing to use the weird environment, you have the responsibility to understand it.  I use Debian Testing or Stable.  For dev work, boring is good.

Personally I wouldn't recommend Ubuntu as a dev env, either, it's designed more for consumer usage.  Probably easier to get working than voidlinux though :)

The M build errors should go in a separate thread (you're missing some dev lib, possibly libc6-dev).

Danne

On mac often solved with installing pip, several versions:
https://www.magiclantern.fm/forum/index.php?topic=21882.msg227514#msg227514

Then if not working creating a Makefile.user script in root folder. Mine look like this and working in releveant parts.
#
# Host compiler settings
#
HOST_CC=gcc
HOST_LD=gcc
HOST_AR=$(shell which ar)

I am on this branch when building cr2hdr
https://bitbucket.org/Dannephoto/magic-lantern_jip_hop_git/src/master/