Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with other Eigen Dependents Template Libraries #18

Closed
MehdiN opened this issue Mar 29, 2021 · 2 comments
Closed

Conflict with other Eigen Dependents Template Libraries #18

MehdiN opened this issue Mar 29, 2021 · 2 comments

Comments

@MehdiN
Copy link

MehdiN commented Mar 29, 2021

I noticed conflict happens when RandEigen is used alongside another library which also uses eigen.
The conflict only happens with the definition of plgamma

<command-line>: note: this is the location of the previous definition
In file included from /usr/include/eigen3/unsupported/Eigen/SpecialFunctions:47,
                 from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:30,
                 from /opt/ros/noetic/include/pinocchio/fwd.hpp:31,
                 [...]
/usr/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h:19:8: error: redefinition of ‘template<class Packet> Packet Eigen::internal::plgamma(const Packet&)’
   19 | Packet plgamma(const Packet& a) { using numext::lgamma; return lgamma(a); }
      |        ^~~~~~~
In file included from /usr/local/include/EigenRand/RandUtils.h:15,
                 from /usr/local/include/EigenRand/Core.h:16,
                 from /usr/local/include/EigenRand/EigenRand:17,
                 [...]
/usr/local/include/EigenRand/MorePacketMath.h:181:30: note: ‘template<class Packet> Packet Eigen::internal::plgamma(const Packet&)’ previously declared here
  181 |   EIGEN_STRONG_INLINE Packet plgamma(const Packet& x)
      |                              ^~~~~~~

Once plgamma is commented, it compiles just fine. (Also removing the comments and compiling a second time does not
raise any error. The error comes for the first build or after a make clean).

I tried to avoid circular declaration in my own code, it might be an error from my side but I reported it just in case.

CXX compiler: GNU 9.3.0
cmake version 3.16.3
Eigen 3.3.7
RandEigen version 0.3.2

@bab2min
Copy link
Owner

bab2min commented Mar 30, 2021

Hi @MehdiN,
Thank you for your reporting.
I didn't know there is another plgamma in Eigen's SpecialFunctionsPacketMath.h.
I'll rename my plgamma for preventing conflicts in the next update.

bab2min added a commit that referenced this issue Mar 30, 2021
fixed conflicts with SpecialFunctionsPacketMath (#18)
@bab2min
Copy link
Owner

bab2min commented Mar 30, 2021

Solved in version 0.3.3.

@bab2min bab2min closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants