Tensorflow compilation "-Wno-sign-compare" flag meaning

0

When I build tensorflow from source I get prompted:

Please specify optimization flags to use during compilation when bazel option "-config=opt" is specified[Default is -march=native --Wno-sign-compare]

WHat is the menaning of the flag -Wno-sign-compare?

Thanks!

J.Horcasitas

Posted 2019-02-02T12:33:11.837

Reputation: 1

Answers

1

The flag

--Wno-sign-compare

tells the gcc compiler to ignore 'comparison between signed and unsigned integer expressions' i.e. to not throw warnings for them. Cf. also question https://stackoverflow.com/q/4377948 and its answers.

For the other flags, cf. e.g. Instruction Set table on https://technofob.com/2019/06/14/how-to-compile-tensorflow-2-0-with-avx2-fma-instructions-on-mac/

For example, to use most typical flags (?), and keep the -Wno-sign-compare, I used

-mavx -mavx2 -mfma -msse4.2 -Wno-sign-compare

when prompted with the same default you showed during installation.

moujouexchange

Posted 2019-02-02T12:33:11.837

Reputation: 11

Also related to -Wall and -Wextra. :) https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options

– 174140 – 2019-08-05T11:40:51.407