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
upwellingcase/installation
-
- Posts: 1
- Joined: Mon Apr 04, 2016 6:33 pm
- Location: University of Gothenburg
-
- Posts: 64
- Joined: Mon Oct 17, 2005 2:02 am
- Location: Institute of Oceanology,Chinese Academy of Sciences
Re: upwellingcase/installation
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
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
Re: upwellingcase/installation
you might have to install dos2unix utility in your cygwin environment
Re: upwellingcase/installation
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!
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 358 times
-
- build.bash
- (16.76 KiB) Downloaded 317 times
Re: upwellingcase/installation
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.
Re: upwellingcase/installation
./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
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
Re: upwellingcase/installation
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
$ ./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 332 times