Re: [eigen] Getting started / Compiling and running your first program

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I agree that link to this:
http://eigen.tuxfamily.org/index.php?title=FAQ#How_do_I_get_good_performance.3F

is better than a complicated command line which includes -NDEBUG


How about an example with nice debug compile flags instead?

g++ -I /path/to/eigen/ my_program.cpp -o my_program -g -Og

This will already eliminate the biggest speed disadvantages, and will
be easier to debug, especially for the beginner (which is implicitly
addressed here).

Regards,
Thomas

On Thu, Jan 31, 2019 at 10:35 PM Christoph Hertzberg
<chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I agree on that we could/should mention that for good performance
> Eigen-code should be compiled with something like `-O2 -DNDEBUG
> -march=native` (`-mtune` is implied by `-march`). Or link to this:
> http://eigen.tuxfamily.org/index.php?title=FAQ#How_do_I_get_good_performance.3F
>
> I would however strongly discourage compiling with `-DNDEBUG` until you
> tested your code for correctness, since this prevents several trivial
> beginner mistakes (or rather exposes them). We actually also have quite
> a few questions/"bug reports" about unexpected behavior which was in
> fact caused by some wrong usage.
>
> Christoph
>
>
>
> On 31/01/2019 18.30, Thomas Klimpel wrote:
> > Hi,
> >
> > http://eigen.tuxfamily.org/dox/GettingStarted.html
> >
> > in section
> > Compiling and running your first program
> > suggests
> >
> > g++ -I /path/to/eigen/ my_program.cpp -o my_program
> >
> >
> > How about also suggesting an example with typical release compile
> > flags? Something like:
> >
> > g++ -I /path/to/eigen/ my_program.cpp -o my_program -O2 -DNDEBUG
> > -march=native -mtune=native
> >
> >
> > Not sure whether it would really save any beginner from unknowingly
> > benchmarking different linear algebra libraries in debug mode, but at
> > least we can try. (I just read such a benchmarking report, with Eigen
> > and PETSc as the libraries... As you can imagine, the C library had
> > some speed advantages over the C++ template library under those
> > circumstances.)
> >
> > Regards,
> > Thomas
> >
> >
> >
>
>
> --
>   Dr.-Ing. Christoph Hertzberg
>
>   Besuchsadresse der Nebengeschäftsstelle:
>   DFKI GmbH
>   Robotics Innovation Center
>   Robert-Hooke-Straße 5
>   28359 Bremen, Germany
>
>   Postadresse der Hauptgeschäftsstelle Standort Bremen:
>   DFKI GmbH
>   Robotics Innovation Center
>   Robert-Hooke-Straße 1
>   28359 Bremen, Germany
>
>   Tel.:     +49 421 178 45-4021
>   Zentrale: +49 421 178 45-0
>   E-Mail:   christoph.hertzberg@xxxxxxx
>
>   Weitere Informationen: http://www.dfki.de/robotik
>   -----------------------------------------------------------------------
>   Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
>   Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
>   Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
>   (Vorsitzender) Dr. Walter Olthoff
>   Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
>   Amtsgericht Kaiserslautern, HRB 2313
>   Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
>   USt-Id.Nr.:    DE 148646973
>   Steuernummer:  19/672/50006
>   -----------------------------------------------------------------------
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/