Pagina 1 di 1

OpenImageIO: errori di compilazione con il supporto a LibRaw [RISOLTO]

Inviato: dom 20 dic 2020, 22:53
da gian_d
Non riesco a capire il motivo, ma la compilazione di OpenImageIO va in errore se viene lasciato (come da default) l'uso di LibRaw (metto il codice sotto). Purtroppo non posso risalire all'eventuale causa, ovvero se si tratta di un conflitto con il recente aggiornamento di LibRaw nella current o per altro.
Prima della reinstallazione della Slackware, avevo Blender e Oiio regolarmente installati. L'ultima compilazione di Oiio risale al 30 ottobre, mentre il rilascio della versione aggiornata di LibRaw nella current risale al 29 ottobre, un giorno prima. Purtroppo non ho la possibilità di verificare se la compilazione di Oiio è stata fatta con la nuova versione di LibRaw, non aggiorno tutti i giorni i pacchetti della current ma in genere con una frequenza settimanale, quindi è probabile che abbia ricompilato Oiio prima di aggiornare LibRaw.

Detto questo, non riuscendo a superare l'attuale problema ho disabilitato l'uso di LibRaw inserendo nello slackbuild il flag
-DUSE_LIBRAW=OFF \
per cmake
e la compilazione arriva a buon fine.

Codice: Seleziona tutto

[ 11%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/raw.imageio/rawinput.cpp.o
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp: In member function ‘bool OpenImageIO_v2_0::RawInput::open_raw(bool, const string&, const OpenImageIO_v2_0::ImageSpec&)’:
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:646:50: error: ‘const struct libraw_gps_info_t’ has no member named ‘longtitude’; did you mean ‘longitude’?
  646 |         add("GPS", "Longitude", other.parsed_gps.longtitude, false,
      |                                                  ^~~~~~~~~~
      |                                                  longitude
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:670:35: error: ‘const struct libraw_imgother_t’ has no member named ‘exifHumidity’
  670 |     add("Exif", "Humidity", other.exifHumidity, false, 0.0f);
      |                                   ^~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:671:35: error: ‘const struct libraw_imgother_t’ has no member named ‘exifPressure’
  671 |     add("Exif", "Pressure", other.exifPressure, false, 0.0f);
      |                                   ^~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:672:37: error: ‘const struct libraw_imgother_t’ has no member named ‘exifWaterDepth’
  672 |     add("Exif", "WaterDepth", other.exifWaterDepth, false, 0.0f);
      |                                     ^~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:673:39: error: ‘const struct libraw_imgother_t’ has no member named ‘exifAcceleration’
  673 |     add("Exif", "Acceleration", other.exifAcceleration, false, 0.0f);
      |                                       ^~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:674:48: error: ‘const struct libraw_imgother_t’ has no member named ‘exifCameraElevationAngle’
  674 |     add("Exif", "CameraElevactionAngle", other.exifCameraElevationAngle, false,
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp: In member function ‘void OpenImageIO_v2_0::RawInput::get_makernotes_olympus()’:
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:864:12: error: ‘const struct libraw_olympus_makernotes_t’ has no member named ‘OlympusCropID’
  864 |     MAKERF(OlympusCropID);
      |            ^~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:703:44: note: in definition of macro ‘MAKERF’
  703 | #define MAKERF(name) add(m_make, #name, mn.name, true)
      |                                            ^~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:865:12: error: ‘const struct libraw_olympus_makernotes_t’ has no member named ‘OlympusFrame’
  865 |     MAKERF(OlympusFrame); /* upper left XY, lower right XY */
      |            ^~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:703:44: note: in definition of macro ‘MAKERF’
  703 | #define MAKERF(name) add(m_make, #name, mn.name, true)
      |                                            ^~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:866:12: error: ‘const struct libraw_olympus_makernotes_t’ has no member named ‘OlympusSensorCalibration’; did you mean ‘SensorCalibration’?
  866 |     MAKERF(OlympusSensorCalibration);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:703:44: note: in definition of macro ‘MAKERF’
  703 | #define MAKERF(name) add(m_make, #name, mn.name, true)
      |                                            ^~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp: In member function ‘void OpenImageIO_v2_0::RawInput::get_makernotes_fuji()’:
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:941:41: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiExpoMidPointShift’; did you mean ‘ExpoMidPointShift’?
  941 |     add(m_make, "ExpoMidPointShift", mn.FujiExpoMidPointShift);
      |                                         ^~~~~~~~~~~~~~~~~~~~~
      |                                         ExpoMidPointShift
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:942:36: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiDynamicRange’; did you mean ‘AutoDynamicRange’?
  942 |     add(m_make, "DynamicRange", mn.FujiDynamicRange);
      |                                    ^~~~~~~~~~~~~~~~
      |                                    AutoDynamicRange
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:943:32: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiFilmMode’; did you mean ‘FilmMode’?
  943 |     add(m_make, "FilmMode", mn.FujiFilmMode);
      |                                ^~~~~~~~~~~~
      |                                FilmMode
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:944:43: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiDynamicRangeSetting’; did you mean ‘DynamicRangeSetting’?
  944 |     add(m_make, "DynamicRangeSetting", mn.FujiDynamicRangeSetting);
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~
      |                                           DynamicRangeSetting
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:945:47: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiDevelopmentDynamicRange’; did you mean ‘DevelopmentDynamicRange’?
  945 |     add(m_make, "DevelopmentDynamicRange", mn.FujiDevelopmentDynamicRange);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                               DevelopmentDynamicRange
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:946:40: error: ‘const struct libraw_fuji_info_t’ has no member named ‘FujiAutoDynamicRange’; did you mean ‘AutoDynamicRange’?
  946 |     add(m_make, "AutoDynamicRange", mn.FujiAutoDynamicRange);
      |                                        ^~~~~~~~~~~~~~~~~~~~
      |                                        AutoDynamicRange
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp: In member function ‘void OpenImageIO_v2_0::RawInput::get_makernotes_sony()’:
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:970:12: error: ‘const struct libraw_sony_info_t’ has no member named ‘SonyCameraType’; did you mean ‘CameraType’?
  970 |     MAKERF(SonyCameraType);
      |            ^~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:703:44: note: in definition of macro ‘MAKERF’
  703 | #define MAKERF(name) add(m_make, #name, mn.name, true)
      |                                            ^~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:979:12: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  979 |     if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
      |            ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:979:34: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  979 |     if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
      |                                  ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:980:36: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  980 |         add(m_make, "cropleft", mn.raw_crop.cleft, true);
      |                                    ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:981:35: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  981 |         add(m_make, "croptop", mn.raw_crop.ctop, true);
      |                                   ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:982:37: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  982 |         add(m_make, "cropwidth", mn.raw_crop.cwidth, true);
      |                                     ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:983:38: error: ‘const struct libraw_sony_info_t’ has no member named ‘raw_crop’
  983 |         add(m_make, "cropheight", mn.raw_crop.cheight, true);
      |                                      ^~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp: In member function ‘void OpenImageIO_v2_0::RawInput::get_lensinfo()’:
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1057:15: error: ‘const struct libraw_makernotes_lens_t’ has no member named ‘CanonFocalUnits’; did you mean ‘FocalUnits’?
 1057 |         MAKER(CanonFocalUnits, 0);
      |               ^~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:700:51: note: in definition of macro ‘MAKER’
  700 | #define MAKER(name, ignore) add(m_make, #name, mn.name, false, ignore)
      |                                                   ^~~~
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1063:42: error: ‘const struct libraw_nikonlens_t’ has no member named ‘NikonEffectiveMaxAp’; did you mean ‘EffectiveMaxAp’?
 1063 |         add(m_make, "EffectiveMaxAp", mn.NikonEffectiveMaxAp);
      |                                          ^~~~~~~~~~~~~~~~~~~
      |                                          EffectiveMaxAp
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1064:40: error: ‘const struct libraw_nikonlens_t’ has no member named ‘NikonLensIDNumber’; did you mean ‘LensIDNumber’?
 1064 |         add(m_make, "LensIDNumber", mn.NikonLensIDNumber);
      |                                        ^~~~~~~~~~~~~~~~~
      |                                        LensIDNumber
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1065:38: error: ‘const struct libraw_nikonlens_t’ has no member named ‘NikonLensFStops’; did you mean ‘LensFStops’?
 1065 |         add(m_make, "LensFStops", mn.NikonLensFStops);
      |                                      ^~~~~~~~~~~~~~~
      |                                      LensFStops
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1066:38: error: ‘const struct libraw_nikonlens_t’ has no member named ‘NikonMCUVersion’; did you mean ‘MCUVersion’?
 1066 |         add(m_make, "MCUVersion", mn.NikonMCUVersion);
      |                                      ^~~~~~~~~~~~~~~
      |                                      MCUVersion
/tmp/SBo/oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp:1067:36: error: ‘const struct libraw_nikonlens_t’ has no member named ‘NikonLensType’; did you mean ‘LensType’?
 1067 |         add(m_make, "LensType", mn.NikonLensType);
      |                                    ^~~~~~~~~~~~~
      |                                    LensType
make[2]: *** [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/build.make:1525: src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/raw.imageio/rawinput.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1906: src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

Re: OpenImageIO: errori di compilazione con il supporto a LibRaw

Inviato: dom 20 dic 2020, 23:06
da gian_d
Penso che ci sia un'incompatibilità del sorgente di Oiio con le recenti versioni di LibRaw.

In effetti quelle parole (member, da ignorante non so come chiamarli) che sono riportate negli avvisi di errore (es. CanonFocalUnits) ricorrono negli header di LibRaw 0.18.2 mentre sono assenti negli header di LibRaw 0.20.2.

A questo punto, da ignorante in C++, non so se è possibile modificare con una patch quelle parole chiave (sarebbe troppo bello per essere vero) oppure la chiave potrebbe essere questo blocco di codice riportato nel file sorgente di Oiio (rawinput.cpp):

Codice: Seleziona tutto

#if OIIO_GNUC_VERSION || OIIO_CLANG_VERSION >= 50000
// fix warnings in libraw headers: use of auto_ptr
#    pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

#if OIIO_CPLUSPLUS_VERSION >= 17                                               \
    && (OIIO_CLANG_VERSION || OIIO_APPLE_CLANG_VERSION)
// libraw uses auto_ptr, which is not in C++17 at all for clang, though
// it does seem to be for gcc. So for clang, alias it to unique_ptr.
namespace std {
template<class T> using auto_ptr = unique_ptr<T>;
}
#endif

#include <libraw/libraw.h>
#include <libraw/libraw_version.h>

Re: OpenImageIO: errori di compilazione con il supporto a LibRaw

Inviato: lun 21 dic 2020, 0:05
da gian_d
risolto applicando questa patch, adesso compila anche il sorgente rawinput.cpp

Codice: Seleziona tutto

--- oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp	2019-12-03 23:28:14.000000000 +0100
+++ oiio-Release-2.0.13-fix/src/raw.imageio/rawinput.cpp	2020-12-20 23:29:30.556780764 +0100
@@ -643,7 +643,7 @@
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 17, 0)
     if (other.parsed_gps.gpsparsed) {
         add("GPS", "Latitude", other.parsed_gps.latitude, false, 0.0f);
-        add("GPS", "Longitude", other.parsed_gps.longtitude, false,
+        add("GPS", "Longitude", other.parsed_gps.longitude, false,
             0.0f);  // N.B. wrong spelling!
         add("GPS", "TimeStamp", other.parsed_gps.gpstimestamp, false, 0.0f);
         add("GPS", "Altitude", other.parsed_gps.altitude, false, 0.0f);
@@ -667,12 +667,12 @@
     // float AmbientTemperature;
     // float BatteryTemperature;
     // float exifAmbientTemperature;
-    add("Exif", "Humidity", other.exifHumidity, false, 0.0f);
-    add("Exif", "Pressure", other.exifPressure, false, 0.0f);
-    add("Exif", "WaterDepth", other.exifWaterDepth, false, 0.0f);
-    add("Exif", "Acceleration", other.exifAcceleration, false, 0.0f);
-    add("Exif", "CameraElevactionAngle", other.exifCameraElevationAngle, false,
-        0.0f);
+    //add("Exif", "Humidity", other.exifHumidity, false, 0.0f);
+    //add("Exif", "Pressure", other.exifPressure, false, 0.0f);
+    //add("Exif", "WaterDepth", other.exifWaterDepth, false, 0.0f);
+    //add("Exif", "Acceleration", other.exifAcceleration, false, 0.0f);
+    //add("Exif", "CameraElevactionAngle", other.exifCameraElevationAngle, false,
+    //    0.0f);
     // float real_ISO;
 #endif
 
@@ -861,9 +861,9 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.olympus);
-    MAKERF(OlympusCropID);
-    MAKERF(OlympusFrame); /* upper left XY, lower right XY */
-    MAKERF(OlympusSensorCalibration);
+    //MAKERF(OlympusCropID);
+    //MAKERF(OlympusFrame); /* upper left XY, lower right XY */
+    //MAKERF(OlympusSensorCalibration);
     MAKERF(FocusMode);
     MAKERF(AutoFocus);
     MAKERF(AFPoint);
@@ -938,12 +938,12 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.fuji);
-    add(m_make, "ExpoMidPointShift", mn.FujiExpoMidPointShift);
-    add(m_make, "DynamicRange", mn.FujiDynamicRange);
-    add(m_make, "FilmMode", mn.FujiFilmMode);
-    add(m_make, "DynamicRangeSetting", mn.FujiDynamicRangeSetting);
-    add(m_make, "DevelopmentDynamicRange", mn.FujiDevelopmentDynamicRange);
-    add(m_make, "AutoDynamicRange", mn.FujiAutoDynamicRange);
+    add(m_make, "ExpoMidPointShift", mn.ExpoMidPointShift);
+    add(m_make, "DynamicRange", mn.DynamicRange);
+    add(m_make, "FilmMode", mn.FilmMode);
+    add(m_make, "DynamicRangeSetting", mn.DynamicRangeSetting);
+    add(m_make, "DevelopmentDynamicRange", mn.DevelopmentDynamicRange);
+    add(m_make, "AutoDynamicRange", mn.AutoDynamicRange);
     MAKERF(FocusMode);
     MAKERF(AFMode);
     MAKERF(FocusPixel);
@@ -967,7 +967,7 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.sony);
-    MAKERF(SonyCameraType);
+    MAKERF(CameraType);
 #endif
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 19, 0)
     // uchar Sony0x9400_version; /* 0 if not found/deciphered, 0xa, 0xb, 0xc following exiftool convention */
@@ -976,12 +976,12 @@
     // uchar Sony0x9400_SequenceLength1;
     // unsigned Sony0x9400_SequenceFileNumber;
     // uchar Sony0x9400_SequenceLength2;
-    if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
-        add(m_make, "cropleft", mn.raw_crop.cleft, true);
-        add(m_make, "croptop", mn.raw_crop.ctop, true);
-        add(m_make, "cropwidth", mn.raw_crop.cwidth, true);
-        add(m_make, "cropheight", mn.raw_crop.cheight, true);
-    }
+    //if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
+    //    add(m_make, "cropleft", mn.raw_crop.cleft, true);
+    //    add(m_make, "croptop", mn.raw_crop.ctop, true);
+    //    add(m_make, "cropwidth", mn.raw_crop.cwidth, true);
+    //    add(m_make, "cropheight", mn.raw_crop.cheight, true);
+    //}
     MAKERF(AFMicroAdjValue);
     MAKERF(AFMicroAdjOn);
     MAKER(AFMicroAdjRegisteredLenses, 0);
@@ -1054,17 +1054,17 @@
         MAKER(Adapter, 0);
         MAKER(AttachmentID, 0ULL);
         MAKER(Attachment, 0);
-        MAKER(CanonFocalUnits, 0);
+        MAKER(FocalUnits, 0);
         MAKER(FocalLengthIn35mmFormat, 0.0f);
     }
 
     if (Strutil::iequals(m_make, "Nikon")) {
         auto const& mn(m_processor->imgdata.lens.nikon);
-        add(m_make, "EffectiveMaxAp", mn.NikonEffectiveMaxAp);
-        add(m_make, "LensIDNumber", mn.NikonLensIDNumber);
-        add(m_make, "LensFStops", mn.NikonLensFStops);
-        add(m_make, "MCUVersion", mn.NikonMCUVersion);
-        add(m_make, "LensType", mn.NikonLensType);
+        add(m_make, "EffectiveMaxAp", mn.EffectiveMaxAp);
+        add(m_make, "LensIDNumber", mn.LensIDNumber);
+        add(m_make, "LensFStops", mn.LensFStops);
+        add(m_make, "MCUVersion", mn.MCUVersion);
+        add(m_make, "LensType", mn.LensType);
     }
     if (Strutil::iequals(m_make, "DNG")) {
         auto const& mn(m_processor->imgdata.lens.dng);
Sicuramente si può risolvere in modo più elegante rivedendo gli script del sorgente che rilevano la versione di LibRaw, in effetti il codice che genera gli errori è incluso in blocchi condizionali che contemplano versioni di LibRaw superiori alla 0.18, ma forse non sono aggiornati alla versione 0.20