DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

Installation trouble due to flowCore package Ubuntu 22.04 #178

Closed avdvloet closed 1 year ago

avdvloet commented 1 year ago

I am facing problems when installing the CytoExploreR package. I recently upgraded to Ubuntu 22.04 and everything worked fine on 20.04. My R version is R 4.1.2

install.packages('remotes') # works
writeLines(pak::pkg_system_requirements("devtools", "ubuntu", "20.04")) # works
install.packages('devtools') # works
install.packages('rlang') # works
install.packages('BiocManager') # works
remotes::install_github('RGLab/cytoinstaller', force=TRUE) # works

BiocManager::install(c("flowCore", "flowWorkspace", "openCyto")) # here I get the error and the script exits
devtools::install_github('DillonHammill/CytoExploreR')

The output is extremely long and it is very hard for me to find the error. Here is the last piece. Let me know whether additional info is required.

home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/cytolib/include/cytolib/compensation.hpp:55:15:   required from here
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/concept/usage.hpp:20:48: warning: ‘this’ pointer is null [-Wnonnull]
   20 |     ~usage_requirements() { ((Model*)0)->~Model(); }
      |                             ~~~~~~~~~~~~~~~~~~~^~
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/concept/usage.hpp:37:7: note: in a call to non-static member function ‘boost::SinglePassRangeConcept<T>::~SinglePassRangeConcept() [with T = const boost::iterator_range<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >]’
   37 |       ~model()
      |       ^
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/range/concepts.hpp:284:9: note: in expansion of macro ‘BOOST_CONCEPT_USAGE’
  284 |         BOOST_CONCEPT_USAGE(SinglePassRangeConcept)
      |         ^~~~~~~~~~~~~~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:177: RcppExports.o] Error 1
ERROR: compilation failed for package ‘flowCore’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowCore’
ERROR: dependency ‘flowCore’ is not available for package ‘ncdfFlow’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/ncdfFlow’
ERROR: dependency ‘flowCore’ is not available for package ‘flowViz’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowViz’
ERROR: dependencies ‘flowViz’, ‘flowCore’ are not available for package ‘flowClust’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowClust’
ERROR: dependencies ‘flowCore’, ‘ncdfFlow’ are not available for package ‘flowWorkspace’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowWorkspace’
ERROR: dependencies ‘flowCore’, ‘flowWorkspace’, ‘ncdfFlow’, ‘flowViz’ are not available for package ‘flowStats’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowStats’
ERROR: dependencies ‘flowCore’, ‘flowViz’, ‘ncdfFlow’, ‘flowWorkspace’, ‘flowStats’, ‘flowClust’ are not available for package ‘openCyto’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/openCyto’

The downloaded source packages are in
    ‘/tmp/RtmpJ3O7kK/downloaded_packages’
Installation paths not writeable, unable to update packages
  path: /usr/lib/R/library
  packages:
    boot, class, cluster, codetools, foreign, MASS, Matrix, mgcv, nlme, nnet, rpart, spatial, survival
Warning messages:
1: In install.packages(...) :
  installation of package ‘flowCore’ had non-zero exit status
2: In install.packages(...) :
  installation of package ‘ncdfFlow’ had non-zero exit status
3: In install.packages(...) :
  installation of package ‘flowViz’ had non-zero exit status
4: In install.packages(...) :
  installation of package ‘flowClust’ had non-zero exit status
5: In install.packages(...) :
  installation of package ‘flowWorkspace’ had non-zero exit status
6: In install.packages(...) :
  installation of package ‘flowStats’ had non-zero exit status
7: In install.packages(...) :
  installation of package ‘openCyto’ had non-zero exit status

Thanks in advance!

DillonHammill commented 1 year ago

@avdvloet you will need to install cytolib before installing flowCore.

BiocManager::install("cytolib")
avdvloet commented 1 year ago

Seems I have a similar problem here:

boost/libs/filesystem/src/directory.cpp:134:15: error: ‘codecvt_type’ has not been declared
  134 |               codecvt_type const&)
      |               ^~~~~~~~~~~~
boost/libs/filesystem/src/directory.cpp: In function ‘boost::system::error_code boost::filesystem::detail::{anonymous}::dir_itr_increment(void*&, void*&, std::string&, boost::filesystem::file_status&, boost::filesystem::file_status&)’:
boost/libs/filesystem/src/directory.cpp:264:28: error: ‘dir_itr_close’ is not a member of ‘boost::filesystem::detail’; did you mean ‘dir_itr_imp’?
  264 |         return fs::detail::dir_itr_close(handle, buffer);
      |                            ^~~~~~~~~~~~~
      |                            dir_itr_imp
boost/libs/filesystem/src/directory.cpp: In function ‘void boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, const boost::filesystem::path&, unsigned int, boost::system::error_code*)’:
boost/libs/filesystem/src/directory.cpp:445:39: error: no matching function for call to ‘boost::filesystem::detail::dir_itr_imp::operator new(sizetype)’
  445 |         imp = new detail::dir_itr_imp();
      |                                       ^
In file included from boost/libs/filesystem/src/directory.cpp:17:
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:317:40: note: candidate: ‘static void* boost::filesystem::detail::dir_itr_imp::operator new(std::size_t, std::size_t)’
  317 |     BOOST_FILESYSTEM_DECL static void* operator new(std::size_t class_size, std::size_t extra_size) BOOST_NOEXCEPT;
      |                                        ^~~~~~~~
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:317:40: note:   candidate expects 2 arguments, 1 provided
boost/libs/filesystem/src/directory.cpp:449:25: error: cannot convert ‘const std::nothrow_t’ to ‘std::size_t’ {aka ‘long unsigned int’}
  449 |         imp = new (std::nothrow) detail::dir_itr_imp();
      |                    ~~~~~^~~~~~~
      |                         |
      |                         const std::nothrow_t
In file included from boost/libs/filesystem/src/directory.cpp:17:
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:317:89: note:   initializing argument 2 of ‘static void* boost::filesystem::detail::dir_itr_imp::operator new(std::size_t, std::size_t)’
  317 |     BOOST_FILESYSTEM_DECL static void* operator new(std::size_t class_size, std::size_t extra_size) BOOST_NOEXCEPT;
      |                                                                             ~~~~~~~~~~~~^~~~~~~~~~
boost/libs/filesystem/src/directory.cpp:463:48: error: ‘struct boost::filesystem::detail::dir_itr_imp’ has no member named ‘buffer’
  463 |                                           imp->buffer,
      |                                                ^~~~~~
boost/libs/filesystem/src/directory.cpp:481:16: error: ‘boost::intrusive_ptr<boost::filesystem::detail::dir_itr_imp> boost::filesystem::directory_iterator::m_imp’ is private within this context
  481 |             it.m_imp.swap(imp);
      |                ^~~~~
In file included from boost/libs/filesystem/src/directory.cpp:17:
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:417:49: note: declared private here
  417 |     boost::intrusive_ptr< detail::dir_itr_imp > m_imp;
      |                                                 ^~~~~
boost/libs/filesystem/src/directory.cpp:482:16: error: ‘boost::intrusive_ptr<boost::filesystem::detail::dir_itr_imp> boost::filesystem::directory_iterator::m_imp’ is private within this context
  482 |             it.m_imp->dir_entry.assign(p / filename, file_stat, symlink_file_stat);
      |                ^~~~~
In file included from boost/libs/filesystem/src/directory.cpp:17:
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:417:49: note: declared private here
  417 |     boost::intrusive_ptr< detail::dir_itr_imp > m_imp;
      |                                                 ^~~~~
boost/libs/filesystem/src/directory.cpp:498:12: error: ‘boost::intrusive_ptr<boost::filesystem::detail::dir_itr_imp> boost::filesystem::directory_iterator::m_imp’ is private within this context
  498 |         it.m_imp.reset();
      |            ^~~~~
In file included from boost/libs/filesystem/src/directory.cpp:17:
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/filesystem/directory.hpp:417:49: note: declared private here
  417 |     boost::intrusive_ptr< detail::dir_itr_imp > m_imp;
      |                                                 ^~~~~
boost/libs/filesystem/src/directory.cpp: In function ‘void boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)’:
boost/libs/filesystem/src/directory.cpp:520:56: error: ‘struct boost::filesystem::detail::dir_itr_imp’ has no member named ‘buffer’
  520 |                                              it.m_imp->buffer,
      |                                                        ^~~~~~
make: *** [/usr/lib/R/etc/Makeconf:177: boost/libs/filesystem/src/directory.o] Error 1
ERROR: compilation failed for package ‘cytolib’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/cytolib’
* restoring previous ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/cytolib’

The downloaded source packages are in
    ‘/tmp/RtmpJ3O7kK/downloaded_packages’
Installation paths not writeable, unable to update packages
  path: /usr/lib/R/library
  packages:
    boot, class, cluster, codetools, foreign, MASS, Matrix, mgcv, nlme, nnet, rpart, spatial, survival
Warning message:
In install.packages(...) :
  installation of package ‘cytolib’ had non-zero exit status
DillonHammill commented 1 year ago

Try pulling down the devel version from GitHub:

devtools::install_github("RGLab/cytolib")
DillonHammill commented 1 year ago

If you are installing from terminal you may need to install packages as sudo.

sudo R 
BiocManager::install("cytolib")
avdvloet commented 1 year ago

cytolib was installed successfully using the devel version. Still no luck with flowCore though. You recomend going for the devel installation here as well?

avdvloet commented 1 year ago
devtools::install_github("RGLab/flowCore")

Doesn't work either:

...

required from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_InputIterator, _InputIterator, std::input_iterator_tag) [with _InputIterator = boost::iterators::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::__cxx11::basic_string<char>, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, boost::use_default, boost::use_default>; _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]’
/usr/include/c++/11/bits/stl_vector.h:657:23:   required from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = boost::iterators::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::__cxx11::basic_string<char>, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, boost::use_default, boost::use_default>; <template-parameter-2-2> = void; _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::__cxx11::basic_string<char> >]’
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/algorithm/string/iter_find.hpp:186:31:   required from ‘SequenceSequenceT& boost::algorithm::iter_split(SequenceSequenceT&, RangeT&&, FinderT) [with SequenceSequenceT = std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >; RangeT = const std::__cxx11::basic_string<char>&; FinderT = boost::algorithm::detail::token_finderF<boost::algorithm::detail::is_any_ofF<char> >]’
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/algorithm/string/split.hpp:158:50:   required from ‘SequenceSequenceT& boost::algorithm::split(SequenceSequenceT&, RangeT&&, PredicateT, boost::algorithm::token_compress_mode_type) [with SequenceSequenceT = std::vector<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >; RangeT = const std::__cxx11::basic_string<char>&; PredicateT = boost::algorithm::detail::is_any_ofF<char>]’
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/cytolib/include/cytolib/compensation.hpp:55:15:   required from here
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/concept/usage.hpp:20:48: warning: ‘this’ pointer is null [-Wnonnull]
   20 |     ~usage_requirements() { ((Model*)0)->~Model(); }
      |                             ~~~~~~~~~~~~~~~~~~~^~
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/concept/usage.hpp:37:7: note: in a call to non-static member function ‘boost::SinglePassRangeConcept<T>::~SinglePassRangeConcept() [with T = const boost::iterator_range<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >]’
   37 |       ~model()
      |       ^
/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/BH/include/boost/range/concepts.hpp:284:9: note: in expansion of macro ‘BOOST_CONCEPT_USAGE’
  284 |         BOOST_CONCEPT_USAGE(SinglePassRangeConcept)
      |         ^~~~~~~~~~~~~~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:177: RcppExports.o] Error 1
ERROR: compilation failed for package ‘flowCore’
* removing ‘/home/anvlo/R/x86_64-pc-linux-gnu-library/4.1/flowCore’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/RtmpJ3O7kK/file1cfe2b6538c8/flowCore_2.9.1.tar.gz’ had non-zero exit status
DillonHammill commented 1 year ago

Can you try installing it as sudo from the terminal. I think some of your R packages required to build these packages (e.g. Rcpp) are installed system-wide and so root privileges are required.

avdvloet commented 1 year ago

Gives exactly the same output when I try with sudo R ...

avdvloet commented 1 year ago

@DillonHammill Any other ideas?

avdvloet commented 1 year ago

It worked. Updated my R version. Thanks for all the help

DillonHammill commented 1 year ago

Great! I was going to suggest that as a last resort.