Find the answer to your Linux question:
Results 1 to 10 of 10
Hello all, I am trying to compile and Install the Software Column Radiation Model (CRM) for scientific atmospheric applications. I am using UBUNTU 9.04. Originally the code uses the PGF90 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4

    Problems installing and compilling program, makefile, using gfortran compiler. netCDF


    Hello all,

    I am trying to compile and Install the Software Column Radiation Model (CRM) for scientific atmospheric applications. I am using UBUNTU 9.04.

    Originally the code uses the PGF90 compiler, and I don´t have this compiler. I have gfortran 4.4. I am trying to make the translation to gfortran.
    I am having some troubles:

    gfortran-4.4 -o ../bin/crm ../obj/crm.o ../obj/netcdf.o ../obj/endrun.o ../obj/freemem.o ../obj/getmem.o ../obj/blkdat.o ../obj/resetr.o ../obj/orb.o ../obj/albocean.o ../obj/aermix.o ../obj/cldefr.o ../obj/cldems.o ../obj/fmrgrid.o ../obj/radabs.o ../obj/radclr.o ../obj/radclw.o ../obj/radcsw.o ../obj/radctl.o ../obj/radded.o ../obj/radems.o ../obj/radini.o ../obj/radinp.o ../obj/radoz2.o ../obj/radtpl.o ../obj/torgrid.o ../obj/trcab.o ../obj/trcabn.o ../obj/trcems.o ../obj/trcmix.o ../obj/trcplk.o ../obj/trcpth.o ../obj/zenith.o ../obj/intmax.o ../obj/isrchfgt.o ../obj/isrchfle.o ../obj/wheneq.o ../obj/whenfgt.o ../obj/whenflt.o ../obj/whenne.o -L/usr/lib -lnetcdf
    ../obj/netcdf.o: In function `nc_err_exit__':
    netcdf.F: (.text+0xa2): undefined reference to `nf_strerror__'
    ../obj/netcdf.o: In function `netcdf_':
    netcdf.F: (.text+0x146): undefined reference to `nf_create__'
    netcdf.F: (.text+0x170): undefined reference to `nf_def_dim__'
    netcdf.F: (.text+0x19a): undefined reference to `nf_def_dim__'
    netcdf.F: (.text+0x1d7): undefined reference to `nf_def_var__'
    netcdf.F: (.text+0x214): undefined reference to `nf_def_var__'
    netcdf.F: (.text+0x251): undefined reference to `nf_def_var__'
    netcdf.F: (.text+0x28e): undefined reference to `nf_def_var__'

    collect2: ld returned 1 exit status
    make: *** [crm] Error 1

    someone know how to solve this ??
    I was read a lot of post with similar errors, and I think that this is linkage problem, but I couldn't solve it.

    Really I will appreciate your help,

    thanks in advance...
    Javier.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,706
    You need to find the library where these symbols are defined/implemented and link that as well.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    In first time, thanks for your answer Rubberman!,

    Where can I find these library's ?, and How can I link them?

    I look the Makefile and the netCDF library directory is correctly defined. There are another file in witch I can link the Library's with the code?

    thanks aggain!,
    I really appreciate your help.

    Javier.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,706
    Sorry. Don't use Fortran these days. Even my particle physicist wife mostly programs in C++ any more. She only gets into Fortran to maintain old programs.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,706
    There seems to be quite a bit of useful information here: NetCDF (network Common Data Form)
    You might want to post your question there to get more knowlegable help.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    thanks Rubberman,

    I will try there..

    best,
    Javier

  8. #7
    Just Joined!
    Join Date
    May 2009
    Location
    Christchurch, NZ
    Posts
    9
    I'm away from my machine where I have the netCDF routines installed, but I'm pretty sure that your problem is you haven't included the netCDF include file that defines all those variables. It's called netcdf.h or something like that and you have to bring it into your program up near the top, before any executable statements, using:
    include '/path_to_netcdf_files/netcdf.h'
    or similar.

  9. #8
    Just Joined!
    Join Date
    May 2009
    Location
    Christchurch, NZ
    Posts
    9
    And I don't see where you're linking with the static netCDF library.

  10. #9
    Just Joined!
    Join Date
    Jun 2009
    Posts
    4
    Thanks for your answer TIDEMAN,
    I attach the Makefile like txt in this post.

    In my PC, the netCDF.h is in the path /usr/include/netCDF.h

    I have been change the path to netcdf.h to:
    /usr/include/
    And I have the same error,
    /usr/include/netcdf.h
    And I have the same error,
    Even if I put a path that doesn’t exist I have the same error:
    /usr/inclu


    I have installed seven packages in reference to netCDF (I have to install something more???):
    (libnetcdf4 1:3.6.2-3.1; libnetcdf-dev 1:3.6.2-3.1; netcdf-bin 1:3.6.2-3.1; netcdf-dbg 1:3.6.2-3.1; netcdf-doc 1:3.6.2-3.1; netcdf-dev 1:3.6.2-3.1; python-netcdf 2.4.11-2ubuntu3)

    the CRM program to be installed is in the path:
    /home/Javier/CRM2/crm-2.1.2-ccm-3.6/

    I really I don’t know what is the problem,
    Thanks again for your help!!

    Javier,
    Attached Files Attached Files

  11. #10
    Just Joined!
    Join Date
    May 2009
    Location
    Christchurch, NZ
    Posts
    9
    Well, my installation was nowhere near as complicated....

    My TestnetCDF.f90 program contains this line:
    include '/usr/local/include/netcdf.inc'
    and I compile and link using this:
    gfortran TestnetCDF.f90 /usr/local/lib/libnetcdf.a -o TestnetCDF
    where libnetcdf.a is a static library and AFAIK is the only file that is needed.

Posting Permissions

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