Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use newer openjpeg2 #627

Open
sanjayankur31 opened this issue Apr 19, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@sanjayankur31
Copy link
Contributor

commented Apr 19, 2019

VXL does not build with newer versions of openjpeg2. As also noted here: #465 (comment)

With libopenjpeg2-2.3, one gets errors of this type:

BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'bool vil_openjpeg_decoder::init_stream(void*)':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:259:49: error: too few arguments to function 'void opj_stream_set_user_data(void**, void*, opj_stream_free_user_data_fn)'
BUILDSTDERR:   259 |   opj_stream_set_user_data(this->stream_, stream);
BUILDSTDERR:       |                                                 ^
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1195:27: note: declared here
BUILDSTDERR:  1195 | OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
BUILDSTDERR:       |                           ^~~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:261:54: warning: invalid conversion from 'vxl_uint_32 (*)(void*, vxl_uint_32, void*)' {aka 'unsigned int (*)(void*, unsigned int, void*)'} to 'opj_stream_read_fn' {aka 'long unsigned int (*)(void*, long unsigned int, void*)'} [-fpermissive]
BUILDSTDERR:   261 |                                vil_openjpeg_decoder::opj_vil_stream_read);
BUILDSTDERR:       |                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
BUILDSTDERR:       |                                                      |
BUILDSTDERR:       |                                                      vxl_uint_32 (*)(void*, vxl_uint_32, void*) {aka unsigned int (*)(void*, unsigned int, void*)}
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1162:28: note:   initializing argument 2 of 'void opj_stream_set_read_function(void**, opj_stream_read_fn)'
BUILDSTDERR:  1162 |         opj_stream_read_fn p_function);
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:263:55: warning: invalid conversion from 'vxl_uint_32 (*)(void*, vxl_uint_32, void*)' {aka 'unsigned int (*)(void*, unsigned int, void*)'} to 'opj_stream_write_fn' {aka 'long unsigned int (*)(void*, long unsigned int, void*)'} [-fpermissive]
BUILDSTDERR:   263 |                                 vil_openjpeg_decoder::opj_vil_stream_write);
BUILDSTDERR:       |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
BUILDSTDERR:       |                                                       |
BUILDSTDERR:       |                                                       vxl_uint_32 (*)(void*, vxl_uint_32, void*) {aka unsigned int (*)(void*, unsigned int, void*)}
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1170:29: note:   initializing argument 2 of 'void opj_stream_set_write_function(void**, opj_stream_write_fn)'
BUILDSTDERR:  1170 |         opj_stream_write_fn p_function);
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:265:54: warning: invalid conversion from 'vxl_uint_32 (*)(vxl_uint_32, void*)' {aka 'unsigned int (*)(unsigned int, void*)'} to 'opj_stream_skip_fn' {aka 'long int (*)(long int, void*)'} [-fpermissive]
BUILDSTDERR:   265 |                                vil_openjpeg_decoder::opj_vil_stream_skip);
BUILDSTDERR:       |                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
BUILDSTDERR:       |                                                      |
BUILDSTDERR:       |                                                      vxl_uint_32 (*)(vxl_uint_32, void*) {aka unsigned int (*)(unsigned int, void*)}
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1178:28: note:   initializing argument 2 of 'void opj_stream_set_skip_function(void**, opj_stream_skip_fn)'
BUILDSTDERR:  1178 |         opj_stream_skip_fn p_function);
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:267:54: warning: invalid conversion from 'bool (*)(vxl_uint_32, void*)' {aka 'bool (*)(unsigned int, void*)'} to 'opj_stream_seek_fn' {aka 'int (*)(long int, void*)'} [-fpermissive]
BUILDSTDERR:   267 |                                vil_openjpeg_decoder::opj_vil_stream_seek);
BUILDSTDERR:       |                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
BUILDSTDERR:       |                                                      |
BUILDSTDERR:       |                                                      bool (*)(vxl_uint_32, void*) {aka bool (*)(unsigned int, void*)}
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1187:28: note:   initializing argument 2 of 'void opj_stream_set_seek_function(void**, opj_stream_seek_fn)'
BUILDSTDERR:  1187 |         opj_stream_seek_fn p_function);
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'bool vil_openjpeg_decoder::read_header()':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:323:26: warning: invalid conversion from 'opj_image_t**' {aka 'opj_image**'} to 'void**' [-fpermissive]
BUILDSTDERR:   323 |                          &this->image_,
BUILDSTDERR:       |                          ^~~~~~~~~~~~~
BUILDSTDERR:       |                          |
BUILDSTDERR:       |                          opj_image_t** {aka opj_image**}
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:324:26: error: cannot convert 'vxl_int_32*' {aka 'int*'} to 'opj_image_t**' {aka 'opj_image**'}
BUILDSTDERR:   324 |                          &this->header_.x0_,
BUILDSTDERR:       |                          ^~~~~~~~~~~~~~~~~~
BUILDSTDERR:       |                          |
BUILDSTDERR:       |                          vxl_int_32* {aka int*}
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1341:23: note:   initializing argument 3 of 'OPJ_BOOL opj_read_header(void**, void**, opj_image_t**)'
BUILDSTDERR:  1341 |         opj_image_t **p_image);
BUILDSTDERR:       |         ~~~~~~~~~~~~~~^~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'bool vil_openjpeg_decoder::set_decode_area(unsigned int, unsigned int, unsigned int, unsigned int)':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:340:45: warning: invalid conversion from 'unsigned int' to 'opj_image_t*' {aka 'opj_image*'} [-fpermissive]
BUILDSTDERR:   340 |   return opj_set_decode_area( this->codec_, x, y, w, h ) && !this->error_;
BUILDSTDERR:       |                                             ^
BUILDSTDERR:       |                                             |
BUILDSTDERR:       |                                             unsigned int
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:340:56: error: too few arguments to function 'OPJ_BOOL opj_set_decode_area(void**, opj_image_t*, OPJ_INT32, OPJ_INT32, OPJ_INT32, OPJ_INT32)'
BUILDSTDERR:   340 |   return opj_set_decode_area( this->codec_, x, y, w, h ) && !this->error_;
BUILDSTDERR:       |                                                        ^
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1396:31: note: declared here
BUILDSTDERR:  1396 | OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area(opj_codec_t *p_codec,
BUILDSTDERR:       |                               ^~~~~~~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'opj_image_t* vil_openjpeg_decoder::decode()':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:359:48: error: too few arguments to function 'OPJ_BOOL opj_decode(void**, void**, opj_image_t*)'
BUILDSTDERR:   359 |   return opj_decode(this->codec_, this->stream_);
BUILDSTDERR:       |                                                ^
BUILDSTDERR: In file included from /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:35:
BUILDSTDERR: /usr/include/openjpeg-2.3/openjpeg.h:1409:31: note: declared here
BUILDSTDERR:  1409 | OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode(opj_codec_t *p_decompressor,
BUILDSTDERR:       |                               ^~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In constructor 'vil_openjpeg_image::vil_openjpeg_image(vil_stream*, vil_openjpeg_format)':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:508:61: error: 'CODEC_JP2' was not declared in this scope; did you mean 'OPJ_CODEC_JP2'?
BUILDSTDERR:   508 |     case VIL_OPENJPEG_JP2: this->impl_->opj_codec_format_ = CODEC_JP2; break;
BUILDSTDERR:       |                                                             ^~~~~~~~~
BUILDSTDERR:       |                                                             OPJ_CODEC_JP2
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:509:61: error: 'CODEC_JPT' was not declared in this scope; did you mean 'OPJ_CODEC_JPT'?
BUILDSTDERR:   509 |     case VIL_OPENJPEG_JPT: this->impl_->opj_codec_format_ = CODEC_JPT; break;
BUILDSTDERR:       |                                                             ^~~~~~~~~
BUILDSTDERR:       |                                                             OPJ_CODEC_JPT
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:510:61: error: 'CODEC_J2K' was not declared in this scope; did you mean 'OPJ_CODEC_J2K'?
BUILDSTDERR:   510 |     case VIL_OPENJPEG_J2K: this->impl_->opj_codec_format_ = CODEC_J2K; break;
BUILDSTDERR:       |                                                             ^~~~~~~~~
BUILDSTDERR:       |                                                             OPJ_CODEC_J2K
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'bool vil_openjpeg_image::validate_format()':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:574:8: error: 'CODEC_JP2' was not declared in this scope; did you mean 'OPJ_CODEC_JP2'?
BUILDSTDERR:   574 |   case CODEC_JP2 :
BUILDSTDERR:       |        ^~~~~~~~~
BUILDSTDERR:       |        OPJ_CODEC_JP2
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:588:8: error: 'CODEC_JPT' was not declared in this scope; did you mean 'OPJ_CODEC_JPT'?
BUILDSTDERR:   588 |   case CODEC_JPT: break; // Although supported by OpenJPEG, the JPT codec
BUILDSTDERR:       |        ^~~~~~~~~
BUILDSTDERR:       |        OPJ_CODEC_JPT
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:591:8: error: 'CODEC_J2K' was not declared in this scope; did you mean 'OPJ_CODEC_J2K'?
BUILDSTDERR:   591 |   case CODEC_J2K:
BUILDSTDERR:       |        ^~~~~~~~~
BUILDSTDERR:       |        OPJ_CODEC_J2K
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx: In member function 'virtual const char* vil_openjpeg_image::file_format() const':
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:720:10: error: 'CODEC_JP2' was not declared in this scope; did you mean 'OPJ_CODEC_JP2'?
BUILDSTDERR:   720 |     case CODEC_JP2: return "jp2";
BUILDSTDERR:       |          ^~~~~~~~~
BUILDSTDERR:       |          OPJ_CODEC_JP2
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:721:10: error: 'CODEC_JPT' was not declared in this scope; did you mean 'OPJ_CODEC_JPT'?
BUILDSTDERR:   721 |     case CODEC_JPT: return "jpt";
BUILDSTDERR:       |          ^~~~~~~~~
BUILDSTDERR:       |          OPJ_CODEC_JPT
BUILDSTDERR: /builddir/build/BUILD/vxl-2.0.2/core/vil/file_formats/vil_openjpeg.cxx:722:10: error: 'CODEC_J2K' was not declared in this scope; did you mean 'OPJ_CODEC_J2K'?
BUILDSTDERR:   722 |     case CODEC_J2K: return "j2k";
BUILDSTDERR:       |          ^~~~~~~~~
BUILDSTDERR:       |          OPJ_CODEC_J2K
BUILDSTDERR: At global scope:
BUILDSTDERR: cc1plus: warning: unrecognized command line option '-Wno-undefined-var-template'
BUILDSTDERR: make[2]: *** [core/vil/CMakeFiles/vil.dir/build.make:547: core/vil/CMakeFiles/vil.dir/file_formats/vil_openjpeg.cxx.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/vxl-2.0.2'

The current work around is to use the bundled version, but it would be nice to keep the code up to date with latest APIs. Opening this as a tracker ticket. Complete build log attached:
vxl-openjpeg-2.3.txt

@hjmjohnson

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

We would welcome a pull requests that addresses this issue. Given very limited resources for VXL, changes like this are unlikely to occur without community support.

@cenit

This comment has been minimized.

Copy link

commented May 27, 2019

@sanjayankur31 are you working on this issue? Because I am in the same situation, and in that case I'd like to share effort and not replicate anything already done

@sanjayankur31

This comment has been minimized.

Copy link
Contributor Author

commented May 27, 2019

@cenit : I've not had the time to start working on this yet. Please take it up if you can 👍

@cenit

This comment has been minimized.

Copy link

commented May 27, 2019

it will take some time, I hope not too much. I will let you know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.