title: Compilation fails with "relocation R_X86_64_32 against '.rodata' can not be used when making a PIE object; recompile with -fPIE
body: <p>I'm trying to compile some source code from a makefile, but its not working. The error I get is</p>
  <pre><code>gfortran-9 -o sams43 sams43.o mvnorm.o isml_wrapper.o
  /usr/bin/ld: sams43.o: relocation R_X86_64_32 against '.rodata' can not be used when making a PIE object; recompile with -fPIE
  collect2: error: ld returned 1 exit status
  make: *** [makefile:7: sams43] Error 1
  </code></pre>
  <p>Here's my makefile:</p>
  <pre><code>FC=gfortran-9
  FCFLAGS= -g
  
  all: sams43 normal_dataset
  
  sams43: sams43.o mvnorm.o imsl_wrapper.o 
      ${FC} -o sams43 sams43.o mvnorm.o imsl_wrapper.o
  
  imsl_wrapper.o: imsl_wrapper.f90
      ${FC} ${FCFLAGS} -c imsl_wrapper.f90
  
  sams43.o: sams43.f90
      ${FC} ${FCFLAGS} -c sams43.f90
  
  mvnorm.o: mvnorm.f90
      ${FC} ${FCFLAGS} -c mvnorm.f90
  
  normal_dataset: normal_dataset.o mvnorm.o
      ${FC} -o normal_dataset normal_dataset.o mvnorm.o
  
  normal_dataset.o: normal_dataset.f90
      ${FC} ${FCFLAGS} -c normal_dataset.f90
  
  clean:
  #   rm *.o sams43 normal_dataset
  </code></pre>
  <p>I am using Ubuntu 20.04. My collaborator is able to compile the make file on an older version of ubuntu with no problems. The only difference between her make file and mine is that I changed 'FC=gfortran' to 'FC=gfortran-9'. This is because gfortran no longer works on my version of Ubuntu, so I am using gfortran-9 as my compiler instead.</p>
  <p>From reading other posts on here, it seems like it could be an issue with the flags that I'm using (i.e. the codes might have changed between the two fortran versions) but I've not been able to find any information on what flag to put in instead.</p>
  <p>I am very new to programming, and any help would be appreciated!</p>