Find the answer to your Linux question:
Results 1 to 4 of 4
Im trying to compile some fortran code on a Solaris machine using the G95 fortran compiler. On my linux laptopthe code compiles perfectly fine with the g95 compiler. On the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2005
    Posts
    4

    Problem with compiling on a Solaris system


    Im trying to compile some fortran code on a Solaris machine using the G95 fortran compiler. On my linux laptopthe code compiles perfectly fine with the g95 compiler. On the solaris machine i get the following error message. Im sorry its a tad long!

    Undefined first referenced
    symbol in file
    mo_dyn_MP_tgas.data dynamic.o
    mo_dyn_MP_wtrac.data dynamic.o
    mo_dyn_MP_wice.data fallvel_kes.o
    mo_dyn_MP_cpwat kessler.o
    mo_dyn_MP_cphum background.o
    mo_dyn_MP_cvhum background.o
    mo_dyn_MP_wash.data fallvel_kes.o
    mo_dyn_MP_wetflx.data fire.o
    mo_dyn_MP_hglflx.data kessler.o
    mo_dyn_MP_iceflx.data kessler.o
    mo_dyn_MP_wsto.data fallvel_kes.o
    mo_dyn_MP_whgl.data fallvel_kes.o
    mo_dyn_MP_tgasnew.data dynamic.o
    mo_dyn_MP_watpnew.data grads.o
    mo_dyn_MP_cvtrac.data initial.o
    mo_dyn_MP_cptrac.data dynamic.o
    mo_dyn_MP_radwatc kessler.o
    mo_dyn_MP_radwatp kessler.o
    mo_dyn_MP_tgasflx.data dynamic.o
    mo_dyn_MP_tracflx.data dynamic.o
    mo_dyn_MP_watcflx.data kessler.o
    mo_dyn_MP_watpflx.data kessler.o
    mo_dyn_MP_cvtgas.data dynamic.o
    mo_dyn_MP_cptgas.data dynamic.o
    mo_dyn_MP_radice fallvel_kes.o
    mo_dyn_MP_radhgl kessler.o
    mo_dyn_MP_radash fallvel_kes.o
    mo_dyn_MP_radsto fallvel_kes.o
    mo_dyn_MP_rhoice fallvel_kes.o
    mo_dyn_MP_rhohgl fallvel_kes.o
    mo_dyn_MP_rhoash fallvel_kes.o
    mo_dyn_MP_rhowat fallvel_kes.o
    mo_dyn_MP_rhosto fallvel_kes.o
    mo_dyn_MP_wwatp.data fallvel_kes.o
    mo_dyn_MP_hglnew.data grads.o
    mo_dyn_MP_icenew.data grads.o
    mo_dyn_MP_ashnew.data grads.o
    mo_dyn_MP_wetnew.data grads.o
    mo_dyn_MP_stonew.data grads.o
    mo_dyn_MP_radtrac.data initial.o
    mo_dyn_MP_rhotrac.data dynamic.o
    mo_dyn_MP_spech.data background.o
    ld: fatal: Symbol referencing errors. No output written to atham
    make: *** [atham] Error 1

    As far as i can tell, its to do with undefined symbols...but the symbols are all definied(the code runs perfectly on my linux laptop)!!

    Anyone have any ideas?

    Thanks

  2. #2
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    It means that the laptop linux box has the right shared libraries to support your code.

    One of these is true on your Solaris box:

    1. Your make file is not telling ld where to find the shared library (or object file/archive) with those symbols

    2. There is no shared library or archive with those symbols.

    Therefore, either change your makefile after you locate where those libraries are, or install copies of those object/libraries and then change your make file to include them.

  3. #3
    Just Joined!
    Join Date
    Dec 2005
    Posts
    4
    Thanks for the suggestions Jim. But shared libraries arnt the problem!! All the object files created are in the local folder (jus to make sure i added the path into the makefile).
    Its rather frustrating as I have no idea what it could be!
    Any ideas anyone?


    Quote Originally Posted by jim mcnamara
    It means that the laptop linux box has the right shared libraries to support your code.

    One of these is true on your Solaris box:

    1. Your make file is not telling ld where to find the shared library (or object file/archive) with those symbols

    2. There is no shared library or archive with those symbols.

    Therefore, either change your makefile after you locate where those libraries are, or install copies of those object/libraries and then change your make file to include them.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    Undefined means that ld cannot find those symbols.

    There are two causes:
    1. The symbols really do not exist anywhere
    2. Your directives to ld ( or cc) do not let it find the symbols.

    What the error is telling you - all those .o files have unresolved symbols in them. The change may simply be to rearrange the -L or -l commands positions in the makefile.

    There NO other possibilities. What you have is called a linker error.
    Once you get past the idea that it is something else, then you can solve your problem.

    Have you tried nm to find any of those symbols? Either in a .a file or in some shared library? for example
    Code:
     nm libsomething.sl mo_dyn_MP_tgas
    Unless you can show me the existence of one of those symbols, I'll continue beleive that it's your make file and your shared libraries.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •