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.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.
build.bash problem
Moderators: arango, kate, robertson
build.bash problem
-
- Posts: 106
- Joined: Wed Feb 03, 2010 6:59 pm
- Location: Universidad Autonoma de Baja California Sur
Re: build.bash problem
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?
-
- Posts: 39
- Joined: Wed Jun 25, 2008 2:49 am
- Location: Georgia Institute of Technology
Re: build.bash problem
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
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
Re: build.bash problem
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.
-
- Posts: 82
- Joined: Mon Aug 16, 2004 8:47 pm
- Location: U.S. Geological Survey, Woods Hole
- Contact:
Re: build.bash problem
the command "dos2unix" will convert the file, as in "dos2unix build.bash"
Re: build.bash problem
I got the same problem. Fixed it by editing using notepad++
http://notepad-plus-plus.org/
http://notepad-plus-plus.org/
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: build.bash problem
The *best* solution, as has been reported elsewhere, is to download ROMS using Cygwin's svn command.
-
- Posts: 0
- Joined: Sun Sep 05, 2010 4:05 pm
- Location: Institute of Geology and Geophysics, CAS
Re: build.bash problem
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!!
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!!
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: build.bash problem
(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.
[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.
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: build.bash problem
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.
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.
-
- Posts: 34
- Joined: Sat Sep 08, 2012 2:15 pm
- Location: Ocean University Of Cina
Re: build.bash problem
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!
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!