1
votes

I am working on a Fortran code that plots some data and I am having the following error:

Undefined symbols for architecture x86_64:
  "_hplots_", referenced from:
      _MAIN__ in ifortaBEBFS.o
      _clspak_ in ifortaBEBFS.o
      _opnpak_ in ifortaBEBFS.o
  "_number_", referenced from:
      _MAIN__ in ifortaBEBFS.o
     (maybe you meant: _for__this_image_number_or_zero)
  "_plot_", referenced from:
      _MAIN__ in ifortaBEBFS.o
      _pltline_ in ifortaBEBFS.o
ld: symbol(s) not found for architecture x86_64

The error comes from:

character*32 filenm
    open(8,file=filenm)
    call hplots(1,1,8,0)
    return
    end

I am just trying to compile the .f code with ifort or gfortran.

The code comes from the following git repository https://github.com/usgs/finite-fault/blob/db126a5e05dd2ca1950909ac0be9811cfe115019/src/plot/vangodshJ.f

1
Please show how you compile/link this. In particular, how are you providing the library/object which contains the subroutine hplots? - francescalus

1 Answers

0
votes

First I didnt had Generic Mapping Tools so I had to install it. Also the program needed two other fortran codes that were not in the same folder so moving them to the same folder and compiling it as follows solved the problem.

ifort vangodshJ.f calpak.f laspac.f -o vangodshJ.out