Topics

RQuantLib v4.0.0 for Ubuntu 20


Dirk Eddelbuettel
 

On 17 May 2020 at 01:36, John Paul Broussard wrote:
| I actually figured it out, though, and only though an attempt to "purge" QuantLib's install.

Excellent!

| So, user error on my part... I suppose sometimes I need to take a look at the build versions to insure they are the latest, or at least referencing the same version.

I was suspecting something but because it can be within the package sytem, or
without, it is hard to check. Sometimes it is the simple things eg

$ locate ql/quantlib.hpp

or

$ locate libQuantLib.so

to check you don't have a version in /usr AND in /usr/local.

Glad you have it working! And thanks for the kind words.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | @edd


John Paul Broussard
 

Yep.  I now see how my replies look like I am not providing new information, because I was not...  My bad.

I actually figured it out, though, and only though an attempt to "purge" QuantLib's install.

Let me see if I can answer your questions:
"_How_ did you install QuantLib?"

I was following the steps found here: https://www.quantlib.org/install/linux.shtml

Problem was, the tar referenced by that page contains the latest version of QuantLib, 1.18.  For whatever reason, though, some of my libquantlib* builds were for 1.17, so apparently, there was a conflict of some sort. When I uninstalled completely, e.g. "purged," and started from fresh, and then reinstalled, RQuantLib finally went all the way to install completion.

So, user error on my part... I suppose sometimes I need to take a look at the build versions to insure they are the latest, or at least referencing the same version.

Thanks for all the patience with this Dirk. I am converting over to Linux (using Ubuntu), so I am learning new things daily. Your videos on using the system are helping LOTS. Some of the "simple" things I used to know when I taught myself DOS 30+ years ago, are now becoming handy...

Thanks again for everything.


Dirk Eddelbuettel
 

On 16 May 2020 at 04:59, John Paul Broussard wrote:
| That's what's driving me crazy. My R works on everything. My QuantLib also appears to work - I tested it out using the example shown on the QuantLib.org site.  Rcpp loads, and appears to be working.  RQuantLib is the version you indicate, and it also appears to be working as well, it simply crashes at the very ending of the install:
|
| | ** testing if installed package can be loaded from temporary location
| | Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):
| | unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
| | /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb

Well, sorry to be blunt but we are going in circles. You have not supplied
new information I can act on here.

| | Error: loading failed
| | Execution halted
| | ERROR: loading failed
| | * removing ‘/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/RQuantLib’
|
| I do not understand the error:
|
| | Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):
| | unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
| | /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb
|
| If there is an "undefined symbol" I am not sure how to address the issue other than to fully remove QuantLib 1.18, which I believe I have done, but I must not have.  I am following all the steps on the QuantLib.org install page (even though it references version 1.14), and I have reinstalled 3x now.  I can only figure there is a "broken" link in the QuantLib install referenced in a /bin or /etc or other directory that I am missing when removing 1.18.

_How_ did you install QuantLib?

Obviously from the above your build of RQuantLib is unhappy about the
QuantLib used. I showed you in my last email that I using a prebuilt binary,
availble for the world to use too via the Launchpad PPA.

Am I guessing correctly that you are using a locally compiled one?

| Is there a way to perform a "purge" similar to "sudo apt purge..." ?

Purge of what?

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | @edd


John Paul Broussard
 

That's what's driving me crazy. My R works on everything. My QuantLib also appears to work - I tested it out using the example shown on the QuantLib.org site.  Rcpp loads, and appears to be working.  RQuantLib is the version you indicate, and it also appears to be working as well, it simply crashes at the very ending of the install:

| ** testing if installed package can be loaded from temporary location
| Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):
| unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
| /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ‘/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/RQuantLib’

I do not understand the error: 

| Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):

| unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
| /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb

If there is an "undefined symbol" I am not sure how to address the issue other than to fully remove QuantLib 1.18, which I believe I have done, but I must not have.  I am following all the steps on the QuantLib.org install page (even though it references version 1.14), and I have reinstalled 3x now.  I can only figure there is a "broken" link in the QuantLib install referenced in a /bin or /etc or other directory that I am missing when removing 1.18.

Is there a way to perform a "purge" similar to "sudo apt purge..." ?  


Dirk Eddelbuettel
 

On 14 May 2020 at 09:17, John Paul Broussard wrote:
| Thanks Dirk.  Unfortunately, I have loaded the latest QuantLib (1.18 I think) - still same RQuantLib install error.  I loaded the items you indicate, still same RQuantLib install error. Could there a library still "lingering" somewhere in my system from a previous "bad" install?  How might I completely purge QuantLib so that I can restart from the tar file downloaded from quantlib.org?

We would need more details. I am on 19.10, everything works and should / will
once upgraded. I would recommend you check and double-check all components: R
(works, I presume), Rcpp, QuantLib and then RQuantLib.

edd@rob:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan
edd@rob:~$ dpkg -l|grep quantlib|cut -c-79
ii libquantlib0-dev 1.18-1.1910.1
ii libquantlib0v5 1.18-1.1910.1
ii quantlib-examples 1.18-1.1910.1
ii quantlib-python 1.16-1.1904.0
edd@rob:~$ Rscript -e 'library(RQuantLib); packageVersion("RQuantLib")'
[1] ‘0.4.12’
edd@rob:~$

So my RQuantLib is from source.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | @edd


John Paul Broussard
 

Thanks Dirk.  Unfortunately, I have loaded the latest QuantLib (1.18 I think) - still same RQuantLib install error.  I loaded the items you indicate, still same RQuantLib install error. Could there a library still "lingering" somewhere in my system from a previous "bad" install?  How might I completely purge QuantLib so that I can restart from the tar file downloaded from quantlib.org?


Dirk Eddelbuettel
 

On 2 May 2020 at 06:43, John Paul Broussard wrote:
| I recently updated to Ubuntu 20.04, as well as to R v4. When updating packages, I ran into an issue with RQuantLib.
|
| As the attached indicates, all appears ok with QuantLib and Boost,
|
| * installing *source* package ‘RQuantLib’ ...
| ** package ‘RQuantLib’ successfully unpacked and MD5 sums checked
| ** using staged installation
| checking whether the C++ compiler works... yes
| checking for C++ compiler default output file name... a.out
| checking for suffix of executables...
| checking whether we are cross compiling... no
| checking for suffix of object files... o
| checking whether we are using the GNU C++ compiler... yes
| checking whether g++ -std=gnu++11 accepts -g... yes
| checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
| checking whether we are using the GNU C++ compiler... (cached) yes
| checking whether g++ -std=gnu++11 accepts -g... (cached) yes
| checking for R... yes
| checking for quantlib-config... yes
| checking for Boost development files... yes
| checking for minimal Boost version... yes
| configure: creating ./config.status
| config.status: creating src/Makevars
| Configured RQuantlib 0.4.12
|
| but when the final "steps" of the install occur:
|
| installing to /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs
| ** R
| ** data
| ** demo
| ** inst
| ** byte-compile and prepare package for lazy loading
| ** help
| *** installing help indices
| ** building package indices
| ** testing if installed package can be loaded from temporary location
| Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):
| unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
| /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ‘/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/RQuantLib’
|
| What am I missing?

edd@rob:~$ c++filt _ZN8QuantLib4Date11monthOffsetENS_5MonthEb
QuantLib::Date::monthOffset(QuantLib::Month, bool)
edd@rob:~$

A symbol missing in the library (or libraries) you link against. It usually
means you QuantLib is older than what RQuantLib wants.

You report, detailed as it was, omits that detail.

I tend to create .deb packages for my work on RQuantLib and put them here
https://launchpad.net/~edd in repo 'Miscelleneous Packages' (which seems to
have QL 1.10, 1.11, and 1.13). And sometimes I seem to put them in 'r-3.5'
(though they are not R related, I shouldn't do that) which has QL 1.15, QL
1.16, QL 1.17 and QL 1.18.

Which is what I run, currently still on 19.10:

edd@rob:~$ dpkg -l | grep quantlib | cut -c-79
ii libquantlib0-dev 1.18-1.1910.1
ii libquantlib0v5 1.18-1.1910.1
ii quantlib-examples 1.18-1.1910.1
ii quantlib-python 1.16-1.1904.0
edd@rob:~$

Feel free to fetch them from there too.


Or, if you're really lazy and just need a simple RQuantLib installation, try
the pre-built package from the distro (may conflict with R 4.0.0 though) or
Michael's PPA (if/when rebuilt, dunno about the timing; will support 4.0.0).

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | @edd


John Paul Broussard
 

I recently updated to Ubuntu 20.04, as well as to R v4. When updating packages, I ran into an issue with RQuantLib. 

As the attached indicates, all appears ok with QuantLib and Boost,

* installing *source* package ‘RQuantLib’ ...
** package ‘RQuantLib’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++11 accepts -g... (cached) yes
checking for R... yes
checking for quantlib-config... yes
checking for Boost development files... yes
checking for minimal Boost version... yes
configure: creating ./config.status
config.status: creating src/Makevars
Configured RQuantlib 0.4.12


but when the final "steps" of the install occur:

installing to /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RQuantLib’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so':
  /home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-RQuantLib/00new/RQuantLib/libs/RQuantLib.so: undefined symbol: _ZN8QuantLib4Date11monthOffsetENS_5MonthEb
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/fibrou/R/x86_64-pc-linux-gnu-library/4.0/RQuantLib’

What am I missing?