kaskr / adcomp

AD computation with Template Model Builder (TMB)
Other
176 stars 80 forks source link

Compilation error when including a boost::multiprecision header #327

Open yulanvanoppen opened 4 years ago

yulanvanoppen commented 4 years ago

Description:

A compilation error is generated upon including the boost/multiprecision/cpp_dec_float.hpp

Reproducible Steps:

Compiling (running library(TMB); compile("file.cpp") in R) the following C++ code currently generates a compilation error:

#include <TMB.hpp>

#include <boost/multiprecision/cpp_dec_float.hpp>       // high precision floats

template<class Type>
Type objective_function<Type>::operator() () {
    return Type(0);
}

However, this is not an issue when including boost/multiprecision/cpp_bin_float.hpp instead.

Current Output:

make: *** [/usr/lib/R/etc/Makeconf:177: file.o] Error 1
Error in compile("mwe.cpp") : Compilation failed

Expected Output:

g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o file.so file.o -L/usr/lib/R/lib -lR

TMB Version:

1.7.18

R Version:

R version 3.6.3 (2020-02-29)

Operating System:

Ubuntu 20.04 LTS