[gmx-developers] Turning off optimization
David van der Spoel
spoel at xray.bmc.uu.se
Wed Jul 1 10:38:24 CEST 2009
Erik Lindahl wrote:
> On Jul 1, 2009, at 10:25 AM, Mark Abraham wrote:
>
>> David van der Spoel wrote:
>>> Hi,
>>> how do I turn off optimization when compiling gromacs, now that it
>>> has become much more difficult to use CFLAGS, CXXFLAGS etc.?
>>> --disable-cpu-optimization drops the optimization from -03 to 02, but
>>> I don't want any optimization (not just for debugging but because my
>>> code does not compile otherwise).
>
> That is compiler-dependent, so you'll have to create your own CFLAGS
> string. I can't imagine it *that* difficult to cut-and-paste the default
> CFLAGS you see for a compile and then add "-O0".
Ok then...
>
> If your code doesn't compile with -O2, I would definitely say you need
> debugging ;-)
>
Debugging the compiler, indeed. It is just few thousand lines like
x = a + b -c and so on (note a few thousand lines in one expression).
Compiler goes out of memory and/or plain crashes with a SEGV trying to
optimize that.
>> Sounds like whatever mechanism is being used by
>> --disable-cpu-optimization should be used by a new option
>> --disable-all-optimization as well. Why is CFLAGS now harder to use?
>
>
> Not all compilers support ISO C99 by default (not mandatory, but we try
> to use it when possible), and there might be some code temporarily that
> requires SSE intrinsics support on x86...
>
>
> --disable-cpu-optimization is quite a bit different; this option tries
> to find optimizations for the actual *CPU* you are using by checking
> cache sizes, architecture (e.g. Power6-specific, won't work on Power5+,
> etc.). Disabling means we don't try this. There is no standard way to
> disable all optimizations for all compilers, so I'd rather not give the
> user the impression it is disabled just because they use such an option!
>
> Cheers,
>
> ERik
>
> ------------
> Erik Lindahl <lindahl at cbr.su.se> Backup: <erik.lindahl at gmail.com>
> Associate Professor, Computational Structural Biology
> Center for Biomembrane Research, Dept. Biochemistry & Biophysics
> Stockholm University, SE-106 91 Stockholm, Sweden
> Tel: +46(0)8164675 Mobile: +46(0)703844534 Fax: mail a PDF instead
>
>
>
>
>
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use thewww
> interface or send it to gmx-developers-request at gromacs.org.
--
David.
________________________________________________________________________
David van der Spoel, PhD, Professor of Biology
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596, 75124 Uppsala, Sweden
phone: 46 18 471 4205 fax: 46 18 511 755
spoel at xray.bmc.uu.se spoel at gromacs.org http://folding.bmc.uu.se
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the gromacs.org_gmx-developers
mailing list