girke-lab / ChemmineOB

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

Build error: `Symbol not found: __ZN9OpenBabel8OBPlugin7DisplayERSsPKcS3_` #34

Closed barracuda156 closed 8 months ago

barracuda156 commented 8 months ago

@khoran @jwokaty Could someone take a look, please?

** byte-compile and prepare package for lazy loading
in method for ‘copyToR’ with signature ‘"_p_std::char_traits<(char)>"’: no definition for class “_p_std::char_traits<(char)>”
in method for ‘copyToR’ with signature ‘"_p_std::pair<(unsigned int,unsigned int)>"’: no definition for class “_p_std::pair<(unsigned int,unsigned int)>”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::CharPtrLess"’: no definition for class “_p_OpenBabel::CharPtrLess”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::FptIndexHeader"’: no definition for class “_p_OpenBabel::FptIndexHeader”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBStereo"’: no definition for class “_p_OpenBabel::OBStereo”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBStereoUnit"’: no definition for class “_p_OpenBabel::OBStereoUnit”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::LineSearchType"’: no definition for class “_p_OpenBabel::LineSearchType”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBTetrahedralConfig"’: no definition for class “_p_OpenBabel::OBTetrahedralConfig”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBCisTransConfig"’: no definition for class “_p_OpenBabel::OBCisTransConfig”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBSquarePlanarConfig"’: no definition for class “_p_OpenBabel::OBSquarePlanarConfig”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
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 '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so':
  dlopen(/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so, 10): Symbol not found: __ZN9OpenBabel8OBPlugin7DisplayERSsPKcS3_
  Referenced from: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so
  Expected in: dynamic lookup

Error: loading failed

P. S. If it expects openbabel built with GUI, maybe it is possible to make it optional?

36-185% port -v installed openbabel
  openbabel @3.1.1_1 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2023-10-27T03:38:15+0800'
barracuda156 commented 8 months ago

Complete log, just in case:

* installing *source* package ‘ChemmineOB’ ...
** using staged installation
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENBABEL... no
checking for OPENBABEL... no
checking for gcc... /opt/local/bin/gcc-mp-13
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc-mp-13 accepts -g... yes
checking for /opt/local/bin/gcc-mp-13 option to accept ISO C89... none needed
checking how to run the C preprocessor... /opt/local/bin/gcc-mp-13 -E
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C++ compiler: ‘g++-mp-13 (MacPorts gcc13 13.2.0_3) 13.2.0’
Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) :
  running command ''xcrun' --show-sdk-path 2>&1' had status 64
using SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
/opt/local/bin/g++-mp-13 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DUSE_BOOST -DHAVE_EIGEN -I/opt/local/include/openbabel3 -I/opt/local/include/eigen3 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/zlibbioc/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC  -pipe -Os -arch ppc  -c ChemmineOB.cpp -o ChemmineOB.o
In file included from /opt/local/include/openbabel3/openbabel/format.h:22,
                 from /opt/local/include/openbabel3/openbabel/obconversion.h:37,
                 from ChemmineOB.cpp:1587:
/opt/local/include/openbabel3/openbabel/plugin.h:41:42: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
   41 | struct OBERROR CharPtrLess : public std::binary_function<const char*,const char*, bool>
      |                                          ^~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc13/c++/string:49,
                 from /opt/local/include/gcc13/c++/stdexcept:39,
                 from ChemmineOB.cpp:1559:
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp: In function 'SEXPREC* R_swig_new_dummy()':
ChemmineOB.cpp:13728:45: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13728 | SWIGEXPORT SEXP R_swig_new_dummy ( ) { std::binary_function< char const *,char const *,bool > *result = 0 ;
      |                                             ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp:13730:18: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13730 |   result = (std::binary_function< char const *,char const *,bool > *)new std::binary_function< char const *,char const *,bool >();
      |                  ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp:13730:79: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13730 |   result = (std::binary_function< char const *,char const *,bool > *)new std::binary_function< char const *,char const *,bool >();
      |                                                                               ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp: In function 'SEXPREC* R_swig_delete_dummy(SEXP)':
ChemmineOB.cpp:13734:8: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13734 |   std::binary_function< char const *,char const *,bool > *arg1 = (std::binary_function< char const *,char const *,bool > *) 0 ;
      |        ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp:13734:72: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13734 |   std::binary_function< char const *,char const *,bool > *arg1 = (std::binary_function< char const *,char const *,bool > *) 0 ;
      |                                                                        ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp:13739:34: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
13739 |    arg1 = reinterpret_cast< std::binary_function< char const *,char const *,bool > * >(argp1); delete arg1; r_ans = R_NilValue;
      |                                  ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
ChemmineOB.cpp: In function 'void* _p_OpenBabel__CharPtrLessTo_p_std__binary_functionT_char_const_p_char_const_p_bool_t(void*, int*)':
ChemmineOB.cpp:39656:27: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
39656 |     return (void *)((std::binary_function< char const *,char const *,bool > *)  ((OpenBabel::CharPtrLess *) x));
      |                           ^~~~~~~~~~~~~~~
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
/opt/local/bin/g++-mp-13 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DUSE_BOOST -DHAVE_EIGEN -I/opt/local/include/openbabel3 -I/opt/local/include/eigen3 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/zlibbioc/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC  -pipe -Os -arch ppc  -c canonical.cpp -o canonical.o
In file included from /opt/local/include/openbabel3/openbabel/op.h:25,
                 from canonical.cpp:3:
/opt/local/include/openbabel3/openbabel/plugin.h:41:42: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
   41 | struct OBERROR CharPtrLess : public std::binary_function<const char*,const char*, bool>
      |                                          ^~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc13/c++/string:49,
                 from /opt/local/include/openbabel3/openbabel/op.h:23:
/opt/local/include/gcc13/c++/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
/opt/local/bin/g++-mp-13 -std=gnu++17 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -L/opt/local/lib -lMacportsLegacySupport -arch ppc -o ChemmineOB.so ChemmineOB.o canonical.o -L/opt/local/lib -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs
** R
** inst
** byte-compile and prepare package for lazy loading
in method for ‘copyToR’ with signature ‘"_p_std::char_traits<(char)>"’: no definition for class “_p_std::char_traits<(char)>”
in method for ‘copyToR’ with signature ‘"_p_std::pair<(unsigned int,unsigned int)>"’: no definition for class “_p_std::pair<(unsigned int,unsigned int)>”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::CharPtrLess"’: no definition for class “_p_OpenBabel::CharPtrLess”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::FptIndexHeader"’: no definition for class “_p_OpenBabel::FptIndexHeader”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBStereo"’: no definition for class “_p_OpenBabel::OBStereo”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBStereoUnit"’: no definition for class “_p_OpenBabel::OBStereoUnit”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::LineSearchType"’: no definition for class “_p_OpenBabel::LineSearchType”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBTetrahedralConfig"’: no definition for class “_p_OpenBabel::OBTetrahedralConfig”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBCisTransConfig"’: no definition for class “_p_OpenBabel::OBCisTransConfig”
in method for ‘copyToR’ with signature ‘"_p_OpenBabel::OBSquarePlanarConfig"’: no definition for class “_p_OpenBabel::OBSquarePlanarConfig”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
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 '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so':
  dlopen(/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so, 10): Symbol not found: __ZN9OpenBabel8OBPlugin7DisplayERSsPKcS3_
  Referenced from: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/00LOCK-ChemmineOB/00new/ChemmineOB/libs/ChemmineOB.so
  Expected in: dynamic lookup

Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB/ChemmineOB.Rcheck/ChemmineOB’
barracuda156 commented 8 months ago

Indeed, that symbol (as well as quite a number of other) is unavailable:

000d5ea8 T __ZN9OpenBabel8OBPlugin5BeginEPKc
         U __ZN9OpenBabel8OBPlugin7DisplayERSsPKcS3_
         U __ZN9OpenBabel8OBPlugin9FirstLineEPKc
         U __ZN9OpenBabel8OBPlugin9GetPluginEPKcS2_

I have no idea why though.

barracuda156 commented 8 months ago

Gimme a min, maybe it is I am being stupid; let me try rebuilding with one change.

barracuda156 commented 8 months ago

Indeed, it is my error: when fixing paths in Makevars (it is set to use Homebrew dirs, but not Macports) I removed @OPENBABEL_LIBS@, assuming – wrongly – that it will be redundant. But then nothing passed lib flag itself, despite paths being fixed. Everything works now, closing.