Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Sat Oct 20, 2018 9:08 am




Post new topic Reply to topic  [ 16 posts ] 

All times are UTC

Author Message
PostPosted: Wed Sep 10, 2014 3:39 pm 
Offline

Joined: Mon Sep 08, 2014 4:17 pm
Posts: 3
Location: University of Delaware Coastal Engineering
Greetings,

I'm quite new to ocean modeling, with my programming background being primarily in machine code and matlab programming, though I have prior C and javascript experience and used linuxboxes in the past. This still puts me firmly in the beginner stage for the lot of this.

I was given a Mac-OSX computer to start testing ROMS on, practicing and learning, in preparation for taking over a long-running project from another doctoral student. I successfully followed all of the installation instructions.

However, after installation, the instructions continue with the running of the 'upwelling' example. During this process I get to the stage of "creating an executable oceanS file" . At the ./build.bash command for compiling, I get the following errors:

make: *** No rule to make target `clean'. Stop.
make: *** No targets specified and no makefile found. Stop.

The file "oceanS" is not built.

I reviewed my installation of the components required to run ROMS, as from what I have been able to read, this is normally caused by a failure to properly install the fortran library for netCDF. However, I installed both netCDF 4.2 and the netCDF-fortran-4.2 library directly off of MacPorts, based on the instructions found at: http://mazamascience.com/WorkingWithData/?p=1474 ; and, after following those instructions, I downloaded and ran their test case programme successfully without difficulty, so clearly at least netCDF itself is working correctly, and I installed the fortran library by the same process.

I understand that generally it's expected for beginners to work through these issues themselves, but at this stage I've exhausted what knowledge as I have without an outside perspective, so anything I could check or test to be able to continue proceeding would be deeply appreciated.


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 10, 2014 4:08 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
It is telling you that it can't find the makefile. In the build.bash, there is the line
Code:
cd ${MY_ROMS_SRC}
right before it tries to "make". Make sure that ${MY_ROMS_SRC} is set to the top of your source code, where there is a makefile.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 12, 2014 6:25 pm 
Offline

Joined: Mon Sep 08, 2014 4:17 pm
Posts: 3
Location: University of Delaware Coastal Engineering
Thank you very kindly for your answer, Kate. I implemented the correction for it and received a new error (got a few lines into the compile this time). This error I identified as being a failure to properly recognize where netcdf was, so based on my expected application (i.e. exclusively ROMS), I went ahead and installed the older version of netcdf per the instructions on the ROMS Wiki. It still didn't work, but I then identified a problem that the specification for changing the following lines in the build.bash file were incorrect for my installation:

Quote:
else
export NETCDF_INCDIR=/usr/local/include
export NETCDF_LIBDIR=/usr/local/lib
fi


As earlier on in the mac OSX instructions for installing the fortran compiler this example of testing its location is shown:

Quote:
which gfortran
/usr/local/bin/gfortran


However, on the command 'which gfortran', my address is:

/opt/local/bin/gfortran .

Thus, I altered the code to read:

Quote:
else
export NETCDF_INCDIR=/opt/local/include
export NETCDF_LIBDIR=/opt/local/lib
fi



The ./build.bash then compiled for quite a while and seemed like it was going to work, but finally terminally failed on the following error:

Quote:
cd /Users/mitfrc/ROMSDIR/ROMS/Projects/Upwelling/Build; /opt/local/bin/gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none strings.f90
cd /Users/mitfrc/ROMSDIR/ROMS/Projects/Upwelling/Build; /opt/local/bin/gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none mod_netcdf.f90
mod_netcdf.f90:19.16:

USE netcdf
1
Fatal Error: Wrong module version '10' (expected '6') for file 'netcdf.mod' opened at (1)
make: *** [/Users/mitfrc/ROMSDIR/ROMS/Projects/Upwelling/Build/mod_netcdf.o] Error 1


Which is where I stand at the present. I assume the 'wrong module version' for netcdf.mod is the relevant problem, but don't have a good idea of what that means.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 12, 2014 6:46 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
Quote:
Which is where I stand at the present. I assume the 'wrong module version' for netcdf.mod is the relevant problem, but don't have a good idea of what that means.
It means that your netcdf was compiled with a different version of gfortran than that you are using to compile ROMS. It looks like you got a precompiled version? If you knew what version of gfortran was used, you could fetch that instead (since it is newer).

You don't say what version of Netcdf it is. I would suggest something recent, in the 4.x series. That way you can have USE_NETCDF4 in your build and not have to mess around with setting NETCDF_INCDIR or NETCDF_LIBDIR. You then need to point to the correct nc-config and let it do the work. For the netcdf, it is "which nc-config" you need to know, not "which gfortran". Did your freshly downloaded netcdf go into /opt/local? The build must have found a netcdf.mod file in /opt/local/include.

I'm in the class of people who must have the newest software. I would therefore a) fetch a new gfortran, b) fetch the source for a new netcdf, and c) compile b with a, putting it into /opt/local.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 30, 2014 8:07 pm 
Offline

Joined: Mon Sep 08, 2014 4:17 pm
Posts: 3
Location: University of Delaware Coastal Engineering
Greetings,

Thank you again so much for your help, Kate. I've been getting back to this and succeeded to my knowledge in re-installing newer versions of netCDF and gfortran. However, I now get the error :

cd /Users/mitfrc/ROMSDIR/ROMS/Projects/Upwelling/Build; /usr/local/bin/gfortran -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none mod_netcdf.f90
mod_netcdf.f90:19.10:

USE netcdf
1
Fatal Error: Cannot read module file 'netcdf.mod' opened at (1), because it was created by a different version of GNU Fortran
make: *** [/Users/mitfrc/ROMSDIR/ROMS/Projects/Upwelling/Build/mod_netcdf.o] Error 1


I admittedly installed netcdf via the netcdf-fortran installer on macports, but understood this to be adequate. Does this merely imply that I don't have fortran-90 working properly for netcdf so it's a 77/90 mismatch issue (fortran is my weakest point in this process by far), or does it mean I still have some older version of gfortran on my computer that I failed to properly uninstall and that macports cheerfully compiled netcdf with this?


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 01, 2014 6:38 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
It can't be much clearer:
Quote:
Cannot read module file 'netcdf.mod' opened at (1), because it was created by a different version of GNU Fortran
You have some version of gfortran. Netcdf-fortran was compiled by some other version of gfortran. For most compilation and linking issues, this wouldn't be so bad, but Fortran 90 module files evolve as the compilers evolve and you have to match compiler versions for all the bits of your final program.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 12, 2015 3:39 pm 
Offline

Joined: Sun Jul 27, 2003 6:49 pm
Posts: 84
Location: UNH, USA
Old thread, but I hope this helps someone. You can run ROMS on OS X/mac using macports to install all the libraries. But was noted above, the netcdf is a bit tricky. To get it to work, you must specify the variant of netcdf-fortran to install that is consistent with your fortran compiler. To do this, first determine the version of gfortran you are using:

gfortran --version

Then install the appropriate variant for netcdf-fortran; so if you find you are using gfortran 4.9, run the following command

sudo port install netcdf-fortran +gcc49

More info can be found at https://guide.macports.org/chunked/using.variants.html

I hope this helps someone

Jamie


Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 2:25 pm 
Offline

Joined: Tue Aug 04, 2015 4:42 pm
Posts: 42
Location: Universidad del Mar (UMAR), Mexico
Hi everyone!
I'm working with roms-3.7, and I had the same problem with the compiler.
-
makefile:235: INCLUDING FILE Build/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cd Build; /opt/pb/gcc-5.1.0/bin/gfortran -c -frepack-arrays -fopenmp -O3 -ffast-math -ffree-form -ffree-line-length-none mod_netcdf.f90
mod_netcdf.f90:19:10:

USE netcdf
1
Fatal Error: Cannot read module file ‘netcdf.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [Build/mod_netcdf.o] Error 1

Could anybody tell me how to solve this problem, please? I tryed to install netcdf-fortran + gcc49 .. but it does not work ...
Thanks in advance.
-
Mar.Mo.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 5:37 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
Quote:
/opt/pb/gcc-5.1.0/bin/gfortran

Try
Quote:
install netcdf-fortran + gcc51
instead.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 25, 2017 12:41 am 
Offline

Joined: Tue Aug 04, 2015 4:42 pm
Posts: 42
Location: Universidad del Mar (UMAR), Mexico
Hi Kate, thanks for your help:
-
Apparently "install netcdf-fortran + gcc51" do not works for me....
I get:

[root@:ahumada]$(12)->yum install netcdf-fortran + gcc51
Loaded plugins: changelog, fastestmirror, presto, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* AL-Server: mirror1.alcancelibre.org
* base: mirror.cs.uwp.edu
* epel: fedora-epel.mirror.lstn.net
* extras: mirror.atlanticmetro.net
* updates: mirror.solarvps.com
No package netcdf-fortran available.
No package + available.
No package gcc51 available.
Error: Nothing to do
-
I tried for gcc-5.1.0, gcc-6.3.0 and gcc-4.6.2 ... and in all the cases I get the same...
Could you help me please?
-
Thanks in advance.
-
Mar.Mo.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 25, 2017 1:13 am 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
Jamie was recommending "port install" while I've used "brew" instead. Then there's my Linux virtualbox on the Mac where I use "apt-get install". That's where I really know how to set things up correctly.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2017 4:58 pm 
Offline

Joined: Thu May 25, 2017 4:45 pm
Posts: 3
Location: Woods Hole Oceanographic Institution
Hello,

I am getting an error while attempting to compile with build.bash as well, though the problem is different. When I enter ./build.bash a good amount of text is printed to the screen, but then abruptly ends with


ROMS/Bin/cpp_clean /Users/jacob_partida/roms//Projects/Upwelling//Build/mod_kinds.f90
cd /Users/jacob_partida/roms//Projects/Upwelling//Build; /usr/local/bin/gfortran -c -frepack-arrays -g -fbounds-check -ffree-form -ffree-line-length-none mod_kinds.f90
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
make: *** [/Users/jacob_partida/roms//Projects/Upwelling//Build/mod_kinds.o] Error 1


I'm on OS 10.12.5
I have used gfortran 6.3 to compile netcdf3, and also have used macports to get netcdf and netcdf-fortran (version 4). Using either one has returned the same error. I have more or less followed the steps in the various tutorials in the wiki.
I would greatly appreciate any help on this I can get!


Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2017 5:23 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
Can you try an older version of gfortran? 6.3 is pretty darn new. My homebrew gcc is at 5.3 on the Mac.

That said, gfortran 6.3 works for me in the Ubuntu virtualbox.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2017 5:57 pm 
Offline

Joined: Thu May 25, 2017 4:45 pm
Posts: 3
Location: Woods Hole Oceanographic Institution
Alright, thanks for the reply.

So I've uninstalled gfortran 6, netcdf, netcdf-fortran...
used macports to install gcc5, hdf5-18 (+gcc5), netcdf(+gcc5), and netcdf-fortran(+gcc5)

and get the error message in the attached file
which ends with

cd /Users/jacob_partida/roms//Projects/Upwelling//Build; -c -frepack-arrays -g -fbounds-check -ffree-form -ffree-line-length-none mod_kinds.f90
/bin/sh: -c: command not found
make: *** [/Users/jacob_partida/roms//Projects/Upwelling//Build/mod_kinds.o] Error 127


Attachments:
log_170526.rtf [13.76 KiB]
Downloaded 55 times
Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2017 6:12 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
This is in the FAQ, bullet three.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2017 6:32 pm 
Offline

Joined: Thu May 25, 2017 4:45 pm
Posts: 3
Location: Woods Hole Oceanographic Institution
My fault, I got so used to looking in that FAQ that I forgot to look again..

problem solved by creating a symbolic link to the new-old gfortran downloaded through macports:

sudo ln -s /opt/local/bin/gfortran-mp-5 /usr/local/bin/gfortran

(location of gfortran with new name [gfortran-mp-5 ... thanks macports :roll: ] -> location of the old symbolic link since removed)

seems to have worked, thanks for your help!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group