[FLASH-USERS] undefined references in Simulation_init during linking

Lynn Reid lynnreid at flash.uchicago.edu
Sat Jul 5 22:33:11 EDT 2008


I assume you've remembered to say
  use Simulation_data, ONLY: simGamma, simGdirec, simGvector
in the declarations of the Simulation_init routine.

Also, the routine RuntimeParameters_get is an overloaded function.  You 
MUST include a statement similar to
  use RuntimeParameters_interface, ONLY : RuntimeParameters_get
at the top of your Simulation_init routine.  If you don't, all sorts of 
mysterious things happen which depend upon the particular
compiler.   The parameter 'gamma' should appear in your flash.par and 
simGamma in your Fortran file.

And finally, don't forget to create a Makefile in your 
SimulationWhatever directory like this:
# Makefile for Ken Dere's problem
# [/source/Simulation/SimulationMain/Dere]
Simulation += Simulation_data.o

If you don't have a Makefile, the compiler won't realize that there are 
dependencies.

Lynn


Ken Dere wrote:
> I am trying to set up a new problem that bombs when I get to the link 
> stage.  I get the following:
>
> Simulation_init.o: In function `simulation_init_':
> Simulation_init.F90:(.text+0xa): undefined reference to 
> `__simulation_data_MOD_simgamma'
> Simulation_init.F90:(.text+0x1e): undefined reference to 
> `__simulation_data_MOD_simgdirec'
> Simulation_init.F90:(.text+0x32): undefined reference to 
> `__simulation_data_MOD_simgvector'
>
> plus a few more like this
>
> this comes from calling, in Simulation_init
>
>  call RuntimeParameters_get('gamma',  simGamma)
>
>  call RuntimeParameters_get('grv_direc',  simGdirec)
>  call RuntimeParameters_get('grv_vector'  ,simGvector)
>
> simGamma is defined in Simulation_data.
>
> I am able to compile and link the sample programs that I have tried 
> and I just don't see what I am doing wrong.
>
> suggestions are welcomed.
>
> best regards,
>
> Ken Dere


-- 
Dr. Lynn B. Reid                lynnreid at uchicago.edu
Scientific Programmer, ASC Flash Center, RI473
University of Chicago, IL USA 60637
+1-773-702-0624
Don't anthropomorphize computers.  They don't like it.




More information about the flash-users mailing list