So, I have a program that runs with OpenBlas and I want to compile it. The linking process looks like this:
gcc -o prog prog.o -O3 -I/opt/OpenBLAS/include -L/opt
Add the path to the runtime library search path.
gcc -Wl,-rpath=/opt/OpenBlas/lib ...
What the -L option does at link time, the -rpath option does at run time.
-L
-rpath