LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 10-27-2008, 07:03 AM   #1
malibec2005
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Rep: Reputation: 0
No such file or directory


I am quite a beginner and so my query may sound quite trivial to u guys but plz help me out with this

when i tried to have a netcad output i changed the make file as follow:
FLAG_6 = -DNETCDF_IO
IOLIBS = -L/usr/local/lib -lnetcdf
IOINCS = -I/usr/local/include


then i had the following results:

/usr/bin/cpp -P -C -traditional -DGFORTRAN -P -C -traditional -DNETCDF_IO -DGCN -DDYE_RELEASE mod_ncdio.F > mod_ncdio.f90
gfortran -O3 -c -I/usr/local/include mod_ncdio.f90
In file mod_ncdio.f90:49

USE netcdf
1
Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory
make: *** [mod_ncdio.o] Error 1


any help
 
Old 10-27-2008, 07:53 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,452

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Well.. is there a netcdf.mod file in /usr/include? Which linux distribution are you running on and how did you install netcdf libraries?
 
Old 10-28-2008, 03:41 AM   #3
malibec2005
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Well.. is there a netcdf.mod file in /usr/include? Which linux distribution are you running on and how did you install netcdf libraries?
for the first part. Yes the netcdf,mod file in the /usr/include.
i did not install the netcdf libraries myself but the IT team did it for me. the Linux server is called caunton
 
Old 10-28-2008, 03:59 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,452

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Hmmm, is it in /usr/local/include (see the gfortran statement in your firts post) or in /usr/include?

Another story: there is a chance that a netcdf.mod file has been compiled using a fortran compiler different from that you are used to (gfortran). A compatibility issue may arise. In this case, take in mind that you can install netcdf libraries locally, under your home directory. You must not have root privileges to do that, since only your own files and directories are affected. If you need some help to do this (if it happens you need it), feel free to ask.
 
Old 10-28-2008, 04:56 AM   #5
malibec2005
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Hmmm, is it in /usr/local/include (see the gfortran statement in your firts post) or in /usr/include?

Another story: there is a chance that a netcdf.mod file has been compiled using a fortran compiler different from that you are used to (gfortran). A compatibility issue may arise. In this case, take in mind that you can install netcdf libraries locally, under your home directory. You must not have root privileges to do that, since only your own files and directories are affected. If you need some help to do this (if it happens you need it), feel free to ask.


the following are my recent make file.

FLAG_6 = -DNETCDF_IO
IOLIBS = -L/usr/lib64 -lnetcdf
IOINCS = -I/usr/include/


the required libraries are located in the above locations lib64 and include.

Then the following are the massage that i received after i compiled

mod_lag.f90.text+0x8c57): undefined reference to `__netcdf__nf90_put_var_1d_fourbytereal'
mod_lag.f90.text+0x8ccb): undefined reference to `__netcdf__nf90_put_var_1d_fourbytereal'
mod_lag.o:mod_lag.f90.text+0x8d3f): more undefined references to `__netcdf__nf90_put_var_1d_fourbytereal' follow
mod_lag.o: In function `__mod_lag__dump_lag_restart':
mod_lag.f90.text+0x8dae): undefined reference to `__netcdf__nf90_put_var_1d_fourbyteint'
mod_lag.f90.text+0x8e25): undefined reference to `__netcdf__nf90_put_var_1d_fourbyteint'
mod_lag.f90.text+0x8e34): undefined reference to `__netcdf__nf90_close'
mod_lag.f90.text+0x90f5): undefined reference to `__netcdf__nf90_strerror'
collect2: ld returned 1 exit status
make: *** [fvcom] Error 1


i appreciate if you can guide me to start again and install Netcadf Correctly.
as i mention before i am quite new in the field. so please keep in mind
 
Old 10-28-2008, 08:51 AM   #6
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,452

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Ok. It looks like the NetCDF installed on the system have been compiled without the -fno-second-underscore option. So, if you want to install your own NetCDF for usage with gfortran, here are detailed instructions. The following commands will install NetCDF 3.6.3 under your HOME directory. I choosed version 3.6.3 instead of the more recent NetCDF 4 to avoid further complications. Unless you need the advanced functionalities of NetCDF 4, you can safely follow my choice.

1) First download the NetCDF source code (using wget from command line, or any ftp client with anonymous login)
Code:
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-3.6.3.tar.gz
2) Unpack the archive in your HOME directory and go the the directory containing the sources
Code:
tar zxvf netcdf-3.6.3.tar.gz -C $HOME
cd $HOME/netcdf-3.6.3
3) Set the build environment
Code:
export F77=gfortran
export FC=gfortran
export FFLAGS='-fno-second-underscore  -g -O2'
export FCFLAGS='-fno-second-underscore -g -O2'
export CC=gcc
export CXX=g++
export CPP='gcc -E'
export CXXCPP='g++ -E'
4) Configure step. I suggest to install your own version of NetCDF under the same directory used for building. The installation step will create the proper bin/ lib/ and include/ subdirectories. Moreover you can enable the build of shared object
Code:
./configure --prefix=$HOME/netcdf-3.6.3 --enable-shared
5) If the step above is successful (you can check full output in config.log) do
Code:
make
6) Test the libraries before installation. Since the output of this step is very long and scrolls fast through the terminal, I suggest to save it in a file for further checking. For example, you can use tee to see the output on the terminal and save it in a file simultaneously. Then you can grep the file for words like "error", "fail", "warning", "pass".
Code:
make check 2>&1 | tee check.log
grep -i error check.log
grep -i fail check.log
grep -i warning check.log
grep -i passed check-log
7) If everything looks right you can perform the last step
Code:
make install
Now you will have your include files in $HOME/netcdf-3.6.3/include and the libraries in $HOME/netcdf-3.6.3/lib. Set the proper location in your Makefile and the trick is done (hopefully)!
 
Old 10-29-2008, 05:02 AM   #7
malibec2005
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks

i started to follow your procedure. however after the fourth step i received the following:

checking whether we are using the GNU Fortran compiler... no
checking whether gofortran accepts -g... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether gofortran accepts -g... no
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files
[enxmabm@caunton netcdf-3.6.3]$
 
Old 10-29-2008, 05:49 AM   #8
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,452

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Quote:
Originally Posted by malibec2005 View Post
checking whether we are using the GNU Fortran compiler... no
checking whether gofortran accepts -g... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether gofortran accepts -g... no
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files
[enxmabm@caunton netcdf-3.6.3]$
Hmmm... you sure you correctly typed the name of the fortran compiler when you set the build environment? Please, check it and try again.
 
Old 12-02-2008, 10:50 AM   #9
malibec2005
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you all it works now.
 
Old 12-02-2008, 11:02 AM   #10
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,452

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
I'm glad to hear good news!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 10:18 PM
How to untar a file in another directory other then current directory. dr_zayus69 Linux - Software 8 05-16-2007 11:01 AM
Java File Processing using Scanner; Can't get it to read file in running directory xemous Programming 2 09-26-2006 06:13 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM
awk: fatal:cannot open file for reading (no such file or Directory) in Linux sangati vishwanath Linux - Software 4 07-06-2005 12:59 AM


All times are GMT -5. The time now is 08:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration