upwellingcase/installation

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
gustavedlund
Posts: 1
Joined: Mon Apr 04, 2016 6:33 pm
Location: University of Gothenburg

upwellingcase/installation

#1 Unread post by gustavedlund »

Hi there,

Im new to ROMS, and also fairly new to using cygwin. I have followed the instructions from the wiki (https://www.myroms.org/wiki/ROMS_Cygwin), except I installed netcdf using cygwin packages instead of building netcdf on cygwin myself (I got this tip from the latest posts in the topic viewtopic.php?t=2766).

When i try to compile ROMS through the ./build.bash for the Upwelling case i get the following error msg:

$ ./build.bash
./build.bash: line 40: $'\r': command not found
./build.bash: line 43: $'\r': command not found
./build.bash: line 46: syntax error near unexpected token `$'in\r''
'/build.bash: line 46: ` case "$1" in

Any ideas on what could have gone wrong here? I would be very greatful for any kind of help as im a roms-rookie :)

best regards
/ Gustav Edlund

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

Re: upwellingcase/installation

#2 Unread post by linzhenhua »


hclarke
Posts: 22
Joined: Sun Dec 04, 2016 1:03 am
Location: UTAS

Re: upwellingcase/installation

#3 Unread post by hclarke »

Hello

I've just started on ROMS and the installation. I'm getting the exact same error message while typing the command

./build.bash

Error message:
./build.bash: line 40: $'\r': command not found
./build.bash: line 43: $'\r': command not found
./build.bash: line 46: syntax error near unexpected token `$'in\r''
'/build.bash: line 46: ` case "$1" in

I then clicked on the link provided which says to: "You need to run the dos2unix command on build.bash."

I then typed the command:
$ dos2unix build.bash

which returned:
-bash: dos2unix: command not found

Am I doing this right and what am I missing?

Thanks so much
Hans

User avatar
ngarg
Posts: 19
Joined: Fri Jul 12, 2013 5:46 pm
Location: NTU

Re: upwellingcase/installation

#4 Unread post by ngarg »

you might have to install dos2unix utility in your cygwin environment

hclarke
Posts: 22
Joined: Sun Dec 04, 2016 1:03 am
Location: UTAS

Re: upwellingcase/installation

#5 Unread post by hclarke »

Hi ngarg

Thanks for your response. Yes I have dos2unix installed and ran it. I then made some of the changes to build.bash, but having read other posts, am unsure which bits of build.bash to edit. Here's my error message:

$ ./build.bash
./build.bash: line 397: cd: /home/User/ocean/repository/trunk: No such file or directory
make: *** No rule to make target 'clean'. Stop.
make: *** No targets specified and no makefile found. Stop.

...and attached is my build.bash file and CYGWIN-gfortran.mk file.

The location of the build.bash file on my laptop is: C:\Cygwin\home\User\roms\Projects\Upwelling
The location of the CYGWIN-gfortran.mk file is: C:\Cygwin\home\User\roms\trunk\Compilers

If anyone could guide me through this, it would be much appreciated. The information in the tutorial seems out of date and some of the comments to other users seem geared for their particular situation.

Thanks!
Attachments
CYGWIN-gfortran.mk
(5.5 KiB) Downloaded 257 times
build.bash
(16.76 KiB) Downloaded 251 times

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: upwellingcase/installation

#6 Unread post by kate »

As suggested by Mark Hadfield, I believe the modern thing to do is run Linux inside a VirtualBox. I've got Ubuntu running that way on my Mac - some things are just easier that way than with native MacOS, even if it is Unix.

User avatar
ngarg
Posts: 19
Joined: Fri Jul 12, 2013 5:46 pm
Location: NTU

Re: upwellingcase/installation

#7 Unread post by ngarg »

./build.bash: line 397: cd: /home/User/ocean/repository/trunk: No such file or directory
make: *** No rule to make target 'clean'. Stop.
make: *** No targets specified and no makefile found. Stop.

...and attached is my build.bash file and CYGWIN-gfortran.mk file.

The location of the build.bash file on my laptop is: C:\Cygwin\home\User\roms\Projects\Upwelling
The location of the CYGWIN-gfortran.mk file is: C:\Cygwin\home\User\roms\trunk\Compilers

I think you have to make sure your path is correct, as you mention CYGWIN-gfortran is located in
~\roms\trunk\Compilers, while you are providing path ~/ocean/repository/trunk

change you MY_ROOT_DIR=${HOME}/ocean/repository to MY_ROOT_DIR=${HOME}/roms

hclarke
Posts: 22
Joined: Sun Dec 04, 2016 1:03 am
Location: UTAS

Re: upwellingcase/installation

#8 Unread post by hclarke »

Hi again. I'm still attempting to compile the Upwelling case. Here is the latest error message:

$ ./build.bash
rm -f -r core *.ipo /home/User/roms/Projects/Upwelling/Build /home/User/make_mac ros.mk
makefile:239: INCLUDING FILE /home/User/make_macros.mk WHICH CONTAINS APPLICATIO N-DEPENDENT MAKE DEFINITIONS
make: /opt/gfortransoft/serial/netcdf4/bin/nc-config: Command not found
cp -f /opt/gfortransoft/serial/netcdf4/include/netcdf.mod /home/User/roms/Projec ts/Upwelling/Build
cp: cannot stat '/opt/gfortransoft/serial/netcdf4/include/netcdf.mod': No such f ile or directory
make: *** No rule to make target '/home/User/roms/Projects/Upwelling/Build/netcd f.mod', needed by '/home/User/roms/Projects/Upwelling/Build/MakeDepend'. Stop.


Can someone please check out my attached build.bash file. I'm confused as to what my paths should and shouldn't be.
The windows location of my upwelling case is C:/cygwin/home/User/roms/Projects/Upwelling
The unix prompt location is User@User-PC ~/roms/Projects/Upwelling

Thanks
Attachments
build.bash
(16.77 KiB) Downloaded 252 times

Post Reply