I have a project where I link to the BLAS library using the -lcblas flag. It used to compile fine, until after upgrading my system to Ubuntu 18.04 and GCC 7.3.0. Anyway, the compile command is
g++ -o @$ benchmark.o mine.o -lcblas
which yields the error
/usr/bin/x86_64-linux-gnu-ld: benchmark.o: relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
This issue is possibly a duplicate, but I haven't been able to translate the solutions to other similar problems to my issue.