Problems compiling Upwelling Case

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
lalvarez
Posts: 106
Joined: Wed Feb 03, 2010 6:59 pm
Location: Universidad Autonoma de Baja California Sur

Problems compiling Upwelling Case

#1 Unread post by lalvarez »

Hello to All

I´m trying to run ROMS via cygwin in a windows 7 (32bit) environment, I have downloaded and install successfully the NETCDF-4.3.3.1 & NETCDF-Fortran-4.4.2 Libraries. Then i copy the upwelling.h & build.bash files to Upwelling folder, i change the build.bash and the CYGWIN-gfortran.mk files as the tutorial say and finally i type the ./build.bash statement but only get this:

$ ./build.bash
./build.bash: línea 40: $'\r': no se encontró la orden
./build.bash: línea 43: $'\r': no se encontró la orden
./build.bash: línea 46: error sintáctico cerca del elemento inesperado `$'in\r''
'/build.bash: línea 46: ` case "$1" in

I´m making the changes in build.bash & CYGWIN-gfortran.mk with wordpad

Are any new considrations about this new versions of NETCDF & NETCDF-fortran?

Here I attache my build.bash file

Thanks in advance
Attachments
build.bash
(17.13 KiB) Downloaded 394 times

detraceyb
Posts: 5
Joined: Mon May 28, 2012 2:56 pm
Location: Fisheries and Oceans Canada

Re: Problems compiling Upwelling Case

#2 Unread post by detraceyb »

Classic Windows/Linux newline(EOL) confusion. Everyone makes this mistake a few times. Read : http://en.wikipedia.org/wiki/Newline

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Problems compiling Upwelling Case

#3 Unread post by m.hadfield »

What detraceyb says.

You did download using Cygwin tools, didn't you?

Also, you don't say what netCDF packages you installed, but these days you should use the ones available through Cygwin setup.

If you're using Cygwin, you can save yourself a lot of grief by using Cygwin all the way. That, plus one of the several Windows text editors that preserves newlines.

lalvarez
Posts: 106
Joined: Wed Feb 03, 2010 6:59 pm
Location: Universidad Autonoma de Baja California Sur

Re: Problems compiling Upwelling Case

#4 Unread post by lalvarez »

Hello Detraceyb

Thanks a lot for your replay, i have already solve that problem and i could change my build.bsh to unix. What i´m facing now is the Error 127 when trying to compile ./build.bash.

This is what i got from my nf-config --all

Code: Select all

$ nf-config --all

This netCDF-Fortran 4.4.2 has been built with the following features:

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include -I/usr/local/include

  --fc        -> gfortran
  --fflags    -> -I/usr/local/include
  --flibs     -> -L/usr/local/lib -lnetcdff  -lnetcdf -L/usr/local/lib -lnetcdf -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF-Fortran 4.4.2
and from my nc-config --all

Code: Select all

$ nc-config --all

This netCDF 4.3.3.1 has been built with the following features:

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include
  --libs      -> -L/usr/local/lib  -lnetcdf -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl

  --has-c++   -> no
  --cxx       ->
  --has-c++4  -> no
  --cxx4      ->

  --fc        -> gfortran
  --fflags    -> -I/usr/local/include
  --flibs     -> -L/usr/local/lib -lnetcdff -lnetcdf -L/usr/local/lib -lnetcdf -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl
  --has-f90   -> no

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-pnetcdf-> no

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF 4.3.3.1
Thanks in advance, any help is appreciated

Leo
Attachments
Xbuild.bash
(17.91 KiB) Downloaded 393 times

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Problems compiling Upwelling Case

#5 Unread post by m.hadfield »

You appear to have a directory name with spaces (/cygdrive/c/Program Files/AMD APP/bin/x86) on your path. Bad idea.

The cure is to add an entry like this to your mount table:

Code: Select all

C:/Program Files on /prog type ntfs (binary,user)
That way, Cygwin will convert the above path to /prog/AMD APP/bin/x86 at startup. Oops, there's still a space. Oh well, either remove the space from the "AMD APP" part of the directory name or add another mount point, like

Code: Select all

C:/Program Files/AMD APP on /prog/amd type ntfs (binary,user)
How to add these mount points? The easiest way is to edit your user fstab file. In my case, for user hadfield, that is /etc/fstab.d/hadfield, which has the following contents

Code: Select all

C:/Program\040Files /prog some_fs binary 0 0
C:/Software /software some_fs binary 0 0
C:/Users/Hadfield/Desktop /desktop some_fs binary 0 0
D:/Mirror /mirror some_fs binary 0 0
L: /hpcf/home/hadfield some_fs binary 0 0
N: /hpcf/working/hadfield some_fs binary 0 0
You also have an "ATI Technologies" directory on your path. You can apply a similar cure. Cygwin is presumably picking these up from your Windows PATH? One wonders how important it really is for them to be there.

lalvarez
Posts: 106
Joined: Wed Feb 03, 2010 6:59 pm
Location: Universidad Autonoma de Baja California Sur

Re: Problems compiling Upwelling Case

#6 Unread post by lalvarez »

Hello Mark

I follow what you point in your latest replay, i look for my fstab file and found it in C:/cygwin/etc and here i attach a copy of it; please let me know if what i did is correct.

Also there is a C:/cygwin/etc/fstab.d folder which is empty.

Thanks in advance

Leo
Attachments
Myfstab.txt
(890 Bytes) Downloaded 405 times

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Problems compiling Upwelling Case

#7 Unread post by m.hadfield »

It doesn't really matter whether you modify the master file system table (/etc/fstab) or the user table (/etc/fstab.d/hadfield in my case). However putting things in the user table is cleaner, in my opinion. As you say, the user table does not exist by default: if you want one, you need to create it.

These tables are both text files and must have Unix line terminators.

The example you gave is more-or-less OK, but note that to represent a space you need a "\040". I have attached my file-system-table files. (I've had to muck about with the file names to get them to attach.)

You can see what effect these files have by running the mount command. Here is what I get:

Code: Select all

niwa-34751 $ mount
C:/Users/Hadfield/Desktop on /desktop type ntfs (binary,user)
C:/Program Files on /prog type ntfs (binary,user)
C:/Cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/Cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/Cygwin64 on / type ntfs (binary,auto)
C:/Software on /software type ntfs (binary,user)
D:/Mirror on /mirror type ntfs (binary,user)
L: on /hpcf/home/hadfield type smbfs (binary,user)
N: on /hpcf/working/hadfield type smbfs (binary,user)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
H: on /cygdrive/h type cifs (binary,posix=0,user,noumount,auto)
K: on /cygdrive/k type smbfs (binary,posix=0,user,noumount,auto)
M: on /cygdrive/m type smbfs (binary,posix=0,user,noumount,auto)
O: on /cygdrive/o type ntfs (binary,posix=0,user,noumount,auto)
Q: on /cygdrive/q type ntfs (binary,posix=0,user,noumount,auto)
R: on /cygdrive/r type ntfs (binary,posix=0,user,noumount,auto)
S: on /cygdrive/s type ntfs (binary,posix=0,user,noumount,auto)
Y: on /cygdrive/y type ntfs (binary,posix=0,user,noumount,auto)
I'm not saying that the spaces in your PATH are the cause of the problem. But they're an obvious thing to eliminate.
Attachments
etc.fstab.d.hadfield.txt
User file system table
(265 Bytes) Downloaded 365 times
etc.fstab.txt
Master file system table
(192 Bytes) Downloaded 397 times

Post Reply