FBartos / RoBMA

RoBMA R package for estimating robust Bayesian meta-analyses
https://fbartos.github.io/RoBMA/
8 stars 3 forks source link

configure does not detect GCC features correctly #27

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago
checking for gcc... /opt/local/bin/gcc-mp-12
checking whether the compiler supports GNU C... no
checking whether /opt/local/bin/gcc-mp-12 accepts -g... no
checking for /opt/local/bin/gcc-mp-12 option to enable C11 features... unsupported
checking for /opt/local/bin/gcc-mp-12 option to enable C99 features... unsupported
checking for /opt/local/bin/gcc-mp-12 option to enable C89 features... unsupported

This is outright wrong – all these should be seen as supported. Compilation is still successful though:

* installing *source* package ‘RoBMA’ ...
** using staged installation
checking for pkg-config... /opt/local/bin/pkg-config
configure: Setting compile and link flags according to pkg-config
configure: Compile flags are -I/opt/local/include/JAGS
configure: Link flags are -L/opt/local/lib -ljags
checking for gcc... /opt/local/bin/gcc-mp-12
checking whether the compiler supports GNU C... no
checking whether /opt/local/bin/gcc-mp-12 accepts -g... no
checking for /opt/local/bin/gcc-mp-12 option to enable C11 features... unsupported
checking for /opt/local/bin/gcc-mp-12 option to enable C99 features... unsupported
checking for /opt/local/bin/gcc-mp-12 option to enable C89 features... unsupported
checking for jags_version in -ljags... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DMN.cc -o distributions/DMN.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWMN1.cc -o distributions/DWMN1.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWMN2.cc -o distributions/DWMN2.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DMNv.cc -o distributions/DMNv.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWMN1v.cc -o distributions/DWMN1v.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWMN2v.cc -o distributions/DWMN2v.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWN1.cc -o distributions/DWN1.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWN2.cc -o distributions/DWN2.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWT1.cc -o distributions/DWT1.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWT2.cc -o distributions/DWT2.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWN.cc -o distributions/DWN.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWWN1.cc -o distributions/DWWN1.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c distributions/DWWN2.cc -o distributions/DWWN2.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c transformations/z.cc -o transformations/z.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c transformations/r.cc -o transformations/r.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c transformations/d.cc -o transformations/d.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c transformations/logOR.cc -o transformations/logOR.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c functions/wmnorm.cc -o functions/wmnorm.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c functions/mnorm.cc -o functions/mnorm.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c source/tools.cc -o source/tools.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c source/mnorm.cc -o source/mnorm.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c source/wmnorm.cc -o source/wmnorm.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c source/transformations.cc -o source/transformations.o
/opt/local/bin/gcc-mp-12 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c init.c -o init.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c RoBMA.cc -o RoBMA.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/local/include/JAGS -D JAGS_MAJOR_FORCED=0 -D JAGS_MAJOR_ASSUMED=0 -D _GLIBCXX_USE_CXX11_ABI=0 -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mvtnorm/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c testRoBMA.cc -o testRoBMA.o
/opt/local/bin/g++-mp-12 -std=gnu++14 -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 RoBMA.so distributions/DMN.o distributions/DWMN1.o distributions/DWMN2.o distributions/DMNv.o distributions/DWMN1v.o distributions/DWMN2v.o distributions/DWN1.o distributions/DWN2.o distributions/DWT1.o distributions/DWT2.o distributions/DWN.o distributions/DWWN1.o distributions/DWWN2.o transformations/z.o transformations/r.o transformations/d.o transformations/logOR.o functions/wmnorm.o functions/mnorm.o source/tools.o source/mnorm.o source/wmnorm.o source/transformations.o init.o RoBMA.o testRoBMA.o -L/opt/local/lib -ljags -ljrmath -llapack -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/RoBMA-2.3.2/RoBMA.Rcheck/00LOCK-RoBMA/00new/RoBMA/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (RoBMA)
barracuda156 commented 1 year ago

Also, older macOS need -D _GLIBCXX_USE_CXX11_ABI=0 flag, otherwise build fails:

Error: package or namespace load failed for ‘RoBMA’:
 .onLoad failed in loadNamespace() for 'RoBMA', details:
  call: dyn.load(file)
  error: unable to load shared object '/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/.tmp/Rtmpr3BmWz/Rinst1335b5b4138e1/00LOCK-RoBMA/00new/RoBMA/libs/RoBMA.so':
  dlopen(/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/.tmp/Rtmpr3BmWz/Rinst1335b5b4138e1/00LOCK-RoBMA/00new/RoBMA/libs/RoBMA.so, 6): Symbol not found: __ZNK4jags12Distribution5aliasB5cxx11Ev
  Referenced from: /opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/.tmp/Rtmpr3BmWz/Rinst1335b5b4138e1/00LOCK-RoBMA/00new/RoBMA/libs/RoBMA.so
  Expected in: dynamic lookup

Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/.tmp/Rtmpr3BmWz/Rinst1335b5b4138e1/RoBMA’
      -----------------------------------
ERROR: package installation failed
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-RoBMA/R-RoBMA/work/RoBMA-2.3.2" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes 
Exit code: 1

I am not really sure which version needs it the last, but some our ports in Macports use it for Darwin < 16.

FBartos commented 1 year ago

Hi, sorry for completely forgetting about this. My colleagues and I looked into it when fixing the other issue but we are completely clueless about the cause of this problem.

barracuda156 commented 1 year ago

This is a pretty typical issue, reason being: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html Not-bleeding-edge OS often need this to be defined to fix building.

I am not really sure if there is a simple way to handle this automatically in R. I know that CMake in Macports takes care of this well enough, so that manual fixing is pretty much never required, while for R packages in Macports I have to add it to fix them. (Does not mean there is no neat solution, I am just unaware of it at the moment.)