I have installed ChemmineOB and also open-babel but when the package is called inside R console, it seems that my open-babel is not found. Actually open-babel could be called by using its command line in terminal. I got confused and any suggestions will help a lot.
Thank you so much.
install open-babel
brew install open-babel
locate OPEN_BABEL_INCDIR and OPEN_BABEL_LIBDIR
OPEN_BABEL_INCDIR
is /usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2
, where files likealias.h
, descriptor.h
, pointgroup.h
, atom.h
etc.
OPEN_BABEL_LIBDIR
is /usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2
, where files likeAPIInterface.so
, fastsearchformat.so
, outformat.so
, CSRformat.so
, etc.
install ChemmineOB
R CMD INSTALL --configure-args='--with-openbabel-include=/usr/local/Cellar/open-babel/2.3.2/include/openbabel-2.0/openbabel --with-openbabel-lib=/usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2' ChemmineOB_1.2.9.tgz
Errors reported
Error : .onLoad failed in loadNamespace() for 'ChemmineOB', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Symbol not found: __ZN9OpenBabel10FastSearch11FindSimilarEPNS_6OBBaseERSt8multimapIdjSt4lessIdESaISt4pairIKdjEEEdd
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so
Expected in: /usr/local/lib/libopenbabel.4.dylib in /Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so
Error: package or namespace load failed for ‘ChemmineOB’
Environment
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Platform: x86_64-apple-darwin13.1.0 (64-bit) Mac OS X 10.9.5
Xcode 6.0.1
This worked for me; thanks, Dan.
I do this way on mac os but still getting error? Error: package or namespace load failed for ‘ChemmineOB’: .onLoad failed in loadNamespace() for 'ChemmineOB', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Library not loaded: /usr/local/opt/open-babel/lib/libopenbabel.5.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so Reason: image not found
First ensure that the file "/usr/local/opt/open-babel/lib/libopenbabel.5.dylib" exists. If it does not, then open babel is not installed properly. If it does exist, make sure that the environment variable OPEN_BABEL_LIBDIR is defined and points to "/usr/local/opt/open-babel/lib", or wherever the "libopenbabel.5.dynlib" library is located. Also make sure that the environment variable OPEN_BABEL_INCDIR is set to the location of the open babel header files. These two variables need to be set not just when you install ChemmineOB, but also whenever you use it in R.