eddelbuettel / rquantlib

R interface to the QuantLib library
119 stars 50 forks source link

Cannot install on Ubuntu 14.04.5 LTS (‘HalfMonthModifiedFollowing’ is not a member of ‘QuantLib’, etc) #84

Closed SteveBronder closed 7 years ago

SteveBronder commented 7 years ago

I'm following the instructions for instillation from @eddelbuettel 's website

http://dirk.eddelbuettel.com/code/rquantlib.html

When I try to install libquantlib0 and libquantlib-dev I get

sudo apt-get install libquantlib0 libquantlib-dev
...
E: Unable to locate package libquantlib-dev

So I just install libquantlib0.

Running install.packages("RQuantLib") starts running then fails with output

...
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/steve/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include"  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -I/usr/include -fpermissive -I../inst/include -I. -fopenmp -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c utils.cpp -o utils.o
utils.cpp: In function ‘QuantLib::BusinessDayConvention getBusinessDayConvention(double)’:
utils.cpp:410:16: error: ‘HalfMonthModifiedFollowing’ is not a member of ‘QuantLib’
         return QuantLib::HalfMonthModifiedFollowing;
                ^
utils.cpp:412:16: error: ‘Nearest’ is not a member of ‘QuantLib’
         return QuantLib::Nearest;
                ^
make: *** [utils.o] Error 1
ERROR: compilation failed for package ‘RQuantLib’
* removing ‘/home/steve/R/x86_64-pc-linux-gnu-library/3.3/RQuantLib’
Warning in install.packages :
  installation of package ‘RQuantLib’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp79wZ99/downloaded_packages’

I assume this is all because I do not have libquantlib-dev available. Is this under a new name?

Session info

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] mlr_2.10         ParamHelpers_1.9 devtools_1.12.0 

loaded via a namespace (and not attached):
 [1] parallelMap_1.3  Rcpp_0.12.8      plyr_1.8.4       tools_3.3.2      xts_0.9-7       
 [6] digest_0.6.10    lubridate_1.6.0  memoise_1.0.0    tibble_1.2       gtable_0.2.0    
[11] checkmate_1.8.2  lattice_0.20-34  Matrix_1.2-7.1   rstudioapi_0.6   shiny_0.14.2    
[16] DBI_0.5-1        parallel_3.3.2   withr_1.0.2      dplyr_0.5.0      stringr_1.1.0   
[21] ggvis_0.4.3      grid_3.3.2       data.table_1.9.6 R6_2.2.0         survival_2.40-1 
[26] ggplot2_2.1.0    magrittr_1.5     backports_1.0.4  scales_0.4.0     BBmisc_1.10     
[31] htmltools_0.3.5  splines_3.3.2    assertthat_0.1   mime_0.5         colorspace_1.2-7
[36] xtable_1.8-2     httpuv_1.3.3     stringi_1.1.2    munsell_0.4.3    chron_2.3-47    
[41] zoo_1.7-13      

Thank you for your time

eddelbuettel commented 7 years ago

The easiest for you is just to follow what the travis.yml file does:

sudo add-apt-repository -y ppa:edd/misc

which will tell your system about another PPA which has the newer QuantLib you need on your outdated Ubuntu system. (What you really want to do is to use Ubuntu 16.04 for which the PPA also has current QL.)

eddelbuettel commented 7 years ago

Or course you could also just pick the two required files by hand from the PPA.