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?


1 Answer 1


The flag


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .