[ITK] [ITK-dev] How to override optimization compile flag?

Lefman, Jonathan jonathan.lefman at intel.com
Mon May 22 16:55:25 EDT 2017


Hi all,

I am trying to override the -O3 flag using ITK_CXX_DISABLE_OPTIMIZATION_FLAG in ITKSetStandardCompilerFlags.cmake. It is not obvious how this is supposed to work. When I set ITK_CXX_DISABLE_OPTIMIZATION_FLAG in the cmake command or in CMAKE_CXX_FLAGS='-O0', the flag is overridden:

icpc: command line remark #10120: overriding '-O0' with '-O3'

Example:

# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.8

# compile CXX with /opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/icpc
CXX_FLAGS =  -O0  -w2 -wd1268 -wd981 -wd383 -wd1418 -wd1419 -wd2259 -wd1572 -wd424 -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual  -O3 -DNDEBUG -fPIE

I do see another variable "CXX_HAS_DISABLE_OPTIMIZATION_FLAG" but it is reported as unused by cmake. Please let me know the right way to remove the -O3 flag. Thanks very much.

-Jon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170522/a66c5e04/attachment.html>
-------------- next part --------------
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list