girke-lab / ChemmineOB

OpenBabel wrapper package for R
Other
9 stars 5 forks source link

ChemmineOB install trouble #25

Closed kenlo1 closed 3 years ago

kenlo1 commented 3 years ago

Hi all,

I am having some issues installing ChemmineOB on CentOS 7.

Basically I don't have root access and have installed openbabel in a custom directory using cmake flags -DCMAKE_INSTALL_PREFIX and -DEIGEN3_INCLUDE_DIR

Since I am using custom paths, I used this to install ChemmineOB. R CMD INSTALL --configure-args='--with-openbabel-include=/nfs/peptide/software/openbabel/include/openbabel3 --with-openbabel-lib=/nfs/peptide/software/openbabel/lib' ./ChemmineOB_1.28.4.tar.gz

Here is what the error message says:

It seems like it is not finding Eigen, then I noticed that -I/usr/inlcude/eigen3, which is not where I have eigen3. Is there an install flag that can change this? My eigen3 is in /usr/local/include/eigen3.

Any help would be awesome.

Best,

Ken

khoran commented 3 years ago

You can add additional directories by setting some environment variables for the compiler. One way to do this is by creating the file ~/.R/Makevars and setting CXXFLAGS= -I /usr/local/include/eigen3 . If that doesn't modify the compile command, try using PKG_CXXFLAGS.

kenlo1 commented 3 years ago

Thanks! I was able to get past that first error. Now my error message reads as follows:

R CMD INSTALL --configure-args='--with-openbabel-include=/nfs/peptide/software/openbabel/include/openbabel3 --with-openbabel-lib=/nfs/peptide/software/openbabel/lib' ./ChemmineOB_1.28.4.tar.gz

khoran commented 3 years ago

Set these two environment variables (see INSTALL file):

OPEN_BABEL_INCDIR = path to header files
OPEN_BABEL_LIBDIR = path to shared (.so) library file
kenlo1 commented 3 years ago

Does that mean the --configure-args switch does not achieve the same thing?

kenlo1 commented 3 years ago

I noticed this in the error message:

libopenbabel.so.7: cannot open shared object file: No such file or directory

I'm not sure if this is relevant, but in the directory specified with the '--with-openbabel-lib' flag, I am seeing libopenbabel.so.7, so that is a little curious.

khoran commented 3 years ago

--configure-args and --with-openbabel-lib are for compile time. But R still needs to know where the library is at runtime. So anytime you want to use the ChemmineOB package, the OPEN_BABEL_* environment variables need to be defined. This is easily accomplished by putting them in your .bashrc file or whatever config file your shell uses.

kenlo1 commented 3 years ago

I added to environment variables as per your suggestion. This is what I see when I check the environment variables.

echo $OPEN_BABEL_INCDIR /nfs/peptide/software/openbabel/include/openbabel3

echo $OPEN_BABEL_LIBDIR /nfs/peptide/software/openbabel/lib

I tried installing again with R CMD INSTALL --configure-args='--with-openbabel-include=/nfs/peptide/software/openbabel/include/openbabel3 --with-openbabel-lib=/nfs/peptide/software/openbabel/lib' ./ChemmineOB_1.28.4.tar.gz

but I still get the same error message.

kenlo1 commented 3 years ago

Hi Kevin,

I figured out what was wrong. It turns out that my LD_LIBRARY_PATH environment variable wasn't set correctly. I found some additional information from open-babel (https://open-babel.readthedocs.io/en/latest/Installation/install.html#environment-variables). Once I changed it to the correct location, ChemmineOB installed correctly. Thanks for all your help!

Best,

Ken