Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Mon Nov 20, 2017 3:09 pm




Post new topic Reply to topic  [ 11 posts ] 

All times are UTC

Author Message
 Post subject: build.bash problem
PostPosted: Thu Jun 26, 2008 2:54 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3251
Location: IMS/UAF, USA
Quote:
I am following the tutorial: Installing ROMS in Windows XP/Vista (via Cygwin) but when i was trying to compile i get this error:

$ ./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

does any one can help me with this, thanks in advance.

The problem here is having run svn on the Windows file system, then expecting Cygwin to parse the files. Your options are to run dos2unix on build.bash and any other troublesome files or to run svn from the same operating system on which you will run the scripts.


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sat Feb 06, 2010 4:17 pm 
Offline

Joined: Wed Feb 03, 2010 6:59 pm
Posts: 90
Location: Universidad Autonoma de Baja California Sur
I have had the same problem (errors and lines) when compilling the build.bash, trying to run the upwelling example, Did you get a solution for this? How the script have to be changed to get a good compillation?


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sun May 02, 2010 7:10 pm 
Offline

Joined: Wed Jun 25, 2008 2:49 am
Posts: 39
Location: Georgia Institute of Technology
just see this old thread with new reply by chance.

I guess the problem is the difference between window and linux text system

Windows follows the rule of old-style typewriter. Two steps is needed to get to the next line \r (return) \n (jump to next line), while linux just has \n doing this altogether. So linux script would not recognize \r which is only valid in Windows

The solution is just simply deleting \r


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Thu Feb 03, 2011 5:08 am 
Offline

Joined: Sat Dec 11, 2010 3:09 pm
Posts: 2
Location: nio
I also had the same problem in Cygwin in windowsXP.As in one of the replay i tried to delete '\r'.But i am not able to see such scripts in build.bash.please help me to solve this problem.i am just trying to run the upwelling application following tutorials.


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Fri Feb 04, 2011 2:15 pm 
Offline

Joined: Mon Aug 16, 2004 8:47 pm
Posts: 81
Location: U.S. Geological Survey, Woods Hole
the command "dos2unix" will convert the file, as in "dos2unix build.bash"


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Mon Jun 27, 2011 7:31 pm 
Offline

Joined: Wed Jun 22, 2011 1:49 pm
Posts: 3
Location: Stanford University
I got the same problem. Fixed it by editing using notepad++
http://notepad-plus-plus.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Tue Jun 28, 2011 12:47 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 477
Location: NIWA
The *best* solution, as has been reported elsewhere, is to download ROMS using Cygwin's svn command.


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sat Jul 23, 2011 1:19 pm 
Offline

Joined: Sun Sep 05, 2010 4:05 pm
Posts: 0
Location: Institute of Geology and Geophysics, CAS
This is my first time of using ROMS.

I checkout the latest version using Subversion, then, change directory to /ROMS/Bin, and run ./build.bash

Here I have a problem:
./build.bash: line 397: cd: /root/ocean/repository/trunk: no such file or directory
make: *** ... ...“clean”. stop.
make: *** ... ...makefile. stop.

I am not very familiar with Linux.
May somebody tell me what should I do? Should I change something in the file build.bash or something?

Thanks very very much!!


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sun Jul 24, 2011 10:47 pm 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 477
Location: NIWA
(Sorry about the raw BBCode tags in the following. For some reason BBCode processing is turned off.)

[quote="huangxh"]Should I change something in the file build.bash or something?[/quote]

Indeed you should. Line 397 of build.bash is
[code] cd ${MY_ROMS_SRC}[/code]
and the directory pointed to by MY_ROMS_SRC is /root/ocean/repository/trunk, which does not exist on your system. Going back to line 102 you can see
[code] export MY_ROMS_SRC=${MY_ROOT_DIR}/trunk[/code]
and back to line 88
[code]export MY_ROOT_DIR=${HOME}/ocean/repository[/code]
So $HOME on your system appears to be "/root" which is rather odd. Are you logged in as the root user? I am no Unix expert, but I think that this is not a good idea.

Anyway, the first thing you need to do in order to build ROMS with this script is to set MY_ROMS_SRC to the directory into which you check out the code (i.e. the one that contains makefile and several subdirectories, including one called ROMS). The value of MY_ROOT_DIR doesn't matter as such, as the only place it's used is in setting MY_ROMS_SRC, so you can delete the references to it. There are a bunch of other variables in build.bash that might need to be changed.

But before you do this I suggest you consider setting up an ordinary user account and checking out ROMS into that.


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sun Jul 24, 2011 10:53 pm 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 477
Location: NIWA
I have a further suggestion: check out a copy of the test subdirectory

https://www.myroms.org/svn/src/test/

Now go to the upwelling subdirectory, where you will find a build.bash script very similar to the one you ran before. Modify and run that script, leaving the files in your ROMS tree unmodified. I think it's cleaner that way. There are several other test cases you can run, and they come with all the necessary input files.


Top
 Profile  
Reply with quote  
 Post subject: Re: build.bash problem
PostPosted: Sun Sep 16, 2012 7:41 am 
Offline

Joined: Sat Sep 08, 2012 2:15 pm
Posts: 34
Location: Ocean University Of Cina
I have the same problem. I need hellp! Thanks!
I had a problem when I am compiling my ROMS downloaded via the svn。I used Cygwin.When I input the commend:"./build.bash",it showed:
"./buid.bash: line 397 cd: /home/mengqingjun/ocean/repository/trunk: No such file or directory
meke:***没有规则可以创建目标“clean”.停止
meke:***没有指明目标并且找不到“makefile”.停止”
I don't know why ,I need you help !
Many Thanks,best wishes!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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