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

Rename type and trait to comply with naming guidelines #33

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

djc
Copy link
Contributor

@djc djc commented Jun 21, 2021

Suppose this is not so controversial? Thought I might help out by fixing this.

@danieldk
Copy link
Member

I don't think it controversial. It does break the existing API, but only in a shallow way, and it's better to fix this now than post-1.0.

@sebpuetz what do you think?

@djc
Copy link
Contributor Author

djc commented Jun 21, 2021

Yes, and I figured we already need an incompatible version bump for ndarray 0.15 compatibility anyway.

@sebpuetz
Copy link
Member

No objections from my side.

I think the ndarray bump to 0.15 is still blocked by ndarray-linalg

@djc
Copy link
Contributor Author

djc commented Jun 21, 2021

Yeah, I just pinged them in rust-ndarray/ndarray-linalg#281.

@djc
Copy link
Contributor Author

djc commented Jun 21, 2021

CI seems to be flaky; I noticed the same failure on #32.

@djc
Copy link
Contributor Author

djc commented Jun 21, 2021

BTW, I was unable to compile the opq tests on my machine. I got the following error:

  = note: Undefined symbols for architecture x86_64:
            "_sgesvd_", referenced from:
                lapack::sgesvd::h128296f4358af73f in liblax-02fc496e925898f8.rlib(lax-02fc496e925898f8.lax.huv9ec90-cgu.1.rcgu.o)
            "_ssyev_", referenced from:
                lapack::ssyev::h8af130078dc2d88c in liblax-02fc496e925898f8.rlib(lax-02fc496e925898f8.lax.huv9ec90-cgu.1.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

@danieldk
Copy link
Member

danieldk commented Jun 21, 2021

"_sgesvd_"

What OS and against what library does the build link? E.g.

$ cargo test --features=openblas-test -v
[...]
     Running `rustc --crate-name openblas_src --edition=2018 /home/daniel/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openblas-src-0.10.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="cblas"' --cfg 'feature="static"' -C metadata=0405d34b390c1618 -C extra-filename=-0405d34b390c1618 --out-dir /home/daniel/git/reductive/target/debug/deps -L dependency=/home/daniel/git/reductive/target/debug/deps --cap-lints allow -L /home/daniel/git/reductive/target/debug/build/openblas-src-10da8a9112df37f5/out -L /usr/lib -L /usr/lib/gcc/x86_64-redhat-linux/11 -L /usr/lib64 -L /usr/lib -L /usr/lib/gcc/x86_64-redhat-linux/11 -L /usr/lib64 -l c -l c -l gfortran -l m -l quadmath -l static=openblas`
[...]
     Running `rustc --crate-name reductive --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test --cfg 'feature="default"' --cfg 'feature="lax"' --cfg 'feature="ndarray-linalg"' --cfg 'feature="openblas-test"' --cfg 'feature="opq-train"' -C metadata=d4ec96801e8cd857 -C extra-filename=-d4ec96801e8cd857 --out-dir /home/daniel/git/reductive/target/debug/deps -C incremental=/home/daniel/git/reductive/target/debug/incremental -L dependency=/home/daniel/git/reductive/target/debug/deps --extern approx=/home/daniel/git/reductive/target/debug/deps/libapprox-ac2495e703e32152.rlib --extern lax=/home/daniel/git/reductive/target/debug/deps/liblax-3dffd4c29b2503af.rlib --extern log=/home/daniel/git/reductive/target/debug/deps/liblog-db39e649b2a772f7.rlib --extern ndarray=/home/daniel/git/reductive/target/debug/deps/libndarray-15d6204bc7216a67.rlib --extern ndarray_linalg=/home/daniel/git/reductive/target/debug/deps/libndarray_linalg-6c59e37532b4faa6.rlib --extern num_traits=/home/daniel/git/reductive/target/debug/deps/libnum_traits-482f24506107ef5a.rlib --extern ordered_float=/home/daniel/git/reductive/target/debug/deps/libordered_float-f8fd353f63149068.rlib --extern rand=/home/daniel/git/reductive/target/debug/deps/librand-7a0fb068ef617c87.rlib --extern rand_core=/home/daniel/git/reductive/target/debug/deps/librand_core-bd34cef311348859.rlib --extern rand_distr=/home/daniel/git/reductive/target/debug/deps/librand_distr-b5be34514312f8c7.rlib --extern rand_xorshift=/home/daniel/git/reductive/target/debug/deps/librand_xorshift-570e46c6823d8f5b.rlib --extern rayon=/home/daniel/git/reductive/target/debug/deps/librayon-b4e0edab8aab4b89.rlib -L /home/daniel/git/reductive/target/debug/build/openblas-src-10da8a9112df37f5/out -L /usr/lib -L /usr/lib/gcc/x86_64-redhat-linux/11 -L /usr/lib64 -L /usr/lib -L /usr/lib/gcc/x86_64-redhat-linux/11 -L /usr/lib64`

You usually get this error when it is attempted to link against an OpenBLAS library without LAPACK support built in.

@djc
Copy link
Contributor Author

djc commented Jun 21, 2021

macOS, installed openblas with brew install openblas.

    Running `rustc --crate-name reductive --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --test --cfg 'feature="default"' --cfg 'feature="lax"' --cfg 'feature="ndarray-linalg"' --cfg 'feature="openblas-test"' --cfg 'feature="opq-train"' -C metadata=4c23bec02209605b -C extra-filename=-4c23bec02209605b --out-dir /Users/djc/src/reductive/target/debug/deps -C incremental=/Users/djc/src/reductive/target/debug/incremental -L dependency=/Users/djc/src/reductive/target/debug/deps --extern approx=/Users/djc/src/reductive/target/debug/deps/libapprox-1f9753325c282a0f.rlib --extern lax=/Users/djc/src/reductive/target/debug/deps/liblax-02fc496e925898f8.rlib --extern log=/Users/djc/src/reductive/target/debug/deps/liblog-24eb42ca4b630544.rlib --extern ndarray=/Users/djc/src/reductive/target/debug/deps/libndarray-30abe304def814bc.rlib --extern ndarray_linalg=/Users/djc/src/reductive/target/debug/deps/libndarray_linalg-88f3468fec483c92.rlib --extern num_traits=/Users/djc/src/reductive/target/debug/deps/libnum_traits-fd121cdc3b74f1c5.rlib --extern ordered_float=/Users/djc/src/reductive/target/debug/deps/libordered_float-e5b7cc1beec783b3.rlib --extern rand=/Users/djc/src/reductive/target/debug/deps/librand-3e4297b278ec6a4c.rlib --extern rand_core=/Users/djc/src/reductive/target/debug/deps/librand_core-f95250847834e5d4.rlib --extern rand_distr=/Users/djc/src/reductive/target/debug/deps/librand_distr-89c58e43309b5f0a.rlib --extern rand_xorshift=/Users/djc/src/reductive/target/debug/deps/librand_xorshift-674841b489436bd6.rlib --extern rayon=/Users/djc/src/reductive/target/debug/deps/librayon-4e102dc89b945694.rlib -L /Users/djc/src/reductive/target/debug/build/openblas-src-8af2d72905961d1f/out/opt/OpenBLAS/lib`
     Running `rustc --crate-name reductive --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="lax"' --cfg 'feature="ndarray-linalg"' --cfg 'feature="openblas-test"' --cfg 'feature="opq-train"' -C metadata=9bcd1f09c9401dfe -C extra-filename=-9bcd1f09c9401dfe --out-dir /Users/djc/src/reductive/target/debug/deps -C incremental=/Users/djc/src/reductive/target/debug/incremental -L dependency=/Users/djc/src/reductive/target/debug/deps --extern lax=/Users/djc/src/reductive/target/debug/deps/liblax-02fc496e925898f8.rmeta --extern log=/Users/djc/src/reductive/target/debug/deps/liblog-24eb42ca4b630544.rmeta --extern ndarray=/Users/djc/src/reductive/target/debug/deps/libndarray-30abe304def814bc.rmeta --extern ndarray_linalg=/Users/djc/src/reductive/target/debug/deps/libndarray_linalg-88f3468fec483c92.rmeta --extern num_traits=/Users/djc/src/reductive/target/debug/deps/libnum_traits-fd121cdc3b74f1c5.rmeta --extern ordered_float=/Users/djc/src/reductive/target/debug/deps/libordered_float-e5b7cc1beec783b3.rmeta --extern rand=/Users/djc/src/reductive/target/debug/deps/librand-3e4297b278ec6a4c.rmeta --extern rand_core=/Users/djc/src/reductive/target/debug/deps/librand_core-f95250847834e5d4.rmeta --extern rand_xorshift=/Users/djc/src/reductive/target/debug/deps/librand_xorshift-674841b489436bd6.rmeta --extern rayon=/Users/djc/src/reductive/target/debug/deps/librayon-4e102dc89b945694.rmeta -L /Users/djc/src/reductive/target/debug/build/openblas-src-8af2d72905961d1f/out/opt/OpenBLAS/lib`

@danieldk
Copy link
Member

macOS, installed openblas with brew install openblas.

    Running `rustc --crate-name reductive --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --test --cfg 'feature="default"' --cfg 'feature="lax"' --cfg 'feature="ndarray-linalg"' --cfg 'feature="openblas-test"' --cfg 'feature="opq-train"' -C metadata=4c23bec02209605b -C extra-filename=-4c23bec02209605b --out-dir /Users/djc/src/reductive/target/debug/deps -C incremental=/Users/djc/src/reductive/target/debug/incremental -L dependency=/Users/djc/src/reductive/target/debug/deps --extern approx=/Users/djc/src/reductive/target/debug/deps/libapprox-1f9753325c282a0f.rlib --extern lax=/Users/djc/src/reductive/target/debug/deps/liblax-02fc496e925898f8.rlib --extern log=/Users/djc/src/reductive/target/debug/deps/liblog-24eb42ca4b630544.rlib --extern ndarray=/Users/djc/src/reductive/target/debug/deps/libndarray-30abe304def814bc.rlib --extern ndarray_linalg=/Users/djc/src/reductive/target/debug/deps/libndarray_linalg-88f3468fec483c92.rlib --extern num_traits=/Users/djc/src/reductive/target/debug/deps/libnum_traits-fd121cdc3b74f1c5.rlib --extern ordered_float=/Users/djc/src/reductive/target/debug/deps/libordered_float-e5b7cc1beec783b3.rlib --extern rand=/Users/djc/src/reductive/target/debug/deps/librand-3e4297b278ec6a4c.rlib --extern rand_core=/Users/djc/src/reductive/target/debug/deps/librand_core-f95250847834e5d4.rlib --extern rand_distr=/Users/djc/src/reductive/target/debug/deps/librand_distr-89c58e43309b5f0a.rlib --extern rand_xorshift=/Users/djc/src/reductive/target/debug/deps/librand_xorshift-674841b489436bd6.rlib --extern rayon=/Users/djc/src/reductive/target/debug/deps/librayon-4e102dc89b945694.rlib -L /Users/djc/src/reductive/target/debug/build/openblas-src-8af2d72905961d1f/out/opt/OpenBLAS/lib`
     Running `rustc --crate-name reductive --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="lax"' --cfg 'feature="ndarray-linalg"' --cfg 'feature="openblas-test"' --cfg 'feature="opq-train"' -C metadata=9bcd1f09c9401dfe -C extra-filename=-9bcd1f09c9401dfe --out-dir /Users/djc/src/reductive/target/debug/deps -C incremental=/Users/djc/src/reductive/target/debug/incremental -L dependency=/Users/djc/src/reductive/target/debug/deps --extern lax=/Users/djc/src/reductive/target/debug/deps/liblax-02fc496e925898f8.rmeta --extern log=/Users/djc/src/reductive/target/debug/deps/liblog-24eb42ca4b630544.rmeta --extern ndarray=/Users/djc/src/reductive/target/debug/deps/libndarray-30abe304def814bc.rmeta --extern ndarray_linalg=/Users/djc/src/reductive/target/debug/deps/libndarray_linalg-88f3468fec483c92.rmeta --extern num_traits=/Users/djc/src/reductive/target/debug/deps/libnum_traits-fd121cdc3b74f1c5.rmeta --extern ordered_float=/Users/djc/src/reductive/target/debug/deps/libordered_float-e5b7cc1beec783b3.rmeta --extern rand=/Users/djc/src/reductive/target/debug/deps/librand-3e4297b278ec6a4c.rmeta --extern rand_core=/Users/djc/src/reductive/target/debug/deps/librand_core-f95250847834e5d4.rmeta --extern rand_xorshift=/Users/djc/src/reductive/target/debug/deps/librand_xorshift-674841b489436bd6.rmeta --extern rayon=/Users/djc/src/reductive/target/debug/deps/librayon-4e102dc89b945694.rmeta -L /Users/djc/src/reductive/target/debug/build/openblas-src-8af2d72905961d1f/out/opt/OpenBLAS/lib`

Seems to link against the vendored OpenBLAS in openblas-src, then it's most likely that you do not have gfortran installed and as a result LAPACK is not built.

@danieldk
Copy link
Member

Looks like the lint that used to warn for this is disabled now for public items:

rust-lang/rust-clippy#6805

So, I propose that we keep the naming as-is.

@djc
Copy link
Contributor Author

djc commented Jun 23, 2021

IMO there's still substantial value in complying with the API naming guidelines. If the next release will be semver-incompatible anyway because of the ndarray bump, I'd still change the names.

@djc djc closed this Jul 26, 2021
@danieldk
Copy link
Member

I missed this, we could still do these changes for the next release.

@djc djc reopened this Jul 26, 2021
@djc
Copy link
Contributor Author

djc commented Jul 27, 2021

Rebased on master.

@danieldk danieldk merged commit 6c0f901 into finalfusion:master Nov 29, 2021
@danieldk
Copy link
Member

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants