Re: [eigen] Eigen2 to Eigen3 Migration Path |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen2 to Eigen3 Migration Path
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 12 Jan 2011 09:48:22 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=c9mnMuivWj7PMGIR3rpXCEEd8mymUw7UeOXjPBSTey0=; b=A5av/VUnzcPodz39Ef8YwRgHYOx3hrxbWOlf7BhTBLE41PaYNPX1PFyVL0H2uarc2I +q90i/Mk8/rSuopzY9f5lR5po/uNZ8U9m7Cpl4Ot7J4pi7AD8GKkWE6mgyKXQlav3zAp 6XvwEgOjeYGAtFpHKDiRAeOZ0nyF2c7rfw78M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=VJ2yHzfwzLkonXN0/fRfI/tzduryusvDOHvdzk4ZrW9qf8MyT/UQICc1d5mE4zwGJp C8bsY3pbv8IHQiLSeLz882r1YDZHwli9UclaF34E7Sjnqb8xaLr7JQ2spterXu29J4cW MJOCBZ8VaejOX+CLrW1IS6Uq0C5egp4wLX9A8=
2011/1/12 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> 2011/1/12 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>> OK, thought about this some more.
>>
>> If EIGEN2_SUPPORT doesn't work for you, then here's what you can do:
>>
>> * about the namespace & mangling: go ahead with your Eigen -> Eigen3
>> renaming, this is a non-issue.
>
> Ah wait ... :) the linking is indeed a non-issue, but at compilation
> time, if the same file includes another library's headers that uses
> Eigen3 with the Eigen namespace non-renamed, this will fail.
ok last spam... sorry about the noise, there is a linking issue if a
binary library uses Eigen types in its API.
But this is actually also an argument against the EIGEN2_SUPPORT way.
Indeed, Eigen's type don't mangle in the same way between Eigen2 and
Eigen3, due to different default values of template parameters.
For example, in Eigen2, Matrix3f is Matrix<float,3,3,2,3,3>
But in Eigen3, Matrix3f is Matrix<float,3,3,0,3,3>
So the EIGEN2_SUPPORT solution won't solve linking issues.
At this point I still think that we should go on with the invasive
Eigen->Eigen3, EIGEN_->EIGEN3_ change. We can announce this change
very loudly. For users, adapting to it just some search&replace:
namespace Eigen -> namespace Eigen3
Eigen:: -> Eigen3::
EIGEN_ -> EIGEN3_
Benoit
>
> Benoit
>
>> Indeed, every .cpp files that makes
>> Eigen calls, #includes the corresponding Eigen sources itself, so it
>> will never have to link to another object file to find a function
>> definition. This means that the only bad effect of this namespace
>> renaming is at worst to have redundant code (the same function
>> compiled with Eigen and with Eigen3) which is not a big deal since
>> it's temporary. You won't get linking failures, and you won't
>> accidentally link to the wrong function definition.
>>
>> * about the include guards and macros, first of all check if it is
>> really the case that a single .cpp file really needs to include both
>> eigen2 and eigen3, as opposed to separate .cpp files, some linking to
>> eigen2 and some to eigen3 ?
>>
>> Benoit
>>
>> 2011/1/12 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>>> 2011/1/12 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>>>> On Wed, Jan 12, 2011 at 1:57 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>>>> The trivial solution would have been to replace Eigen by Eigen3 and
>>>>> EIGEN_ by EIGEN3_ everywhere in the Eigen3 sources, but that is quite
>>>>> invasive at this stage.
>>>>>
>>>>> However, given that that solves the problem once and for all, also for
>>>>> any future version, it's quite tempting.
>>>>>
>>>>> Would you agree with such a change?
>>>>
>>>> but think about the hundreds of projects which are already using
>>>> Eigen3... I'm afraid this is much too late for such a change. Let's
>>>> first see whether EIGEN2_SUPPORT could not solve the issue.
>>>
>>> My assumption here was that Eigen2 still has many more users than
>>> Eigen3 has, but indeed experimental data proves me wrong:
>>> http://stats.tuxfamily.org/eigen.tuxfamily.org/
>>> I copied the list of visited pages on our website with number of
>>> visits in January 2011, and did:
>>>
>>> bjacob@cahouette:~$ grep /dox/ stats | cut -f 2 -d ' ' | awk '{ SUM +=
>>> $1} END { print SUM }'
>>> 663
>>> bjacob@cahouette:~$ grep /dox\-devel/ stats | cut -f 2 -d ' ' | awk '{
>>> SUM += $1} END { print SUM }'
>>> 617
>>>
>>> So we seem to have almost as many users on Eigen3 as we have on Eigen2.
>>>
>>> Solving the present problem with EIGEN2_SUPPORT would be great indeed.
>>> Let's wait to hear back from Tully about that. We can probably extend
>>> EIGEN2_SUPPORT to do many more things you may need.
>>>
>>> Benoit
>>>
>>>
>>>>
>>>> gael
>>>>
>>>>
>>>>
>>>
>>
>