[Rquantlib-devel] Building rquantlib on windows

Michele Salvadore michele.salvadore at gmail.com
Wed Sep 24 18:42:50 CEST 2014


Hi there,

thanks for the heads up, the -std=c++0x flag got it going.
In regards to openMP support, I haven't found where to get it, any pointers?
I still have some error with the linkage, see below.
I am using Rtools31.exe as well as the Quantlib14 available here,
http://www.stats.ox.ac.uk/pub/Rtools/goodies/multilib/ (before I was using
my own built done with visual studio).
I also rebuilt Rcpp with the Rtools.
Any help is very much appreciated, thanks!

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source rquantlib

* installing to library 'C:/Program Files/R/R-3.1.1/library'
* installing *source* package 'RQuantLib' ...

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
g++ -m64 -shared -s -static-libgcc -o RQuantLib.dll tmp.def RcppExports.o
asian.o barrier_binary.o bermudan.o bonds.o calendars.o curves.o dates.o
daycounter.o discount.o hullwhite.o implieds.o modules.o utils.o vanilla.o
zero.o -LC:/workspace/lib/QuantLib/Quantlib14/lib/x64 -lQuantLib
-Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64
-Ld:/RCompile/CRANpkg/extralibs64/local/lib
-LC:/PROGRA~1/R/R-31~1.1/bin/x64 -lR
asian.o:asian.cpp:(.text+0x6d0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
asian.o:asian.cpp:(.text+0x920): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
asian.o:asian.cpp:(.text+0xad0): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
asian.o:asian.cpp:(.text+0x4a70): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
bonds.o:bonds.cpp:(.text+0x6c0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
bonds.o:bonds.cpp:(.text+0x1be0): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
bonds.o:bonds.cpp:(.text+0x1ed0): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
bonds.o:bonds.cpp:(.text+0x1df50): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
calendars.o:calendars.cpp:(.text+0x6c0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
calendars.o:calendars.cpp:(.text+0x59c0): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
calendars.o:calendars.cpp:(.text+0x5b70): multiple definition of
`QuantLib::Date Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
calendars.o:calendars.cpp:(.text+0x6210): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
curves.o:curves.cpp:(.text+0x6f0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
curves.o:curves.cpp:(.text+0x920): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
curves.o:curves.cpp:(.text+0x6280): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
curves.o:curves.cpp:(.text+0x6570): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
dates.o:dates.cpp:(.text+0x6c0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
dates.o:dates.cpp:(.text+0xa60): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
dates.o:dates.cpp:(.text+0xd50): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
dates.o:dates.cpp:(.text+0x11a0): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
hullwhite.o:hullwhite.cpp:(.text+0x6c0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
hullwhite.o:hullwhite.cpp:(.text+0xc30): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
hullwhite.o:hullwhite.cpp:(.text+0xf20): multiple definition of
`QuantLib::Date Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
hullwhite.o:hullwhite.cpp:(.text+0x5f60): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
modules.o:modules.cpp:(.text+0xab0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
modules.o:modules.cpp:(.text+0xce0): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
modules.o:modules.cpp:(.text+0x1500): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
modules.o:modules.cpp:(.text+0x2720): multiple definition of
`QuantLib::Date Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
utils.o:utils.cpp:(.text+0x6e0): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
utils.o:utils.cpp:(.text+0x2450): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
utils.o:utils.cpp:(.text+0x2740): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
utils.o:utils.cpp:(.text+0x9f40): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
vanilla.o:vanilla.cpp:(.text+0xa10): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
vanilla.o:vanilla.cpp:(.text+0xf10): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
vanilla.o:vanilla.cpp:(.text+0x1200): multiple definition of
`QuantLib::Date Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
vanilla.o:vanilla.cpp:(.text+0x95b0): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
zero.o:zero.cpp:(.text+0x890): multiple definition of `SEXPREC*
Rcpp::wrap<QuantLib::Date>(QuantLib::Date const&)'
RcppExports.o:RcppExports.cpp:(.text+0x8a0): first defined here
zero.o:zero.cpp:(.text+0xae0): multiple definition of
`std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
Rcpp::as<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x4a90): first defined here
zero.o:zero.cpp:(.text+0xdd0): multiple definition of `QuantLib::Date
Rcpp::as<QuantLib::Date>(SEXPREC*)'
RcppExports.o:RcppExports.cpp:(.text+0x6040): first defined here
zero.o:zero.cpp:(.text+0x4770): multiple definition of `SEXPREC*
Rcpp::wrap<std::vector<QuantLib::Date, std::allocator<QuantLib::Date> >
>(std::vector<QuantLib::Date, std::allocator<QuantLib::Date> > const&)'
RcppExports.o:RcppExports.cpp:(.text+0xad0): first defined here
C:/workspace/lib/QuantLib/Quantlib14/lib/x64/libQuantLib.a(normaldistribution.o):normaldistribution.cpp:(.data$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_3[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_3]+0x0):
multiple definition of `long double boost::math::detail::erf_inv_imp<long
double,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> >(long double const&, long double
const&,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> const&, mpl_::int_<64> const*)::P'
asian.o:asian.cpp:(.rdata$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_3[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_3]+0x0):
first defined here
C:/workspace/lib/QuantLib/Quantlib14/lib/x64/libQuantLib.a(normaldistribution.o):normaldistribution.cpp:(.data$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_4[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_4]+0x0):
multiple definition of `long double boost::math::detail::erf_inv_imp<long
double,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> >(long double const&, long double
const&,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> const&, mpl_::int_<64> const*)::P'
RcppExports.o:RcppExports.cpp:(.rdata$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_4[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1P_4]+0x0):
first defined here
C:/workspace/lib/QuantLib/Quantlib14/lib/x64/libQuantLib.a(normaldistribution.o):normaldistribution.cpp:(.data$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1Q_4[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1Q_4]+0x0):
multiple definition of `long double boost::math::detail::erf_inv_imp<long
double,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> >(long double const&, long double
const&,
boost::math::policies::policy<boost::math::policies::promote_float<false>,
boost::math::policies::promote_double<false>,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy,
boost::math::policies::default_policy> const&, mpl_::int_<64> const*)::Q'
asian.o:asian.cpp:(.rdata$_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1Q_4[_ZZN5boost4math6detail11erf_inv_impIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_RKSB_SD_RKT0_PKN4mpl_4int_ILi64EEEE1Q_4]+0x0):
first defined here
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'RQuantLib'
* removing 'C:/Program Files/R/R-3.1.1/library/RQuantLib'
* restoring previous 'C:/Program Files/R/R-3.1.1/library/RQuantLib'

Exited with status 1.


On 24 September 2014 15:36, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 24 September 2014 at 09:17, Bryan W. Lewis wrote:
> | On 9/24/14, Dirk Eddelbuettel <edd at debian.org> wrote:
> | > On 24 September 2014 at 11:29, Michele Salvadore wrote:
> | > | C:/Program
> | > Files/R/R-3.1.1/library/Rcpp/include/Rcpp/InputParameter.h:34:45:
> | > | instantiated from 'Rcpp::InputParameter<T>::operator T() [with T =
> long
> | > long
> | > | unsigned int]'
> | > | RcppExports.cpp:29:161:   instantiated from here
> | > | C:/Program
> | > Files/R/R-3.1.1/library/Rcpp/include/Rcpp/internal/Exporter.h:31:31:
> | > | error: invalid conversion from 'SEXP' to 'long long unsigned int'
> | >
> | > You may need to define the C++11 compilation so that we get 'long long'
> | > types. That is a known issue with Boost.  Or maybe we need to set a
> define
> | > to
> | > not request it -- I don't recall.
> |
> | I'll also try to experiment with this on Windows. I hit something
> | similar to this a while back and used the newer int64_t type from
> | inttypes.h. I'll let you know what I find...
>
> Really appreciate it. I have a fair amount of changes (from older SEXP
> interfaces to newer, cleaner Rcpp Attributes-supported code) in the repo
> and
> am due a new version anyway.  This may fit it in nicely too.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rquantlib-devel/attachments/20140924/fc89442c/attachment-0001.html>


More information about the Rquantlib-devel mailing list