Re: [eigen] Eigen in a namespace? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen in a namespace?
- From: Vincent Vanhoucke <vanhoucke@xxxxxxxxxx>
- Date: Fri, 06 Apr 2018 15:30:08 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=oCNXYlxa+4fpz9rB+hhKhZCfUFs+ph8kEWQP3/NGDWE=; b=m3bLywggzTv47+Yz1r1FJAzpUeRM8pN2W6olUzMICFTf35txkYPZYa0+T4l0dAD6ol mTONbXaOy6BcRcZmeaBO1os5K/cdscPjgn19Tz6iewDKnXllzoJZmoZClU1IkZ6+WqWO EA/ivn/6wZEpkB8c618Fdyz8IBndWYODOWlRB5xFawbSTowITefe5mkLgWd63B+orBix 8+U2ENpdYz8t/nVhnuVrNq61g0cKcGcBh7C8x1pllbMMhjVZNaPLNSixZcGUSrm9lg2I expnYP7o132UncDaNXTfHV7zCmryuUINdIiReZKVBOqgM6yg40NzC4NB98sjnhK6E3PU oZ2Q==
It's a terrible hack, and you didn't hear it from me, but if you only use Eigen in a narrow scope, you can fake a namespace by compiling with: -DEigen=EigenNotToBeLinkedAgainst
Not directly an answer to your question, but a possible resolution (on a
linux or unix-like system anyway) ...
Would it help to build your shared object binaries with
-fvisibility=hidden, so the contained library is not visible outside the
..so? Thus no name collisions.
This might fail if you need the public interface to use the eigen ABI.
-- Mark
On 04/06/2018 09:35 AM, Robert Lupton the Good wrote:
> We've been using eigen (at a lowish level) for quite a time in a large astronomical software project, the LSST, and now have the desire to include a semi-external package; both use eigen.
>
> For packaging reasons the semi-external package would like to include its own copy of the eigen headers (probably as a sub-module from git), so we potentially have two copies of eigen in the same dynamically-loaded package (both imported into python). We're worried about ABI/API issues as eigen evolves in interesting ways.
>
> One way to fix this would be to include eigen in different namespaces (maybe anonymous?) in the two packages, but I don't think that this is possible due to eigen's use of the STL. Is there any way to do this now? Or alternatively would it be crazy to restructure the eigen includes to allow us to include a header outside our namespace that pulls in the STL, and then the "real" eigen headers inside our namespace?
>
> R
>