fncnt / librna-sys Goto Github PK
View Code? Open in Web Editor NEWUnsafe low-level Rust bindings for the ViennaRNA package.
Home Page: https://crates.io/crates/librna-sys
License: Other
Unsafe low-level Rust bindings for the ViennaRNA package.
Home Page: https://crates.io/crates/librna-sys
License: Other
If you use librna-sys
as a dependency you might encounter an error similar to this:
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:~/.cargo/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:~/.dotnet/tools:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin:~/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcVe6E8r/symbols.o" "~/crate-name/target/release/deps/executable-77097ed7f3783d37.executable.acdf1c1d4c87c16c-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "~/crate-name/target/release/deps" "-L" "/usr/lib" "-L" "/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/" "-L" "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib" "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b114db70ea0690b1.rlib" "-Wl,-Bdynamic" "-lc" "-lm" "-lrt" "-lpthread" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "~/Dev/crate-name/target/release/deps/executable-77097ed7f3783d37" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs"
= note: /usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `svm_predict_values._omp_fn.0':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2610:(.text+0x1544): undefined reference to `GOMP_loop_nonmonotonic_guided_start'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2610:(.text+0x1555): undefined reference to `GOMP_loop_end_nowait'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2610:(.text+0x15a9): undefined reference to `GOMP_loop_nonmonotonic_guided_next'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `svm_predict_values._omp_fn.1':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2629:(.text+0x165c): undefined reference to `GOMP_loop_nonmonotonic_guided_start'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2629:(.text+0x1665): undefined reference to `GOMP_loop_end_nowait'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2629:(.text+0x1699): undefined reference to `GOMP_loop_nonmonotonic_guided_next'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `svm_predict_values':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2610:(.text+0x3ec8): undefined reference to `GOMP_parallel'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:2629:(.text+0x3f6a): undefined reference to `GOMP_parallel'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `SVR_Q::get_Q(int, int) const [clone ._omp_fn.0]':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1408:(.text._ZNK5SVR_Q5get_QEii._omp_fn.0[_ZNK5SVR_Q5get_QEii]+0x4f): undefined reference to `GOMP_loop_nonmonotonic_guided_start'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1408:(.text._ZNK5SVR_Q5get_QEii._omp_fn.0[_ZNK5SVR_Q5get_QEii]+0x58): undefined reference to `GOMP_loop_end_nowait'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1408:(.text._ZNK5SVR_Q5get_QEii._omp_fn.0[_ZNK5SVR_Q5get_QEii]+0x8a): undefined reference to `GOMP_loop_nonmonotonic_guided_next'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `SVC_Q::get_Q(int, int) const [clone ._omp_fn.0]':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1290:(.text._ZNK5SVC_Q5get_QEii._omp_fn.0[_ZNK5SVC_Q5get_QEii]+0x57): undefined reference to `GOMP_loop_nonmonotonic_guided_start'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1293:(.text._ZNK5SVC_Q5get_QEii._omp_fn.0[_ZNK5SVC_Q5get_QEii]+0xee): undefined reference to `GOMP_loop_nonmonotonic_guided_next'
/usr/bin/ld: ~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1293:(.text._ZNK5SVC_Q5get_QEii._omp_fn.0[_ZNK5SVC_Q5get_QEii]+0xfb): undefined reference to `GOMP_loop_end_nowait'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `SVR_Q::get_Q(int, int) const':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1408:(.text._ZNK5SVR_Q5get_QEii[_ZNK5SVR_Q5get_QEii]+0x128): undefined reference to `GOMP_parallel'
/usr/bin/ld: /tmp/rustcVe6E8r/liblibrna_sys-9e8497eadd24f151.rlib(svm.o): in function `SVC_Q::get_Q(int, int) const':
~/builddir/ViennaRNA-2.6.4/src/ViennaRNA/../libsvm-3.31/svm.cpp:1290:(.text._ZNK5SVC_Q5get_QEii[_ZNK5SVC_Q5get_QEii]+0x87): undefined reference to `GOMP_parallel'
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 `crate-name` (bin "executable") due to previous error
The current solution to this is to add openmp-sys
as a dependency to your crate as well.
I'm currently hesitating to do this internally in librna-sys
but that might change in the future.
Hi,
Thank you for creating this crate, I'm not familiar with the rust calling c library. I installed the ViennaRNA
at /data01/softwares/ViennaRNA-2.5.1
and the libRNA.a
file can be found at /data01/softwares/ViennaRNA-2.5.1/src/ViennaRNA
I want to know how to set the LIBRNA_INCLUDE_DIR
variable because the cargo keeps telling me that fatal error: 'ViennaRNA/plotting/naview.h' file not found
Best wishes
This is a meta-issue. There are a few central issues coming with some subtleties to consider.
naview.h
location in wrapper.h
ViennaRNA/naview.h
pointing to ViennaRNA/plotting(/naview)/naview.h
which we don't need but it is a hacky(?) way to provide backwards-compatibiltiyexport CPATH=$LIBRNA_INCLUDE_DIR
workaround (see #1)dlib
extern functions could not be found in the generated bindings
wrapper.h
pk_plex.h
, pf_multifold.h
, subopt_zuker.h
, wrap_dlib.h
)
Ideally, these problems should be addressed in a backwards-compatible manner.
I.e. a new librna-sys
release should still work with ViennaRNA <=2.4.18
because this crate is currently not explicitly tied to specific versions of ViennaRNA.
Alternatively, librna-sys 0.2
could break backwards-compatibility but the mapping between librna-sys
and ViennaRNA versions needs to be clearly communicated.
Publishing librna-sys
in lock-step versions with ViennaRNA comes with its own limitations (can't create independent bugfix releases). In this case it would make sense to directly publish a version-specific bindings.rs
instead of build.rs
+ wrapper.h
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.