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

Could not compile openjp2 #446

Closed
9enki opened this issue Dec 1, 2023 · 10 comments · Fixed by #449
Closed

Could not compile openjp2 #446

9enki opened this issue Dec 1, 2023 · 10 comments · Fixed by #449
Labels
A-lib Area: library C-transfer-syntax Crate: dicom-transfer-syntax-registry

Comments

@9enki
Copy link

9enki commented Dec 1, 2023

Build of 0.6.3 fails on Mac M1.

Environment

Mac Book Pro Apple M1

ProductName:		macOS
ProductVersion:       14.1.1
BuildVersion:		23B81

How to reproduce

We have created a repository with the minimum configuration to reproduce the defect. https://github.com/ikneg/dicom-rs-0-6-3-openjp2-test

On wsl2 ubuntu, the docker compose build succeeds, but fails with the above Mac configuration.

Error log

#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 112B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/rust:1.73-slim
#3 DONE 3.3s

#4 [1/4] FROM docker.io/library/rust:1.73-slim@sha256:666012b6779ebb6be2acb771b8627716662cf699502e734652c4799ae4199691
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 2.13kB done
#5 DONE 0.0s

#6 [2/4] WORKDIR /root/app
#6 CACHED

#7 [3/4] COPY . /root/app/
#7 DONE 0.1s

#8 [4/4] RUN cargo build
#8 0.293     Updating crates.io index
#8 3.160  Downloading crates ...
#8 3.914   Downloaded is_ci v1.1.1
#8 3.981   Downloaded doc-comment v0.3.3
#8 3.987   Downloaded dicom v0.6.3
#8 3.993   Downloaded color_quant v1.1.0
#8 3.999   Downloaded lebe v0.5.2
#8 4.004   Downloaded either v1.9.0
#8 4.020   Downloaded log v0.4.20
#8 4.029   Downloaded encoding-index-singlebyte v1.20141219.5
#8 4.034   Downloaded byteordered v0.6.0
#8 4.069   Downloaded simd-adler32 v0.3.7
#8 4.076   Downloaded dicom-dump v0.6.2
#8 4.078   Downloaded lazy_static v1.4.0
#8 4.222   Downloaded encoding_index_tests v0.1.4
#8 4.281   Downloaded encoding-index-korean v1.20141219.5
#8 4.372   Downloaded is-terminal v0.4.9
#8 4.413   Downloaded cfg-if v1.0.0
#8 4.441   Downloaded c2rust-bitfields v0.3.0
#8 4.459   Downloaded c2rust-bitfields-derive v0.2.1
#8 4.486   Downloaded dicom-transfer-syntax-registry v0.6.2
#8 4.496   Downloaded heck v0.4.1
#8 4.510   Downloaded inventory v0.3.13
#8 4.522   Downloaded term_size v0.3.2
#8 4.528   Downloaded adler v1.0.2
#8 4.548   Downloaded num-integer v0.1.45
#8 4.595   Downloaded encoding v0.2.33
#8 4.609   Downloaded snafu-derive v0.7.5
#8 4.613   Downloaded num-rational v0.4.1
#8 4.617   Downloaded crc32fast v1.3.2
#8 4.656   Downloaded scopeguard v1.2.0
#8 4.659   Downloaded errno v0.3.8
#8 4.663   Downloaded supports-color v2.1.0
#8 4.667   Downloaded bit_field v0.10.2
#8 4.672   Downloaded byteorder v1.5.0
#8 4.685   Downloaded crossbeam-deque v0.8.3
#8 4.688   Downloaded thiserror-impl v1.0.50
#8 4.691   Downloaded bitflags v1.3.2
#8 4.698   Downloaded bytemuck v1.14.0
#8 4.706   Downloaded lock_api v0.4.11
#8 4.742   Downloaded pin-project-lite v0.2.13
#8 4.763   Downloaded dicom-encoding v0.6.1
#8 4.767   Downloaded memoffset v0.9.0
#8 4.769   Downloaded anyhow v1.0.75
#8 4.844   Downloaded smallvec v1.11.2
#8 4.850   Downloaded encoding-index-tradchinese v1.20141219.5
#8 4.856   Downloaded tracing-attributes v0.1.27
#8 4.860   Downloaded thiserror v1.0.50
#8 4.868   Downloaded sprintf v0.1.4
#8 4.870   Downloaded spin v0.9.8
#8 4.874   Downloaded jpeg-encoder v0.6.0
#8 4.878   Downloaded crossbeam-epoch v0.9.15
#8 4.881   Downloaded safe-transmute v0.11.2
#8 4.918   Downloaded bitflags v2.4.1
#8 4.923   Downloaded autocfg v1.1.0
#8 4.926   Downloaded once_cell v1.18.0
#8 4.930   Downloaded dicom-ul v0.5.1
#8 4.940   Downloaded dicom-pixeldata v0.2.2
#8 4.951   Downloaded quote v1.0.33
#8 4.957   Downloaded dicom-object v0.6.3
#8 4.968   Downloaded num-traits v0.2.17
#8 4.995   Downloaded miniz_oxide v0.7.1
#8 4.999   Downloaded crossbeam-utils v0.8.16
#8 5.008   Downloaded half v2.2.1
#8 5.012   Downloaded fdeflate v0.3.1
#8 5.014   Downloaded proc-macro2 v1.0.70
#8 5.017   Downloaded owo-colors v4.0.0-rc.1
#8 5.028   Downloaded snafu v0.7.5
#8 5.100   Downloaded zune-inflate v0.2.54
#8 5.103   Downloaded weezl v0.1.7
#8 5.106   Downloaded unicode-ident v1.0.12
#8 5.115   Downloaded chrono v0.4.31
#8 5.191   Downloaded flume v0.11.0
#8 5.200   Downloaded dicom-parser v0.6.0
#8 5.206   Downloaded flate2 v1.0.28
#8 5.215   Downloaded tracing-core v0.1.32
#8 5.220   Downloaded tracing v0.1.40
#8 5.239   Downloaded rayon-core v1.12.0
#8 5.245   Downloaded dicom-core v0.6.3
#8 5.307   Downloaded encoding-index-japanese v1.20141219.5
#8 5.325   Downloaded png v0.17.10
#8 5.346   Downloaded encoding-index-simpchinese v1.20141219.5
#8 5.406   Downloaded itertools v0.12.0
#8 5.556   Downloaded rayon v1.8.0
#8 5.668   Downloaded syn v1.0.109
#8 5.697   Downloaded exr v1.71.0
#8 5.716   Downloaded syn v2.0.39
#8 5.732   Downloaded openjp2 v0.3.0
#8 5.759   Downloaded dicom-dictionary-std v0.6.1
#8 5.768   Downloaded image v0.24.7
#8 5.875   Downloaded rustix v0.38.26
#8 6.060   Downloaded jpeg2k v0.6.6
#8 6.171   Downloaded libc v0.2.150
#8 6.234   Downloaded jpeg-decoder v0.3.0
#8 6.437   Downloaded tiff v0.9.0
#8 6.469   Downloaded linux-raw-sys v0.4.12
#8 6.548    Compiling proc-macro2 v1.0.70
#8 6.548    Compiling unicode-ident v1.0.12
#8 6.548    Compiling autocfg v1.1.0
#8 6.548    Compiling syn v1.0.109
#8 6.549    Compiling encoding_index_tests v0.1.4
#8 6.614    Compiling crossbeam-utils v0.8.16
#8 6.645    Compiling either v1.9.0
#8 6.828    Compiling doc-comment v0.3.3
#8 6.891    Compiling num-traits v0.2.17
#8 6.910    Compiling memoffset v0.9.0
#8 6.915    Compiling crossbeam-epoch v0.9.15
#8 7.112    Compiling cfg-if v1.0.0
#8 7.115    Compiling heck v0.4.1
#8 7.149    Compiling quote v1.0.33
#8 7.334    Compiling syn v2.0.39
#8 7.425    Compiling libc v0.2.150
#8 7.606    Compiling once_cell v1.18.0
#8 7.694    Compiling scopeguard v1.2.0
#8 7.751    Compiling itertools v0.12.0
#8 7.975    Compiling chrono v0.4.31
#8 8.014    Compiling safe-transmute v0.11.2
#8 8.149    Compiling rayon-core v1.12.0
#8 8.313    Compiling smallvec v1.11.2
#8 8.437    Compiling crossbeam-deque v0.8.3
#8 8.739    Compiling encoding-index-korean v1.20141219.5
#8 8.868    Compiling encoding-index-tradchinese v1.20141219.5
#8 8.931    Compiling encoding-index-singlebyte v1.20141219.5
#8 8.939    Compiling encoding-index-japanese v1.20141219.5
#8 9.022    Compiling encoding-index-simpchinese v1.20141219.5
#8 9.041    Compiling thiserror v1.0.50
#8 9.086    Compiling byteorder v1.5.0
#8 9.143    Compiling anyhow v1.0.75
#8 9.224    Compiling byteordered v0.6.0
#8 9.275    Compiling encoding v0.2.33
#8 9.381    Compiling tracing-core v0.1.32
#8 9.841    Compiling log v0.4.20
#8 9.943    Compiling sprintf v0.1.4
#8 9.992    Compiling bitflags v1.3.2
#8 10.03    Compiling pin-project-lite v0.2.13
#8 10.07    Compiling inventory v0.3.13
#8 10.07    Compiling rayon v1.8.0
#8 10.12    Compiling snafu-derive v0.7.5
#8 10.20    Compiling c2rust-bitfields-derive v0.2.1
#8 10.34    Compiling rustix v0.38.26
#8 10.66    Compiling linux-raw-sys v0.4.12
#8 10.69    Compiling c2rust-bitfields v0.3.0
#8 10.78    Compiling openjp2 v0.3.0
#8 10.84    Compiling tracing-attributes v0.1.27
#8 11.01    Compiling thiserror-impl v1.0.50
#8 11.20 error[E0308]: mismatched types
#8 11.20     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:1717:27
#8 11.20      |
#8 11.20 1717 |   l_comment_size = strlen(l_comment) as OPJ_UINT32;
#8 11.20      |                    ------ ^^^^^^^^^ expected `*const u8`, found `*const i8`
#8 11.20      |                    |
#8 11.20      |                    arguments to this function are incorrect
#8 11.20      |
#8 11.20      = note: expected raw pointer `*const u8`
#8 11.20                 found raw pointer `*const i8`
#8 11.20 note: function defined here
#8 11.20     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:32:6
#8 11.20      |
#8 11.20 32   |   fn strlen(_: *const core::ffi::c_char) -> usize;
#8 11.20      |      ^^^^^^
#8 11.20 
#8 11.25 error[E0308]: mismatched types
#8 11.25     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:8064:7
#8 11.25      |
#8 11.25 8063 |       (*cp).comment =
#8 11.25      |       ------------- expected due to the type of this binding
#8 11.25 8064 | /       opj_malloc(strlen((*parameters).cp_comment).wrapping_add(1))
#8 11.25 8065 | |         as *mut core::ffi::c_char;
#8 11.25      | |_________________________________^ expected `*mut i8`, found `*mut u8`
#8 11.25      |
#8 11.25      = note: expected raw pointer `*mut i8`
#8 11.25                 found raw pointer `*mut u8`
#8 11.25 
#8 11.25 error[E0308]: mismatched types
#8 11.25     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:8072:12
#8 11.25      |
#8 11.25 8072 |     strcpy((*cp).comment, (*parameters).cp_comment);
#8 11.25      |     ------ ^^^^^^^^^^^^^ expected `*mut u8`, found `*mut i8`
#8 11.25      |     |
#8 11.25      |     arguments to this function are incorrect
#8 11.25      |
#8 11.25      = note: expected raw pointer `*mut u8`
#8 11.25                 found raw pointer `*mut i8`
#8 11.25 note: function defined here
#8 11.25     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:26:6
#8 11.25      |
#8 11.25 26   |   fn strcpy(_: *mut core::ffi::c_char, _: *const core::ffi::c_char) -> *mut core::ffi::c_char;
#8 11.25      |      ^^^^^^
#8 11.25 
#8 11.25 error[E0308]: mismatched types
#8 11.25     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:8078:21
#8 11.25      |
#8 11.25 8078 |     (*cp).comment = c_comment.into_raw();
#8 11.25      |     -------------   ^^^^^^^^^^^^^^^^^^^^ expected `*mut i8`, found `*mut u8`
#8 11.25      |     |
#8 11.25      |     expected due to the type of this binding
#8 11.25      |
#8 11.25      = note: expected raw pointer `*mut i8`
#8 11.25                 found raw pointer `*mut u8`
#8 11.25 
#8 11.34    Compiling jpeg-decoder v0.3.0
#8 11.41 For more information about this error, try `rustc --explain E0308`.
#8 11.44 error: could not compile `openjp2` (lib) due to 4 previous errors
#8 11.44 warning: build failed, waiting for other jobs to finish...
#8 ERROR: process "/bin/sh -c cargo build" did not complete successfully: exit code: 101
------
 > [4/4] RUN cargo build:
#8 11.20                 found raw pointer `*const i8`
#8 11.20 note: function defined here
#8 11.20     --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/j2k.rs:32:6
#8 11.20      |
#8 11.20 32   |   fn strlen(_: *const core::ffi::c_char) -> usize;
#8 11.20      |      ^^^^^^
  Compiling jpeg-decoder v0.3.0
#8 11.41 For more information about this error, try `rustc --explain E0308`.
#8 11.44 error: could not compile `openjp2` (lib) due to 4 previous errors
#8 11.44 warning: build failed, waiting for other jobs to finish...
------
failed to solve: process "/bin/sh -c cargo build" did not complete successfully: exit code: 101
@Enet4
Copy link
Owner

Enet4 commented Dec 1, 2023

Thank you for bringing this up. It appears that the current iteration of openjp2 does not work on either Windows or macOS. #432

Please check whether the same mitigation strategy in #432 works for you.

cargo build --no-default-features --features=default_windows

or

cargo build --no-default-features --features=default_windows,openjpeg-sys

@Enet4 Enet4 added A-lib Area: library C-transfer-syntax Crate: dicom-transfer-syntax-registry labels Dec 1, 2023
@9enki
Copy link
Author

9enki commented Dec 2, 2023

@Enet4 Thank you for your reply.
I have updated Cargo.toml in the sample program as follows.

[package]
name = "dicom-rs-0-6-3-openjp2-test"
version = "0.1.0"
edition = "2021"

[dependencies]
dicom = { version = "0.6.3", default-features = false, features = ["default_windows", "openjpeg-sys"] }

However, when I cargo build it, I get the following error.

error: failed to select a version for `dicom`.
    ... required by package `dicom-rs-0-6-3-openjp2-test v0.1.0 (/home/gnk/dicom-rs-0-6-3-openjp2-test)`
versions that meet the requirements `^0.6.3` (locked to 0.6.3) are: 0.6.3

the package `dicom-rs-0-6-3-openjp2-test` depends on `dicom`, with features: `default_windows` but `dicom` does not have these features.


failed to select a version for `dicom` which could resolve this conflict

@Enet4
Copy link
Owner

Enet4 commented Dec 7, 2023

Would this work?

dicom = { version = "0.6.3", default-features = false, features = ["dicom-pixeldata/default_windows", "dicom-pixeldata/openjpeg-sys"] }

Otherwise, the subdependencies can be added separately.

dicom-pixeldata = { version = "0.2.2", default-features = false, features = ["default_windows", "openjpeg-sys"] }

In any case, the plan for DICOM-rs 0.7 is to make JPEG 2000 support opt-in regardless of platform, until there is a reliable cross-platform implementation.

@alanwilter
Copy link

@9enki I didn't have any problems to compile you dummy repo on my mac (M1).

However @Enet4, my project which is very simple, I don't even need pixeldata, although compiles fine in my Mac, it is failing on Windows (directly or via cross-compiling: same error):

Full error log:
   Compiling dicom-dictionary-std v0.6.1
error: linking with `x86_64-w64-mingw32-gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/awilter/.local/share/rtx/installs/node/20/bin:/home/awilter/.local/share/rtx/installs/python/3.9.16/bin:/home/awilter/.yarn/bin:/home/awilter/.config/yarn/global/node_modules/.bin:/home/awilter/.serverless/bin:/home/awilter/.deno/bin:/usr/local/sbin:/home/awilter/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:/home/awilter/mambaforge/condabin:/home/awilter/.local/share/rtx/bin:/home/awilter/.local/share/rtx/shims:/home/awilter/.cargo/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/awilter/.local/bin:/home/awilter/.rvm/bin" VSLANG="1033" "x86_64-w64-mingw32-gcc" "-Wl,/tmp/rustcVl2rAg/list.def" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "/tmp/rustcVl2rAg/symbols.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.00.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.01.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.02.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.03.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.04.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.05.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.06.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.07.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.08.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.09.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.10.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.11.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.12.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.13.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.14.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.15.rcgu.o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.15v3xkkzy3028gsq.rcgu.o" "-L" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps" "-L" "/mnt/data/awilter/OpenSight/target/debug/deps" "-L" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-Wl,-Bstatic" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/liblog-87b49403ac687fd9.rlib" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/libsprintf-45f17ef91e4006be.rlib" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/libbitflags-8a1dae1a226261ee.rlib" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/liblibc-2e12a70676aace0e.rlib" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/libc2rust_bitfields-238519ef315be74f.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-1808f31bc755bf7b.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libpanic_unwind-191fa09dfa452b2d.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libobject-0573d51e8aa7c4f0.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libmemchr-349e51cff1f86d30.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libaddr2line-87a080ba48f31e1a.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libgimli-65ea440f1f0da3e1.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_demangle-0ca89e061aa284c8.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd_detect-42ccba0e73b01ec5.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libhashbrown-228f4b89d2b87603.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_alloc-67bf8c2b36996fbd.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libminiz_oxide-59db80f124d7c082.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libadler-7e015677398361b6.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libunwind-87c6d369137f9042.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcfg_if-0889dfb294154d2b.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-134da0ceb372d583.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-cf8680c75d531b88.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_core-430c8ff8148a7795.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-0a5a55778bdea4e0.rlib" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcompiler_builtins-55868550f1fbe4ed.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-o" "/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.dll" "-Wl,--gc-sections" "-shared" "-Wl,--out-implib=/mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/libopenjp2-d3704ccf818f8002.dll.a" "-nodefaultlibs" "/home/awilter/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o"
  = note: Warning: .drectve `-exclude-symbols:_ZN7openjp23j2k16ProgressionOrder8get_step17h91e362018e1b10a7E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23j2k33opj_j2k_convert_progression_order17ha7d98a86ad99e8f2E ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:"_ZN7openjp22t128opj_t1_clbl_decode_processor28_$u7b$$u7b$closure$u7d$$u7d$17h12dbfef1cd7e3b9dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN7openjp22t128opj_t1_cblk_encode_processor28_$u7b$$u7b$closure$u7d$$u7d$17hc12423fb105791c7E" ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:_ZN3std2io5error5Error14is_interrupted17h611a1c5a7a35d501E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h336ac28691a5e6a0E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h390b48ddc15a6bd8E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr24drop_in_place$LT$f64$GT$17h4501ebcbaeb3699cE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr24drop_in_place$LT$i32$GT$17h9e75f6f5e842bed9E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr24drop_in_place$LT$i64$GT$17hdb1cff8bd752fb9bE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr24drop_in_place$LT$u32$GT$17hc125c1ff8f45d292E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr26drop_in_place$LT$usize$GT$17ha9d76a5278a516d4E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr27drop_in_place$LT$$RF$u8$GT$17h64e1b1e626c0b9d1E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr28drop_in_place$LT$$RF$str$GT$17h2e43c076c8b3bc92E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr48drop_in_place$LT$core..str..error..Utf8Error$GT$17h4ae8e6ba2fe5c58bE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr50drop_in_place$LT$$RF$alloc..vec..Vec$LT$u8$GT$$GT$17h5d9c29a5d35f0976E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr52drop_in_place$LT$std..thread..local..AccessError$GT$17hb29c4e3db86ffafeE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr55drop_in_place$LT$$RF$core..option..Option$LT$u8$GT$$GT$17h90cf8b379844d075E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core5alloc6layout6Layout5array5inner17h5416fad597d432d4E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core6marker5FnPtr4addr17h170fb77fc32874dcE ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:_ZN4core3ffi5c_str4CStr6as_ptr17h294fb7a4843bdbd2E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3ffi5c_str4CStr8from_ptr17hd31c100eb3d3c4bfE ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17hed568c5bdd180bafE" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments16new_v1_formatted17h2a21bd8e233a383dE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments6new_v117h9ead707558bd2388E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments9new_const17h12e8138e805edc53E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core4char7methods15encode_utf8_raw17hb91b3c0486a8225eE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core4sync6atomic11AtomicUsize4load17h964538d4b8bb1681E ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:"_ZN4core3num21_$LT$impl$u20$i32$GT$3abs17ha4bdbe2884634d83E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17h6dd443a84e31d7f5E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread16opj_mutex_create17hdff46640d75c7c09E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread14opj_mutex_lock17h9f01fb6dc32eeda6E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread16opj_mutex_unlock17h52faf55c0dd53406E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread17opj_mutex_destroy17h4b46ae91074dd8b4E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread22opj_thread_pool_create17hac4fd3567f30c350E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread26opj_thread_pool_submit_job17ha433ed19ff9ba2e5E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread31opj_thread_pool_wait_completion17ha6101151000ef4a8E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp26thread32opj_thread_pool_get_thread_count17h5b018f02100edf88E ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:"_ZN51_$LT$i32$u20$as$u20$alloc..vec..is_zero..IsZero$GT$7is_zero17h76956d210cbfdfb2E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN51_$LT$u32$u20$as$u20$alloc..vec..is_zero..IsZero$GT$7is_zero17hf0466bc37fb3eaf6E" ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:_ZN3std3sys7windows16thread_local_key9StaticKey3get17h38e639b156e3ebe6E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN3std3sys7windows16thread_local_key9StaticKey3set17habab09e120155234E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3cmp5impls48_$LT$impl$u20$core..cmp..Ord$u20$for$u20$i32$GT$3cmp17h4c2ad668245b2a37E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3cmp5impls48_$LT$impl$u20$core..cmp..Ord$u20$for$u20$u32$GT$3cmp17h10224cf5e678afbdE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h37475aad69d3efe2E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core5slice6memchr12memchr_naive17he6cb92ad2b113860E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN66_$LT$core..cell..BorrowRefMut$u20$as$u20$core..ops..drop..Drop$GT$4drop17hab544ae0fe005a8dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc7opj_mqc10set_curctx17h17941037dbcab847E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc18opj_mqc_raw_decode17h49fe94b72712ee51E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc20opj_mqc_decode_macro17h24ad97c0f477a905E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc20opj_mqc_encode_macro17hc09f4afcabca258dE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc24opj_mqc_bypass_enc_macro17hb7607f9349bc952dE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc16opj_mqc_numbytes17h4762c18b1b0d43a0E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc16opj_mqc_init_enc17hd2007c4c9c1efe94E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc13opj_mqc_flush17h31d77ac8123dff60E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc23opj_mqc_bypass_init_enc17h46e197bb825e39dfE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc30opj_mqc_bypass_get_extra_bytes17h55402ba1c09d6e06E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc24opj_mqc_bypass_flush_enc17hb82631c96b074644E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc17opj_mqc_reset_enc17h4504d4ae4c992c70E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc24opj_mqc_restart_init_enc17h6eed4870d84c56ccE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc18opj_mqc_erterm_enc17h49ad6a8ae97fef59E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc19opj_mqc_segmark_enc17h62c6c43da85b238eE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc16opj_mqc_init_dec17h58aeaadd7151fc6cE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc20opj_mqc_raw_init_dec17h1a099f91ac4ad6b1E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc18opq_mqc_finish_dec17h18436de740c35797E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp23mqc19opj_mqc_resetstates17hb4c7e5e500a6f3b7E ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:"_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h98dd7bd76d64d8daE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN49_$LT$isize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h74783571588b4e78E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h5072031d3cb0336dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc3ffi5c_str7CString8into_raw17h69c6491ef5d3400bE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc3fmt6format17hc1a568dc993d0d58E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc5alloc15exchange_malloc17hb3f1ce0cf88204aeE ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h5219e14fe5e143d6E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17hfad34248b354f024E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17h6b91ed0bf1eb660dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN64_$LT$alloc..ffi..c_str..NulError$u20$as$u20$core..fmt..Debug$GT$3fmt17h58f5122fc3c0cf1fE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN68_$LT$alloc..ffi..c_str..CString$u20$as$u20$core..ops..drop..Drop$GT$4drop17h31b87cf3d190459eE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN7openjp25event13opj_event_mgr11get_handler28_$u7b$$u7b$closure$u7d$$u7d$17h404c5802b575a2b3E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN7openjp25event13opj_event_mgr11get_handler28_$u7b$$u7b$closure$u7d$$u7d$17h096c00a8a8d65749E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN7openjp25event13opj_event_mgr11get_handler28_$u7b$$u7b$closure$u7d$$u7d$17hf56c9eee1409a00aE" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math11opj_int_max17h0d7aa10e44217b94E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math11opj_int_min17hf0acac14e565e40bE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math12opj_uint_min17h8c735c93ecc37ef4E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math12opj_uint_max17h0b38ad1d8a2c7d1cE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math20opj_int_floordivpow217hb746615c9f6c5c5dE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math17opj_int_floorlog217h0519de1237afe025E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math21opj_uint_floordivpow217h968f84e18f454f4bE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math18opj_uint_floorlog217h42b280fff015225eE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math20opj_uint_ceildivpow217h2479d1b5d2ede688E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math16opj_uint_ceildiv17ha32138bae33c55e5E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math21opj_int64_ceildivpow217h3cafa5c1c61c7b24E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math15opj_int_ceildiv17ha97a6aca9413b29aE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math19opj_int_ceildivpow217h3048a9c369bc2b30E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math13opj_uint_adds17h7cfd459dbb539eb5E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math11opj_int_abs17h3f54971fc4f0f5ecE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math13opj_uint_subs17hdaa5bdc75959c317E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math10opj_lrintf17h8b1cddcb341d0efaE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math15opj_int64_clamp17h6e556f5f365549dfE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math13opj_int_clamp17h992dc3d66b99abeaE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math23opj_int_sub_no_overflow17h0166a3c1149bc364E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN7openjp24math23opj_int_add_no_overflow17hcc249b805a51bf42E ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:"_ZN109_$LT$alloc..string..String$u20$as$u20$core..ops..index..Index$LT$core..ops..range..Range$LT$usize$GT$$GT$$GT$5index17h42f85c8ce02e1177E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN113_$LT$alloc..string..String$u20$as$u20$core..ops..index..Index$LT$core..ops..range..RangeFrom$LT$usize$GT$$GT$$GT$5index17hcf43bea4fca6c5dfE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$3abs17h3aeccb93c98035a3E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$4powf17h3faf5f47de9ac46dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$5floor17hca8b10264d35f0b6E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$5log1017h542921b6ba1f587aE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$5round17h493fbe707fd7348eE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN3std3f6421_$LT$impl$u20$f64$GT$5trunc17haabe6e7a284ee50fE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17he0ae4840917f4209E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3f6421_$LT$impl$u20$f64$GT$11is_infinite17haa3c77fc3444700eE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3f6421_$LT$impl$u20$f64$GT$16is_sign_negative17h788db37b2a728697E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3f6421_$LT$impl$u20$f64$GT$9is_finite17hbfcadea3da83cca3E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments16new_v1_formatted17hd399dd536b434584E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments6new_v117h6a81118761f37bdfE ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3num21_$LT$impl$u20$i64$GT$3abs17h8565847ce0acb721E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core4char7methods15encode_utf8_raw17h521f8876bc3f3654E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core5alloc6layout6Layout5array5inner17h084fd3b8e3502cf8E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN4core5slice6memchr12memchr_naive17h20d2f97c151d8318E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$i32$GT$$u20$for$u20$usize$GT$8try_from17h53caa189b7c7ad33E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$isize$GT$$u20$for$u20$i32$GT$8try_from17h8be49d3e6edca857E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$i32$GT$8try_from17h43f025e1be50a7e8E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN5alloc3str56_$LT$impl$u20$alloc..borrow..ToOwned$u20$for$u20$str$GT$8to_owned17h0b7fd0b388cacec6E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc6string6String3len17hf59896d8457b1b24E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc6string6String3new17h65069d3fba607ecaE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc6string6String4push17hf68213661f06bd79E ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc6string6String8is_empty17h7503606ddad7063fE ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc6string6String8push_str17h01370796658ccc78E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17h26b3f12729833809E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN78_$LT$alloc..string..String$u20$as$u20$core..ops..arith..Add$LT$$RF$str$GT$$GT$3add17hac032178c8bfab7dE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcf4b432e616304e5E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$9size_hint17h0ea897b53a42b467E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN87_$LT$core..str..iter..CharIndices$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h55defec87546360fE" ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17hdd1ae084031ae784E ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3str21_$LT$impl$u20$str$GT$5chars17h45168c48975abdccE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3str21_$LT$impl$u20$str$GT$8is_empty17hdfd0fe15e78047e3E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3str6traits108_$LT$impl$u20$core..slice..index..SliceIndex$LT$str$GT$$u20$for$u20$core..ops..range..Range$LT$usize$GT$$GT$3get17hc40a051bd3f4f0a6E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3str6traits112_$LT$impl$u20$core..slice..index..SliceIndex$LT$str$GT$$u20$for$u20$core..ops..range..RangeFrom$LT$usize$GT$$GT$3get17h9587505ce44f2079E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core3str6traits112_$LT$impl$u20$core..slice..index..SliceIndex$LT$str$GT$$u20$for$u20$core..ops..range..RangeFrom$LT$usize$GT$$GT$5index17h6c5de42a38237382E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num67_$LT$impl$u20$core..convert..TryFrom$LT$i64$GT$$u20$for$u20$i32$GT$8try_from17h5293e2e5118c60dbE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num67_$LT$impl$u20$core..convert..TryFrom$LT$u32$GT$$u20$for$u20$i32$GT$8try_from17h13e45acea1af6e97E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN4core7convert3num67_$LT$impl$u20$core..convert..TryFrom$LT$u64$GT$$u20$for$u20$i32$GT$8try_from17had7c7a35ae121276E" ' unrecognized
          Warning: .drectve `-exclude-symbols:_ZN5alloc3fmt6format17h6c97b4d89b1ecb8cE ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h060f9415f5b11d3eE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h1fe44f2a0393f1d5E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$4grow17hdf2b728e14ab2082E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17hd081bce589c2f25aE" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h33144befc2e64a7dE" ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          /usr/bin/x86_64-w64-mingw32-ld: /mnt/data/awilter/OpenSight/target/x86_64-pc-windows-gnu/debug/deps/openjp2-d3704ccf818f8002.openjp2.f01b1459e2b75329-cgu.11.rcgu.o: in function `openjp2::malloc::opj_aligned_alloc_n':
          /home/awilter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openjp2-0.3.0/src/malloc.rs:75: undefined reference to `posix_memalign'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `openjp2` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Mine current Cargo.toml:

[[bin]]
name = "open-sight"
path = "src/main.rs"

[dependencies]
serde = { version = "1.0.193", features = ["derive"] }
csv = "1.3.0"
dicom = "0.6.3"
rayon = "1.8.0"
walkdir = "2.4.0"
chrono = "0.4.31"
clap = { version = "4.4.11", features = ["derive"] }

@Enet4 I tried your suggestions but (I must say I'm very new to rust):

# Cargo.toml
dicom = { version = "0.6.3", default-features = false, features = ["dicom-pixeldata/default_windows", "dicom-pixeldata/openjpeg-sys"] }

$ cargo build --target x86_64-pc-windows-gnu --no-default-features --features=default_windows

error: failed to parse manifest at `/mnt/data/awilter/OpenSight/Cargo.toml`

Caused by:
  feature `dicom-pixeldata/default_windows` in dependency `dicom` is not allowed to contain slashes
  If you want to enable features of a transitive dependency, the direct dependency needs to re-export those features from the `[features]` table.

The only piece of my code that uses dicom-rs library:

use dicom::dictionary_std::tags;
use dicom::object::OpenFileOptions;
...
fn extract_dicom_data(path: &Path) -> Result<DicomData, Box<dyn std::error::Error>> {
    let obj = OpenFileOptions::new()
        .read_until(tags::PIXEL_DATA)
        .open_file(path)?;

    let patient_id = obj.element_by_name("PatientID")?.to_str()?;
    let image_laterality = obj.element_by_name("ImageLaterality")?.to_str()?;
    let patient_sex = obj.element_by_name("PatientSex")?.to_str()?;
    let patient_dob = obj.element_by_name("PatientBirthDate")?.to_str()?;
    let content_date = obj.element_by_name("ContentDate")?.to_str()?;
    let modality = obj.element_by_name("Modality")?.to_str()?;
    let manufacturer = obj.element_by_name("Manufacturer")?.to_str()?;

    let formatted_patient_dob = format_dicom_date(&patient_dob)?;
    let formatted_content_date = format_dicom_date(&content_date)?;

    let file_path = path
        .canonicalize()?
        .to_str()
        .ok_or("Invalid file path")?
        .to_string();

    Ok(DicomData {
        patient_id: patient_id.to_string(),
        image_laterality: image_laterality.to_string(),
        patient_sex: patient_sex.to_string(),
        patient_dob: formatted_patient_dob,
        content_date: formatted_content_date,
        modality: modality.to_string(),
        manufacturer: manufacturer.to_string(),
        file_path,
    })
}

Anyway, the only way I got Windows to work was:

# Cargo.toml
dicom = { version = "0.6.3", default-features = false }

$ cargo build --target x86_64-pc-windows-gnu

cargo build --no-default-features alone is not working as I expected, it's like if Cargo.toml had priority of command arguments and this is not right IMO.

Do you have a nightly pre-build of dicom-rs v0.7 so I can test?

@Enet4
Copy link
Owner

Enet4 commented Dec 19, 2023

@alanwilter In your case you might be better served grabbing the individual library components that you need.

dicom_object = "0.6"
dicom_dictionary_std = "0.6"

Then in your code:

use dicom_dictionary_std::tags;
use dicom_object::OpenFileOptions;

Do you have a nightly pre-build of dicom-rs v0.7 so I can test?

There is no such build yet. All upstream contributions can be seen in this repository. I can follow up on this once I have some spare time and energy. In the meantime, one could contribute with a pull request to exclude openjp2 by default.

@alanwilter
Copy link

alanwilter commented Dec 19, 2023

Thanks @Enet4 that worked nicely.

BTW, I'm a python guy and sorry if I'm using the wrong channel (if you know so, please tell me), but how do I do to change extract_dicom_data() function so if element is not found (for PatientID, ImageLaterality, etc.) I still want to assign a empty string value in the end. For ImageLaterality actually, I search for Laterality as well and only defaulting to "" if neither were found (this is how I do with pydicom).
Now that I put my code to run I'm seeing lots of No such data element ImageLaterality (with tag (0020,0062)) but I still want to fill my output CSV files with empty results if needed.

@Enet4
Copy link
Owner

Enet4 commented Dec 20, 2023

@alanwilter I have moved your new question to discussions here.

@Neopallium
Copy link

FYI, I released 0.3.1 of openjp2 that should fix that compile error for non-linux platforms. Not sure why I didn't get the same error when compiling on Linux.

Update the openjp2 crate using:
cargo update -p openjp2

@Enet4
Copy link
Owner

Enet4 commented Apr 8, 2024

@Neopallium Thank you for the update to openjp2! If I may ask, are there any other plans for long-term maintainability of the crate? Without an issue tracker at the corresponding fork it may be hard to follow up on future concerns, such as updating transitive dependencies or keeping the port updated with upstream OpenJPEG.

@Neopallium
Copy link

@Enet4 I hadn't thought about the repo not having an issue tracker. I just created a new repo for openjp2: https://github.com/Neopallium/openjp2

There is still a lot of work to refactor all the unsafe Rust in openjp2 (this will be a slow long-term process). But I am happy to fix any compile issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library C-transfer-syntax Crate: dicom-transfer-syntax-registry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants