xavierdidelot / TransPhylo

Reconstruction of transmission trees using genomic data
http://xavierdidelot.github.io/TransPhylo/
GNU General Public License v2.0
60 stars 22 forks source link

installation problem #5

Closed thkuo closed 6 years ago

thkuo commented 6 years ago

My R version is 3.4.3, and the g++ version is 5.4.0. I tried to reinstall transphylo after updating R, but it wasn't successful. Here are the messages:

> devtools::install_github('xavierdidelot/TransPhylo')
Downloading GitHub repo xavierdidelot/TransPhylo@master
from URL https://api.github.com/repos/xavierdidelot/TransPhylo/zipball/master
Installing TransPhylo
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmpxG6MNN/devtools1676630f312f/xavierdidelot-TransPhylo-9c9a54d'  \
  --library='/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4'  \
  --install-tests 

* installing *source* package ‘TransPhylo’ ...
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c probTTree.cpp -o probTTree.o
probTTree.cpp: In function ‘Rcpp::NumericVector wbar(double, double, double, double, double, double, double, double, double, double)’:
probTTree.cpp:152:20: error: ‘isnan’ was not declared in this scope
     if(isnan(out[i])) throw(Rcpp::exception("error!! NA value in calulating wbar."));
                    ^
probTTree.cpp:152:20: note: suggested alternatives:
In file included from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/platform/compiler.h:100:0,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/r/headers.h:48,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/RcppCommon.h:29,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp.h:27,
                 from probTTree.cpp:17:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/lexical_cast/detail/inf_nan.hpp:35:0,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:63,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/lexical_cast/detail/converter_lexical.hpp:54,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/lexical_cast/try_lexical_convert.hpp:42,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/lexical_cast.hpp:32,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/tools/convert_from_string.hpp:15,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/constants/constants.hpp:13,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/special_functions/gamma.hpp:24,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/special_functions/beta.hpp:15,
                 from /home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/distributions/negative_binomial.hpp:48,
                 from probTTree.cpp:19:
/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/special_functions/fpclassify.hpp:606:14: note:   ‘boost::math::isnan’
 inline bool (isnan)(T x)
              ^
/usr/lib/R/etc/Makeconf:168: recipe for target 'probTTree.o' failed
make: *** [probTTree.o] Error 1
ERROR: compilation failed for package ‘TransPhylo’
* removing ‘/home/thkuo/R/x86_64-pc-linux-gnu-library/3.4/TransPhylo’
Installation failed: Command failed (1)

The same command (ie. devtools) could work with my another machine (R version 3.4.1; g++ version 4.9.2). Can you please suggest some solutions?

thkuo commented 6 years ago

Problem solved. I replace isnan with std::isnan, and it was successfully installed.

xavierdidelot commented 6 years ago

Thanks for reporting both the issue and the solution! I have also replaced isnan with std::isnan in the github repository to avoid other users having the same problem.