rdkit-rs / rdkit-sys

Rust crate for linking against the RDKit C++ API
21 stars 6 forks source link

rdkit-sys question #8

Closed jhylin closed 1 year ago

jhylin commented 1 year ago

Hi,

I’m a relatively new user of Rust (more familiar with Python & R) and hoping to integrate Rust and RDKit (trying to start a cheminformatics project in Rust), so I was quite excited to come across this crate, rdkit-sys, online. I was running it on VS code on Mac OS, by using the latest version 0.2.16 of rdkit-sys in the cargo.toml. However, when I ran it via cargo check or cargo test, it showed a set of errors like this after compilation (in total it appeared twice):

warning: /usr/local/include/rdkit/RDGeneral/Dict.h:261:26: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? warning: static_assert(! std::is_same_v<T, std::string_view>, warning: ~^~~~~ warning: is_same

warning: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:547:61: note: 'is_same' declared here warning: template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {}; warning:

Prior to this, I’ve already installed rdkit and relevant dependencies via Homebrew. It appeared there might be conflicts between one of the RDKit files and one of the llvm files (this was as far as I could tell if I went back to these files). So either I’m missing something obvious here (being quite new in the coding world) or I wasn’t doing something correctly?

Hoping someone might be able to enlighten me on this one... (might be due to a silly thing I've missed).

Many thanks, J

xrl commented 1 year ago

Interesting, I wonder if rdkit-rs needs to updates how it builds the load path for rdkit. Can you post your rdkit version? brew info rdkit should have it.

jhylin commented 1 year ago

Hi,

This was what I've got for my RDKit version (I actually uninstalled RDKit and re-installed it after having this problem, but it still persisted after the re-installation):

==> rdkit: stable 2022.09.1 (bottled), HEAD Open-source chemoinformatics library https://rdkit.org/ /usr/local/Cellar/rdkit/2022.09.1 (1,856 files, 177.2MB) * Poured from bottle on 2022-11-28 at 13:37:49 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/rdkit.rb License: BSD-3-Clause ==> Dependencies Build: cmake ✔, swig ✔ Required: boost ✔, boost-python3 ✔, eigen ✔, freetype ✔, numpy ✔, postgresql@14 ✔, py3cairo ✔, python@3.10 ✔ ==> Options --HEAD Install HEAD version ==> Caveats You may need to add RDBASE to your environment variables. For Bash, put something like this in your $HOME/.bashrc: export RDBASE=/usr/local/opt/rdkit/share/RDKit ==> Analytics install: 404 (30 days), 1,324 (90 days), 4,381 (365 days) install-on-request: 218 (30 days), 715 (90 days), 2,844 (365 days) build-error: 0 (30 days)

Thanks, J

jhylin commented 1 year ago

I'll close this issue for now, as I've found other tools to work with. Would love to know if rdkit-rs actually needs to update how it builds the load path to rdkit. Thanks for responding in the first place anyway.