gfortran make error: "- recompile with -fPIC"

I am encountering an error when compiling a fortran program: since I have a makefile provided, I open the working directory in the terminal and type make. Unfortunately I get this error:

relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
makefile:43: recipe for target '<name>' failed

Actually I don't get how to "recompile with -fPIC".
I've tried typing make -fPIC and adding something like:

CFLAGS = -fPIC
CXXFLAGS = -fPIC

to the makefile, but both haven't worked.
Any help is appreciated, thanks.

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like