eddelbuettel / bh

R package providing Boost Header files
85 stars 33 forks source link

Compilation of `bigmemory` fails in Alpine Linux apparently due to BH version #85

Closed glm729 closed 1 year ago

glm729 commented 1 year ago

See also: https://github.com/kaneplusplus/bigmemory/issues/113

Attempting to compile bigmemory in an Alpine Linux-based Apptainer image fails with BH version 1.78 (default from CRAN). Installing BH version 1.75 from CRAN results in successfully compiling and installing bigmemory. Below is some system and R info and the console output when attempting to install the bigmemory package.


OS info:

$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.2
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

R info:

$ R --version
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-musl (64-bit)

Console output ``` > install.packages("bigmemory", dependencies = TRUE, Ncpus = 3L); trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/bigmemory_4.6.1.tar.gz' Content type 'application/x-gzip' length 72353 bytes (70 KB) ================================================== downloaded 70 KB * installing *source* package ‘bigmemory’ ... ** package ‘bigmemory’ successfully unpacked and MD5 sums checked ** using staged installation checking for Sun Studio compiler... no checking for OS... Linux ** libs g++ -std=gnu++14 -I"/usr/include/R" -DNDEBUG -I../inst/include -DLINUX -I'/usr/lib/R/library/BH/include' -I'/usr/lib/R/library/uuid/include' -I'/usr/lib/R/library/Rcpp/include' -I/usr/local/include -D__MUSL__ -fpic -g -O2 -D__MUSL__ -c BigMatrix.cpp -o BigMatrix.o In file included from /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp:25, from /usr/lib/R/library/BH/include/boost/interprocess/shared_memory_object.hpp:29, from BigMatrix.cpp:13: /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:73:14: error: 'mode_t' in namespace '::' does not name a type 73 | typedef ::mode_t os_permissions_type; | ^~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:75:4: error: 'os_permissions_type' does not name a type 75 | os_permissions_type m_perm; | ^~~~~~~~~~~~~~~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:82:35: error: expected ')' before 'type' 82 | permissions(os_permissions_type type) BOOST_NOEXCEPT | ~ ^~~~~ | ) /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:117:25: error: 'os_permissions_type' has not been declared 117 | void set_permissions(os_permissions_type perm) BOOST_NOEXCEPT | ^~~~~~~~~~~~~~~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:122:4: error: 'os_permissions_type' does not name a type 122 | os_permissions_type get_permissions() const BOOST_NOEXCEPT | ^~~~~~~~~~~~~~~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp: In member function 'void boost::interprocess::permissions::set_default()': /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:100:7: error: 'm_perm' was not declared in this scope 100 | m_perm = 0644; | ^~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp: In member function 'void boost::interprocess::permissions::set_unrestricted()': /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:111:7: error: 'm_perm' was not declared in this scope 111 | m_perm = 0666; | ^~~~~~ /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp: In member function 'void boost::interprocess::permissions::set_permissions(int)': /usr/lib/R/library/BH/include/boost/interprocess/permissions.hpp:118:7: error: 'm_perm' was not declared in this scope; did you mean 'perm'? 118 | { m_perm = perm; } | ^~~~~~ | perm In file included from /usr/lib/R/library/BH/include/boost/interprocess/shared_memory_object.hpp:29, from BigMatrix.cpp:13: /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp: In function 'boost::interprocess::file_handle_t boost::interprocess::ipcdetail::create_new_file(const char*, boost::interprocess::mode_t, const boost::interprocess::permissions&, bool)': /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp:547:64: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 547 | int ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions()); | ^~~~~~~~~~~~~~~ | set_permissions /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp:549:26: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 549 | ::fchmod(ret, perm.get_permissions()); | ^~~~~~~~~~~~~~~ | set_permissions /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp: In function 'boost::interprocess::file_handle_t boost::interprocess::ipcdetail::create_or_open_file(const char*, boost::interprocess::mode_t, const boost::interprocess::permissions&, bool)': /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp:562:63: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 562 | ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions()); | ^~~~~~~~~~~~~~~ | set_permissions /usr/lib/R/library/BH/include/boost/interprocess/detail/os_file_functions.hpp:564:29: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 564 | ::fchmod(ret, perm.get_permissions()); | ^~~~~~~~~~~~~~~ | set_permissions In file included from BigMatrix.cpp:13: /usr/lib/R/library/BH/include/boost/interprocess/shared_memory_object.hpp: In member function 'bool boost::interprocess::shared_memory_object::priv_open_or_create(boost::interprocess::ipcdetail::create_enum_t, const CharT*, boost::interprocess::mode_t, const boost::interprocess::permissions&)': /usr/lib/R/library/BH/include/boost/interprocess/shared_memory_object.hpp:371:30: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 371 | ::mode_t unix_perm = perm.get_permissions(); | ^~~~~~~~~~~~~~~ | set_permissions In file included from /usr/lib/R/library/BH/include/boost/interprocess/sync/posix/named_semaphore.hpp:25, from /usr/lib/R/library/BH/include/boost/interprocess/sync/posix/named_mutex.hpp:29, from /usr/lib/R/library/BH/include/boost/interprocess/sync/named_mutex.hpp:30, from BigMatrix.cpp:20: /usr/lib/R/library/BH/include/boost/interprocess/sync/posix/semaphore_wrapper.hpp: In function 'bool boost::interprocess::ipcdetail::semaphore_open(sem_t*&, boost::interprocess::ipcdetail::create_enum_t, const char*, unsigned int, const boost::interprocess::permissions&)': /usr/lib/R/library/BH/include/boost/interprocess/sync/posix/semaphore_wrapper.hpp:81:59: error: 'const class boost::interprocess::permissions' has no member named 'get_permissions'; did you mean 'set_permissions'? 81 | handle = ::sem_open(name.c_str(), oflag, perm.get_permissions(), count); | ^~~~~~~~~~~~~~~ | set_permissions In file included from /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:17, from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/detail/shared_count.hpp: At global scope: /usr/lib/R/library/BH/include/boost/smart_ptr/detail/shared_count.hpp:361:33: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 361 | explicit shared_count( std::auto_ptr & r ): pi_( new sp_counted_impl_p( r.get() ) ) | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:250:65: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 250 | template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R > | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:507:31: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 507 | explicit shared_ptr( std::auto_ptr & r ): px(r.get()), pn() | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:520:22: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 520 | shared_ptr( std::auto_ptr && r ): px(r.get()), pn() | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:603:34: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 603 | shared_ptr & operator=( std::auto_ptr & r ) | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:612:34: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 612 | shared_ptr & operator=( std::auto_ptr && r ) | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ In file included from /usr/lib/R/library/BH/include/boost/shared_ptr.hpp:17, from ../inst/include/bigmemory/BigMatrix.h:10, from BigMatrix.cpp:22: /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp: In member function 'boost::shared_ptr& boost::shared_ptr::operator=(std::auto_ptr<_Up>&&)': /usr/lib/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:614:38: warning: 'template class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 614 | this_type( static_cast< std::auto_ptr && >( r ) ).swap( *this ); | ^~~~~~~~ In file included from /usr/include/c++/11.2.1/bits/locale_conv.h:41, from /usr/include/c++/11.2.1/locale:43, from /usr/include/c++/11.2.1/iomanip:43, from /usr/lib/R/library/Rcpp/include/RcppCommon.h:53, from /usr/lib/R/library/Rcpp/include/Rcpp.h:27, from BigMatrix.cpp:11: /usr/include/c++/11.2.1/bits/unique_ptr.h:57:28: note: declared here 57 | template class auto_ptr; | ^~~~~~~~ make: *** [/usr/lib/R/etc/Makeconf:177: BigMatrix.o] Error 1 ERROR: compilation failed for package ‘bigmemory’ * removing ‘/usr/lib/R/library/bigmemory’ The downloaded source packages are in ‘/tmp/RtmppfaGbb/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning message: In install.packages("bigmemory", dependencies = TRUE, Ncpus = 3L) : installation of package ‘bigmemory’ had non-zero exit status ```
eddelbuettel commented 1 year ago

You may need to bring that up with either Boost or the R Core team. There is nothing I turn on or off here -- if the code doesn't work on you (still somewhat exotic and by choice smaller and limited system) you may have to live without it.

The package is a priori released to CRAN and in good standing on all their systems per this snapshot image of the summary at https://cloud.r-project.org/web/checks/check_results_BH.html

image

eddelbuettel commented 1 year ago

Looking for closely at the fail for auto_ptr that may just be a bug in bigmemory. It is an optional feature that is mostly deprecated. Maybe try definining BOOST_NO_AUTO_PTR. In any event not a bug in BH either.