I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
| # Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 | |
| # Run instrumented program, generate and write pgo data | |
| ./runIt | |
| # Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 |