3 ms·
So if I'm compiling PostgreSQL from source, should I be doing: export CFLAGS='-O3 -march=native' Before ./configure? Because if I don't, it's using -O2 wi
by latch 6y ago
So if I'm compiling PostgreSQL from source, should I be doing:
export CFLAGS='-O3 -march=native'
Before ./configure? Because if I don't, it's using -O2 without specifying an architecture.
- ok123456 6y agoOnly use -march=native if you're never-ever going to run the binary on another machine. This includes upgrading the processor or data rescue.
- ddalex 6y agoWhat does data at rest has to do with the cpu architecture ?
- ok123456 6y agomarch=native turns on all the features for that are available for your processor. So if, for example, you have a processor that supports AVX512 and another that doesn't, you'll get illegal instruction errors as soon as your other machine hits a region code it decided to optimize using those instructions. You won't get any real useful error messages when this happens since it's so low level. Unless you know to look for this you'll just be scratching your head going, "but it works on my machine?!?"