girke-lab / ChemmineOB

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

Does not build with Clang: `error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?` (no error with GCC) #40

Closed barracuda156 closed 2 months ago

barracuda156 commented 2 months ago
  --->  Configuring R-ChemmineOB
  DEBUG: Preferred compilers: clang macports-clang-16 macports-clang-15 macports-clang-14 macports-clang-11
  DEBUG: Using compiler 'MacPorts Clang 16'
  DEBUG: Executing proc-pre-org.macports.configure-configure-0
  DEBUG: Active variants check for source-type install considers depends_fetch depends_extract depends_lib depends_build depends_run: eigen3 openbabel R-BH R-BiocGenerics R-Rcpp R-zlibbioc R-CRAN-recommended pkgconfig clang-16 R
  DEBUG: Executing proc-pre-org.macports.configure-configure-1
  DEBUG: compilers.enforce_c list: 
  DEBUG: compilers.enforce_fortran list: 
  DEBUG: compilers.enforce_some_fortran list: 
  DEBUG: compilers PG: GCC version reports being UNKNOWN to MacPorts
  DEBUG: compilers PG: RPATH added to ldflags as GCC version is UNKNOWN
  DEBUG: Executing org.macports.configure (R-ChemmineOB)
  DEBUG: Environment: 
  CC='/opt/local/bin/clang-mp-16'
  CC_PRINT_OPTIONS='YES'
  CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/.CC_PRINT_OPTIONS'
  CFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64'
  CPATH='/opt/local/include'
  CPPFLAGS='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
  CXX='/opt/local/bin/clang++-mp-16'
  CXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64'
  DEVELOPER_DIR='/Library/Developer/CommandLineTools'
  F90FLAGS='-pipe -Os -m64'
  FCFLAGS='-pipe -Os -m64'
  FFLAGS='-pipe -Os -m64'
  INSTALL='/usr/bin/install -c'
  LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64'
  LIBRARY_PATH='/opt/local/lib'
  MACOSX_DEPLOYMENT_TARGET='14.0'
  OBJC='/opt/local/bin/clang-mp-16'
  OBJCFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64'
  OBJCXX='/opt/local/bin/clang++-mp-16'
  OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64'
  SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
  DEBUG: system:  cd "/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes --keep-empty-dirs 
  Executing:  cd "/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes --keep-empty-dirs 
  * checking for file ‘./DESCRIPTION’ ... OK
  * preparing ‘ChemmineOB’:
  * checking DESCRIPTION meta-information ... OK
  * cleaning src
  * running ‘cleanup’
  * checking vignette meta-information ... OK
  * checking for LF line-endings in source and make files and shell scripts
  * checking for empty or unneeded directories
  * building ‘ChemmineOB_1.42.0.tar.gz’

  DEBUG: Executing portconfigure::configure_finish
  DEBUG: Privilege de-escalation not attempted as not running as root.
  DEBUG: build phase started at Sun May  5 15:48:38 UTC 2024
  --->  Building R-ChemmineOB
  DEBUG: Executing proc-pre-org.macports.build-build-0
  xinstall: mkdir /opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/build
  DEBUG: Executing org.macports.build (R-ChemmineOB)
  DEBUG: Environment: 
  CC_PRINT_OPTIONS='YES'
  CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/.CC_PRINT_OPTIONS'
  CPATH='/opt/local/include'
  DEVELOPER_DIR='/Library/Developer/CommandLineTools'
  LIBRARY_PATH='/opt/local/lib'
  MACOSX_DEPLOYMENT_TARGET='14.0'
  SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
  DEBUG: system:  cd "/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/build --install-tests 
  Executing:  cd "/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/ChemmineOB" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-ChemmineOB/R-ChemmineOB/work/build --install-tests 
  * 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/clang-mp-16
  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/clang-mp-16 accepts -g... yes
  checking for /opt/local/bin/clang-mp-16 option to accept ISO C89... none needed
  checking how to run the C preprocessor... /opt/local/bin/clang-mp-16 -E
  configure: creating ./config.status
  config.status: creating src/Makevars
  ** libs
  using C++ compiler: ‘clang version 16.0.6’
  using SDK: ‘MacOSX14.4.sdk’
  /opt/local/bin/clang++-mp-16 -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.4/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/zlibbioc/include' -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk   -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64   -c ChemmineOB.cpp -o ChemmineOB.o
  In file included from ChemmineOB.cpp:1587:
  In file included from /opt/local/include/openbabel3/openbabel/obconversion.h:37:
  In file included from /opt/local/include/openbabel3/openbabel/format.h:22:
  /opt/local/include/openbabel3/openbabel/plugin.h:41:42: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
  struct OBERROR CharPtrLess : public std::binary_function<const char*,const char*, bool>
                                      ~~~~~^~~~~~~~~~~~~~~
                                           __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13728:45: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
  SWIGEXPORT SEXP R_swig_new_dummy ( ) { std::binary_function< char const *,char const *,bool > *result = 0 ;
                                         ~~~~~^~~~~~~~~~~~~~~
                                              __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13730:18: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
    result = (std::binary_function< char const *,char const *,bool > *)new std::binary_function< char const *,char const *,bool >();
              ~~~~~^~~~~~~~~~~~~~~
                   __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13730:79: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
    result = (std::binary_function< char const *,char const *,bool > *)new std::binary_function< char const *,char const *,bool >();
                                                                           ~~~~~^~~~~~~~~~~~~~~
                                                                                __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13734:8: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
    std::binary_function< char const *,char const *,bool > *arg1 = (std::binary_function< char const *,char const *,bool > *) 0 ;
    ~~~~~^~~~~~~~~~~~~~~
         __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13734:72: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
    std::binary_function< char const *,char const *,bool > *arg1 = (std::binary_function< char const *,char const *,bool > *) 0 ;
                                                                    ~~~~~^~~~~~~~~~~~~~~
                                                                         __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:13739:34: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
     arg1 = reinterpret_cast< std::binary_function< char const *,char const *,bool > * >(argp1); delete arg1; r_ans = R_NilValue;
                              ~~~~~^~~~~~~~~~~~~~~
                                   __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  ChemmineOB.cpp:39656:27: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
      return (void *)((std::binary_function< char const *,char const *,bool > *)  ((OpenBabel::CharPtrLess *) x));
                       ~~~~~^~~~~~~~~~~~~~~
                            __binary_function
  /opt/local/libexec/llvm-16/bin/../include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^
  8 errors generated.
  make: *** [ChemmineOB.o] Error 1

With GCC it builds normally.

barracuda156 commented 2 months ago

Duplicate of https://github.com/girke-lab/ChemmineOB/issues/35