# Libavogadro and Eigen

**URL:** <https://discuss.avogadro.cc/t/libavogadro-and-eigen/461>\
**Category:** Development\
**Created:** [January 8, 2007, 4:21pm UTC](https://discuss.avogadro.cc/t/libavogadro-and-eigen/461 "2007-01-08T16:21:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armando\_Navarro\_Vazq](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/a/b77776/32.png) [@Armando\_Navarro\_Vazq](https://discuss.avogadro.cc/u/Armando_Navarro_Vazq)\
**Post date:** [January 8, 2007, 4:21pm UTC](https://discuss.avogadro.cc/t/libavogadro-and-eigen/461/1 "2007-01-08T16:21:30Z")

</div>

Dear All:  
First of all, happy new year  
I have been quite inactive lately due to familiar problems, I am happy to see  
that a lot of new things have been already done.  
Respect to the use of Eigen for libavogadro, Kalzium and likely Kryomol…  
These templates are designed for row major C-matrices, however if would be  
great if storage could be also done as column major since most linear algebra  
libraries are fortran based (LAPACK).  
I will start the porting of Kryomol to KDE4 next month and I will use now  
libavogadro for the rendering engine, I will report all the problems I face.

Only one thing, I think that methods such as getMolecule should be also  
duplicatead as const Molecule\* getMolecule() const for const correctness.

And finally one problem I have been struggling with Kryomol, the propietary  
ATI drivers are linked against libstdc++.so.5, however most systems  
implemente now libstdc++.so.6, I dont know why ( should not be versioned the  
libraries ? ), KryoMol is calling std library from both versions and nasty  
memory errors take place. Anyone of you have any idea how to tackle the  
problem?

My best wishes

–  
Dr. Armando Navarro-Vázquez  
Departamento de quimica organica  
Universidade de Santiago de Compostela  
[http://desoft03.usc.es/armando/index.html](http://desoft03.usc.es/armando/index.html)

---

<div class="post-metadata">

**Author:** ![Benoit\_Jacob](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/b/e9c0ed/32.png) [@Benoit\_Jacob](https://discuss.avogadro.cc/u/Benoit_Jacob)\
**Post date:** [January 8, 2007, 4:38pm UTC](https://discuss.avogadro.cc/t/libavogadro-and-eigen/461/2 "2007-01-08T16:38:19Z")

</div>

Hi Armando

On Mon, 8 Jan 2007, Armando Navarro Vázquez wrote:

> Respect to the use of Eigen for libavogadro, Kalzium and likely Kryomol…  
> These templates are designed for row major C-matrices,

No, Eigen uses colum-major storage, like OpenGL 🙂 don’t know where you  
got the impression that it used row-major storage from 🙂

And thanks for your interest in Eigen, you’re making the right choice 🙂

> however if would be  
> great if storage could be also done as column major since most linear algebra  
> libraries are fortran based (LAPACK).

Well, if they use column-major storage, then all is fine since that’s what  
Eigen uses; however I seem to remember that some of the “big libraries”  
propose the two possibilities, column-major or row-major.

If you ever had a need for that, one could consider also providing the two  
possibilities in Eigen. Eigen is extensible in that respect.  
However I won’t do it unless there’s a real need for it.

> I will start the porting of Kryomol to KDE4 next month and I will use now  
> libavogadro for the rendering engine, I will report all the problems I face.

Cool news, I’m of course also considering porting Kalzium 3d to  
libavogadro, however that’ll have to wait until I have some time 🙂

> And finally one problem I have been struggling with Kryomol, the propietary  
> ATI drivers are linked against libstdc++.so.5, however most systems  
> implemente now libstdc++.so.6, I dont know why ( should not be versioned the  
> libraries ? ), KryoMol is calling std library from both versions and nasty  
> memory errors take place. Anyone of you have any idea how to tackle the  
> problem?

I don’t know a solution, sorry. I can only suggest that you don’t spend  
time on this problem: it’s a problem in ATI’s drivers, not in your own  
software. Just refuse to do more work just because ATI didn’t do its own  
work properly. The best you can do is e-mail ATI about that, and in  
KryoMol use the GL\_RENDERER or GL\_VENDOR string to detect when the ATI  
proprietary driver is used, and in that case let the user know that  
because of a bug in the ATI driver, the app might crash. Just so the user  
doesn’t believe it’s KryoMol’s fault.

Benoit

---

<div class="post-metadata">

**Author:** ![Donald\_Ephraim\_Curti](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/donald_ephraim_curti/32/280_2.png) [@Donald\_Ephraim\_Curti](https://discuss.avogadro.cc/u/Donald_Ephraim_Curti)\
**Post date:** [January 8, 2007, 6:08pm UTC](https://discuss.avogadro.cc/t/libavogadro-and-eigen/461/3 "2007-01-08T18:08:23Z")

</div>

> Only one thing, I think that methods such as getMolecule should be also  
> duplicatead as const Molecule\* getMolecule() const for const correctness.

Yeah no problem. One area i’m REALLY bad at is doing const’s. I never  
figure where it’s really important to do so and so i normally just hope  
everything plays nice. I in no way think it’s a good thing. I’ll do  
what i can and any place you feel there should be a const let me know.

Just a word of warning. While libavogadro is pretty stable it’s still  
very new. The engines haven’t all been converted to the new plugin  
style (right now only ball and stick) and i haven’t finallized all the  
function calls. However all interface to and from the GLWidget is  
pretty much set which is really all you guys need. So it should be very  
close. I don’t want to discourage you though because having two major  
projects use it will definatly help it’s development. Thanks for the  
interest.

-Donald
