kaneplusplus / bigmemory

126 stars 24 forks source link

Compilation failure in Alpine Linux container #113

Closed glm729 closed 2 years ago

glm729 commented 2 years ago

When attempting to install the package inside an Alpine Linux-based Apptainer image, featuring R and its dependencies, compilation of the package fails. Below is the console output when running install.packages.

What are the dependencies for this package? I may be missing a required dependency.


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 ```
privefl commented 2 years ago

Main dependencies are Rcpp, BH, and uuid.

glm729 commented 2 years ago

I'll give it a shot, I don't know why I was able to compile it before and now cannot do so. The image in which it's being installed should be identical, but maybe I accidentally trimmed a dependency in there somewhere.

glm729 commented 2 years ago

After a full rebuild, Rcpp, BH, and uuid all install without error, but bigmemory is still failing. I am not sure what is causing the error!

Besides base and dev R, devtools is also installed. Attempting to install bigparallelr, bigsnpr, and bigstatsr together shows no error besides that of bigmemory, which is the last installation attempted before exiting.

privefl commented 2 years ago

Another person report the first issue with the new version of BH (cf. https://lore.kernel.org/all/20211227112241.65b18a5d@windsurf/t/). Maybe worth trying reinstalling a previous version of BH, e.g. install.packages("https://cran.r-project.org/src/contrib/Archive/BH/BH_1.75.0-0.tar.gz", repos = NULL).

glm729 commented 2 years ago

Thank you, I am testing this one now. Might take a little while to build! But I tested installing BH via the command you sent, and that appears to be working. Now just to see if bigmemory will compile!

glm729 commented 2 years ago

The installation is successful, thank you! Installing version 1.75 of BH results in a successful installation of the latest bigmemory from CRAN.

privefl commented 2 years ago

It might be worth opening an issue on the BH repo, so that they make sure it is fixed in the next CRAN update.

glm729 commented 2 years ago

Done, I've opened a ticket in the BH repo. I will close this ticket now, and thank you again!

eddelbuettel commented 2 years ago

As best as I can tell this has nothing to do with BH as I explained over there. I recommend opening this here.

Boost upstream moves forward to newer compilation standard, some sub-libraries now need C++14. From what was mentioned over at BH (but not here, curiously) you seem to falling over auto_ptr -- for which Boost has had a #define to not use it for years.

glm729 commented 2 years ago

@eddelbuettel I am not sure I entirely understand your comment.

I recommend opening this here.

Are you suggesting I re-open this ticket? This is fixed for my purposes, but for others, downgrading from BH 1.78 to BH 1.75 may not be optimal.

From what was mentioned over at BH (but not here, curiously) you seem to falling over auto_ptr

Please see the original ticket description at the top of this page, in particular, the console output. The console output in the description of https://github.com/eddelbuettel/bh/issues/85 was copied from here.

eddelbuettel commented 2 years ago

This is bigmemory. It is the package you tried to install. It set the compilation standard. That was my point: Boost and BH may require C++14 in version 1.78 (this is just a guess). You may have avoided that by staying with the older version but all of us are none the wiser because we still do not know the root cause.

And that is why I recommended to address that here.