Problems Compiling ROMS under cygwin

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

Problems Compiling ROMS under cygwin

#1 Unread post by luis.chetu.83 »

HI,

I`m trying to compile ROMS-2.2 using cygwin in windows.
I downloaded cygwin and installed X11, next in Devel part I installed binutils 20060817-1, mingw_runtime 3.14-1, gcc_core 3.4.4.4 (C compiler), gcc_g++ (C++ compiler), make 3.81-2; next I installed Perl too, in Editor I installed nano (1.2.2-1) and xemacs (21.4.20-2); in Utils part I installed diffutils. Then I know that I have to use g95 compiler, so, I changed in Makefile the FORT?= g77 by g95, but the problem is when I want to compile ROMS (Upwelling test case) to prove the installation using make, I obtain these errors:

$make
/usr/bin/cpp –P –traditional -I/usr/include –DCYGWIN –DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Nonlinear/analytical.F > analytical.f90
Bin/cpp_clean analytical.f90
/usr/bin/cpp -P -traditional -I/usr/include -DCYGWIN -DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Nonlinear/exchange_2d.F > exchange_2d.f90
Bin/cpp_clean exchange_2d.f90
/usr/bin/cpp -P -traditional -I/usr/include -DCYGWIN -DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Modules/mod_param.F > mod_param.f90
Bin/cpp_clean mod_param.f90
g95 -c -03 -ffast-math mod_param.f90
make: g95: Command not found
make: *** [mod_param.o] Error 127


So, I thought this error would be probably because I hadn´t installed g95 correctly, then I downloaded g95-x86-cygwin.tgz...

But my question is why is this problem? If this problem is relationated with g95 compiler How can I install g95 in my computer, what do I have to do?

I hope your reply

Regards

Luis A.

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

#2 Unread post by kate »

What happens if you type "which g95"? Have you successfully compiled a tiny test program with g95? There is also gfortran which comes with gcc 4.0 I believe. I'm not up on which produces faster, more accurate code, though.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#3 Unread post by luis.chetu.83 »

Thanks a lot for your reply Kate...

If I type: which g95, I receive this message:

$ which g95
Which: no g95 in (/usr/local/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOW
S/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/system32/wbem:/cygdrive/c/arc
hivos de programa/ati technologies/ati control panel:/cygdrive/c/archives de programa/hpq/iam/bin:/cygdrive/c/Archivos de programa/MATLAB/R2007a/bin:/cygdrive/c
/Archivos de programa/MATLAB/R2007a/bin/win32)


What do I have to do for compiling successfully??

I`ll aprecciate your reply

Luis A.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#4 Unread post by luis.chetu.83 »

HI, I´m trying to solve my problem for installing ROMS under cygwin, so, when I uncompressed the tar file g95-x86-cygwin.tar using the next command, I obtained these lines:

$ tar -xvzf g95-x86-cygwin.tar
usr/
usr/local/
usr/local/bin/
usr/local/bin/g95
usr/local/bin/i686-pc-cygwin-g95.exe
usr/local/doc/
usr/local/doc/g95/
usr/local/doc/g95/AUTHORS
usr/local/doc/g95/COPYING
usr/local/doc/g95/G95Manual.pdf
usr/local/doc/g95/G95_INSTALL
usr/local/doc/g95/INSTALL
usr/local/doc/g95/README
usr/local/lib/
usr/local/lib/gcc-lib/
usr/local/lib/gcc-lib/i686-pc-cygwin/
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/ccl
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/f951.exe
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/g95_dlltools/
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/g95_dlltools/dlltools_info.txt
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/g95_dlltools/g95.dll
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/g95_dlltools/g95main.o
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/g95_dlltools/libf95.dll.a
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/libf95.a
usr/local/lib/gcc-lib/i686-pc-cygwin/4.0.3/libgcc.a
usr/local/lib/gcc-lib/i686-pc-mingw32/
usr/local/lib/gcc-lib/i686-pc-mingw32/4.0.3/
usr/local/lib/gcc-lib/i686-pc-mingw32/4.0.3/libf95.a

Was it good what I did with the tar file g95-x86-cygwin.tar??

So, What do I have to do for compiling without problems??



I'll appreciate your help

Luis A.

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

#5 Unread post by kate »

OK, you didn't have g95 before but you have it now. Does it compile now? What errors do you get if not?

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#6 Unread post by luis.chetu.83 »

Thanks for your reply Kate.

I had g95-x86-cygwing.tar since that I begin to install ROMS, and I had uncompressed the tar file already, but the error when I want to compile is this:

$make
/usr/bin/cpp –P –traditional -I/usr/include –DCYGWIN –DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Nonlinear/analytical.F > analytical.f90
Bin/cpp_clean analytical.f90
/usr/bin/cpp -P -traditional -I/usr/include -DCYGWIN -DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Nonlinear/exchange_2d.F > exchange_2d.f90
Bin/cpp_clean exchange_2d.f90
/usr/bin/cpp -P -traditional -I/usr/include -DCYGWIN -DI686 -DG95 -IInclude -INo
nlinear -IDrivers -ISeaIce Modules/mod_param.F > mod_param.f90
Bin/cpp_clean mod_param.f90
g95 -c -03 -ffast-math mod_param.f90
make: g95: Command not found
make: *** [mod_param.o] Error 127


Then you recommended me to type: which g95, and I received this message:


$ which g95
Which: no g95 in (/usr/local/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/WINDOW
S/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/system32/wbem:/cygdrive/c/arc
hivos de programa/ati technologies/ati control panel:/cygdrive/c/archives de pro
grama/hpq/iam/bin:/cygdrive/c/Archivos de programa/MATLAB/R2007a/bin:/cygdrive/c
/Archivos de programa/MATLAB/R2007a/bin/win32)

So, I just wanted that you see what I got when I uncompressed the tar file g95-x86-cygwin.tar using tar -xvzf command.

What do I need to do to work successfully?

Cheers
Luis A.

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

#7 Unread post by kate »

You have /usr/local/bin in your path and you now have g95 in /usr/local/bin. Depending on your shell, you might have to type "rehash" to refresh your cached commands in the path. Logging out and in will do the same. What happens now?

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#8 Unread post by luis.chetu.83 »

Thank again Kate.

If I type "rehash" I receive this message:

$ rehash
bash: rehash: Command not found

Where do I have to uncompress the tar file g95-x86-cygwin.tar?

Luis A.

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

#9 Unread post by kate »

Sorry, you unpacked into usr/local/bin, not /usr/local/bin. I'm not an expert on cygwin, but can you put it into /usr/local/bin?

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

#10 Unread post by m.hadfield »

Here are the commands I use under the Cygwin Bash shell to install g95:

Code: Select all

cd /
tar -xvzf $HOME/software/g95/g95-x86-cygwin.tgz
You will have to adapt this if you've put your Cygwin g95 tarball somewhere else.

This creates the following file (among others):

Code: Select all

/usr/local/bin/i686-pc-cygwin-g95.exe
To ensure that the compiler can be invoked with the command "g95", issue the following command

Code: Select all

ln -sf /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95
If you then type "g95 -v" at a command prompt you should get something that resembles the following

Code: Select all

Reading specs from /usr/local/bin/../lib/gcc-lib/i686-pc-cygwin/4.1.1//specs
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/4.1.1/specs
Target: 
Configured with: ../configure --enable-languages=c --disable-nls --enable-threads=posix --enable-sjlj-exceptions --with-system-zlib --disable-libmudflap --without-included-gettext --disable-shared --disable-win32-registry --without-x --enable-hash-synchronization --enable-libstdcxx-debug --enable-interpreter
Thread model: posix
gcc version 4.1.1 (g95 0.91!) Nov 30 2007

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

#11 Unread post by m.hadfield »

To ensure that the compiler can be invoked with the command "g95", issue the following command
Code:

ln -sf /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95
Actually, this step will not be necessary if you used Cygwin tar to unpack the g95 tarball. However if you unpacked the tarball with a non-Cygwin application then the symbolic link called g95 will not have been created (hence the command g95 will not work) and there may be other problems as well.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#12 Unread post by luis.chetu.83 »

Thanks for your help m.hadfield!!!

If I type:

$ cd /usr/local/bin, and then:
$ ls

I can see the files that I have in this directory right, so, I have:

g95.lnk i686-pc-cygwin-g95.exe ncdump.exe ncgen.exe


After, If I type:

ln -sf /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95

It does not pass anything, then when I type g95 -v, I receive this message:

bash: g95: command not found

So, why do you think is this problem, it could be maybe because is not in the correct directory??

What should I do to solve my problem?

I`ll apreciate your help!!

Cheers
Luis A.

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

#13 Unread post by m.hadfield »

I receive this message:

bash: g95: command not found

So, why do you think is this problem, it could be maybe because is not in the correct directory??
First, try typing

Code: Select all

/usr/local/bin/g95 -v
This should produce something like this

Code: Select all

Reading specs from /usr/local/bin/../lib/gcc-lib/i686-pc-cygwin/4.1.1//specs
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/4.1.1/specs
Target: 
Configured with: ../configure --enable-languages=c --disable-nls --enable-threads=posix --enable-sjlj-exceptions --with-system-zlib --disable-libmudflap --without-included-gettext --disable-shared --disable-win32-registry --without-x --enable-hash-synchronization --enable-libstdcxx-debug --enable-interpreter
Thread model: posix
gcc version 4.1.1 (g95 0.91!) Feb  7 2008
If not, something in your G95 installation is broken. The first thing to check is the "g95" link

Code: Select all

ls -l /usr/local/bin/g95
which should produce something like this

Code: Select all

lrwxrwxrwx 1 hadfield None 37 Feb 19 16:14 /usr/local/bin/g95 -> /usr/local/bin/i686-pc-cygwin-g95.exe
indicating there is a link to the i686-pc-cygwin-g95.exe executable.

You need to be using the Cygwin bash shell for all this. I note that you said
If I type:
$ cd /usr/local/bin, and then:
$ ls
I can see the files that I have in this directory right, so, I have:
g95.lnk i686-pc-cygwin-g95.exe ncdump.exe ncgen.exe
It's a bit odd that g95.lnk appears here. This file should be a Cygwin symbolic link, which are implemented as Windows shortcuts (.lnk files). Windows applications should see this file as "g95.lnk" but Cygwin applications should see it as "g95". You are using Cygwin applications for all this?

Anyway if "/usr/local/bin/g95" does run OK, then the reason "g95" doesn't is most likely that /usr/local/bin is not on your path. Try

Code: Select all

echo $PATH
This is what mine looks like

Code: Select all

/home/hadfield/local/scripts:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:
/cygdrive/c/Local/scripts:/progs/GnuWin32/bin:/cygdrive/c/WINDOWS/system32:
/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/system32/wbem:/progs/intel/dmix:
/cygdrive/c/WINDOWS/system32/nls:/cygdrive/c/WINDOWS/system32/nls/english:
/progs/MATLAB71/bin/win32:/progs/Novell/ZENworks:
/progs/Gfortran/gfortran-windows-20070706/gfortran/libexec/gcc/i386-pc-mingw32/4.3.0:
/progs/Gfortran/gfortran-windows-20070706/gfortran/bin:Z:.:/usr/lib/lapack
I have no idea where most of these came from, but anyway, you can see /usr/local/bin near the start.

If you don't have /usr/local/bin in your path, you need to add it. So type this

Code: Select all

export PATH=/usr/local/bin:$PATH
and try again.

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

#14 Unread post by m.hadfield »

Sorry for formatting of previous message. I think it is caused by including long lines in code blocks. I will remember next time.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#15 Unread post by luis.chetu.83 »

Thanks a lot for your reply m.hadfield

Let´s by parts ok, if I open local disk C, I can find cygwin with the next folders:

bin
cygdrive
dev
etc
home(administrador(descargas; roms-2.2; g95-x86-cygwin.tgz; usr))
lib
tmp
var
src
usr(bin; i686-pc-cygwin; i686-pc-mingw32; info; local; sbin; src; tmp; include; lib; man; share; ssl; X11R6)

then, if I open the cygwin bash shell, I`ll be in:

administrador folder;

So, when I type:

$ /usr/local/bin/g95 -v

I receive this message:

bash: /usr/local/bin/g95: No such file or directory

Next, when I type:

$ ls -l /usr/local/bin/g95

I receive this message:

ls: cannot acces /usr/local/bin/g95: No such file or directory

Next, If I type:

$ export PATH=/usr/local/bin:$PATH

It does not pass anything because when I type again:

/usr/local/bin/g95 -v

I receive the same message:

bash: /usr/local/bin/g95: No such file or directory

So, Is it in the correct directory the usr folder?

Where does usr folder has to be?

What do I have to do?

Cheers
Luis A.

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

#16 Unread post by m.hadfield »

/usr/local/bin/g95: No such file or directory
So, you're going to have to work methodically to find which component is missing. From a Cygwin prompt, type the following in turn

Code: Select all

ls -l /usr
ls -l /usr/local
ls -l /usr/local/bin
ls -l /usr/local/bin/g95
At each step but the last you should get a directory listing, and at the last you should get something like this

Code: Select all

lrwxrwxrwx 1 hadfield None 37 Feb 19 16:14 /usr/local/bin/g95 -> /usr/local/bin/i686-pc-cygwin-g95.exe
If you've got this far, then try

Code: Select all

ls -l /usr/local/bin/i686-pc-cygwin-g95.exe
and this should show something like

Code: Select all

-rwxr-xr-x 1 hadfield None 153349 Feb  8 12:05 /usr/local/bin/i686-pc-cygwin-g95.exe
If all this works as expected, then I don't know what's wrong. If it doesn't you should have a better idea of the problem. Eg. if /usr/local/bin/g95 exists but /usr/local/bin/i686-pc-cygwin-g95.exe doesn't, then you've probably installed g95 somewhere other than where you thought you did.

By the way, what is the output when you type

Code: Select all

mount

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#17 Unread post by luis.chetu.83 »

Thanks a lot for your patience hadfield;

If I type:

ls -l /usr
ls -l /usr/local
ls -l /usr/local/bin
ls -l /usr/local/bin/g95

I receive this message:

$ ls -l /usr/local/bin/g95
ls: cannot acces /usr/local/bin/g95: No such file or directory

Next, when I type:

$ ls -l /usr/local/bin/i686-pc-cygwin-g95.exe

I get the next message:

-rwx------+ 1 Administrador Ninguno 116963 Dec 13 2006 /usr/local/bin/i686-pc-cygwin-g95.exe

If I type:

$ mount

I receive this message:

C:\cygwin\bin on /usr/bin type system (binmode)
C:\cygwin\lib on /usr/bin type system (binmode)
C:\cygwin on /type system (binmode)
c: on /cygdrive/c type system (binmode, noumount)
d: on /cygdrive/d type system (binmode, noumount)

What do you recommend me to do?

Luis A.

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

#18 Unread post by m.hadfield »

So what about

Code: Select all

ls -l /usr/local/bin
What did that show?

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#19 Unread post by luis.chetu.83 »

I`m appreciating your help m.hadfield, thanks again!!

If I type:

$ ls -l /usr/local/bin

I receive this message:

$ ls -l /usr/local/bin
total 1293
-rwx------+ 1 Administrador Ninguno 516 Jul 3 2007 g95.lnk
-rwx------+ 1 Administrador Ninguno 116963 Dec 13 2006 i686-pc- cygwin-g95.exe
-rwx------+1 Administrador Ninguno 579961 Jul 3 2007 ncdump.exe
-rwx------+ 1 Administrador Ninguno 622302 Jul 3 2007 ncgen.exe


I was using ROMS before and I compiled whitout problems, but I had to clean my hard disc and I did back up`s of all my documents, and I don`t remember if I copied something of the old`s files to my new installation.

What do I need to modify now??

Cheers
Luis A.

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

#20 Unread post by m.hadfield »

I suggest deleting /usr/local/bin/g95.lnk and creating a new link

Code: Select all

ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95
By the way, what happens when you try to run the executable directly:

Code: Select all

/usr/local/bin/i686-pc-cygwin-g95.exe -v
I was using ROMS before and I compiled whitout problems, but I had to clean my hard disc and I did back up`s of all my documents, and I don`t remember if I copied something of the old`s files to my new installation.
Hmmm. If you keep having problems, it might be a good idea to rerun the Cygwin installation program and then reinstall g95 to make sure everything's in the right place.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#21 Unread post by luis.chetu.83 »

Thanks for your help m.hadfield!!

I typed:

$ ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95

and I received the next message:

$ ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95
ln: creating symbolic link '/usr/local/bin/g95': File exists


Then when I type:

$/usr/local/bin/i686-pc-cygwin-g95.exe -v

I received the next message:

$ /usr/local/bin/i686-pc-cygwin-g95.exe -v
Using built-in specs.
Target:
Configurated with: /src/G95/gcc-4.0.3/configure --enable-languages=c --disable

Thread model: single
gcc version 4.0.3 (g95 0.91!) Dec 12 2006

What do you recommend me doing to fix my problem??

Cheers
Luis A.

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

#22 Unread post by m.hadfield »

So /usr/local/bin/i686-pc-cygwin-g95.exe (which is the compiler executable) exists and seems to work, but you can't create a symbolic link to it in the same directory called g95. Odd.

The first thing I suggest is that you open the directory in question in Explorer, look for any existing files called g95, or g95.lnk, or anything like that, and delete them. Then try re-running this command

$ ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95

and if that doesn't work add the -f switch

$ ln -s -f /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95

and if that doesn't work, then the world is a very strange place and I am flummoxed.

Well, not completely flummoxed, Another option, given that you seem to have a functional compiler in i686-pc-cygwin-g95.exe, is to make a *copy* of this file with the name g95.exe. Yet another option is to build ROMS with

$ make FORT=g95 FC=i686-pc-cygwin-g95

Another, better option might be to install Linux on your PC, but let's not go there for the time being, shall we?

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#23 Unread post by luis.chetu.83 »

Thanks for your reply m.hadfield!!

I typed:

$ ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95

And I received:

$ ln -s /usr/local/bin/i686-pc-cygwin-g95.exe /usr/local/bin/g95
ln: creating symbolic link '/usr/local/bin/g95': File exist

Then, I tried:

$ make FORT=g95 FC=i686-pc-cygwin-g95

And I received:

$ make FORT=g95 FC=i686-pc-cygwin-g95
i686-pc-cygwin-g95 -c -03 -ffast-math mod_param.f90
i686-pc-cygwin-g95: installation problem, cannot exec 'f951': No such file or directory
make: ***[mod_param.o] Error 1

Other question is, where should I have the usr folder?

I have it where I have the roms-2.2, descargas, g95-x86-cygwin.tar, folders too!

So, is this the correct directory to have the usr folder?

Cheers
Luis A.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#24 Unread post by luis.chetu.83 »

I forgot ask you m.hadfield!

What do I have to do to generate the g95.exe file that I need, if I uncomppress the g95-x86-cygwin.tar using:

$ tar -xvzf g95-x86-cygwin.tar

where do I have to uncomppress it to generate g95.exe in the indicated place?

By the way, I have two usr folders:

First folder has the next sub-folders (This is in home\Administrador):

/local: and this folder has:/bin; doc; lib: and the folder bin has: i686-pc-cygwin-g95

Second folder has the next folders (This is in cygwin):

bin; i686-pc-cygwin; i686-pc-mingw32; include; lib; info; local; man; sbin; share; src; ssl; tmp; X11R6;

and local folder in this one has: bin; doc; etc; lib; include; man;

and bin folder here has: g95.exe; i686-pc-cygwin-g95.exe; ncdump.exe and ncgen.exe.

When I want to open g95.exe with double clic, I can´t open it!!

So, which usr folder is the correct and where does usr have to be?

Why do you recommend me to do?

Luis A.

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

#25 Unread post by m.hadfield »

Whew. This is the problem with Cygwin, it can get very complicated if something goes wrong. You said somewhere that you used to be able to build and run ROMS, but you had a disk failure and lost some files? Uh oh...

A listing of the g95 tarball for Cygwin starts like this:

usr/
usr/local/
usr/local/bin/
usr/local/bin/cc1
usr/local/bin/g95
usr/local/bin/i686-pc-cygwin-g95.exe
usr/local/doc/
usr/local/doc/g95/
...

Note that the path names are relative, they all start with "usr". To install the compiler under /usr/local (which is a sensible place to put it) you first have to cd to the root directory, "/" and then extract the contents with tar, as I instructed many posts ago. (The reason the tarball uses relative names is so you could install it somewhere else if you wanted to and knew what you were doing. That's not relevant here.)

Now, the 5th entry in the listing above is usr/local/bin/g95 and the next is usr/local/bin/i686-pc-cygwin-g95.exe. The latter is the actual executable for the G95 compiler and the former is a symbolic link, to let you invoke the executable with the command "g95". If you examine the tarball with a non-Cygwin Windows application like Winzip, you won't see the usr/local/bin/g95 because these applications don't understand symbolic links. Similarly if you have unpacked the tarball with a non-Cygwin tar, then the symbolic link will not be there. But not only will that link not be there but there might be some other links that are necessary for the successful operation of the compiler that aren't there either.

You say you get an error creating the g95 link, but you don't make it clear whether you have tried all the things I suggested: deleting any existing files in Windows Explorer and/or using the ln command's -f switch.

Still , I think you should be able to invoke the compiler executable directly, and this is why I suggested

$ make FORT=g95 FC=i686-pc-cygwin-g95

The fact that this fails with "cannot exec 'f951'" suggests that there is something wrong with the installation of G95, something other than the lack of the "g95" link. Maybe the lack of some other link, as I alluded to above.

Oh, and something has just occurred to me (and probably should have earlier). I think I encountered the "cannot exec 'f951'" message in the past after installing Cygwin and g95 on a new machine, and I think the problem was that I had not installed g77. The Cygwin g95 compiler relies on various libraries that are not supplied in the tarball, so to make it work you definitely need to have the gcc package installed and also I think the g77 package. You can do all this with the Cygwin installer:

http://sources.redhat.com/cygwin/setup.exe

Now, you ask about directories. The tricky thing here is that Cygwin applications see a directory structure that doesn't exactly match the directory structure seen by Windows applications. The mapping between the two is controlled by the mount table, which you included a few posts back:

C:\cygwin\bin on /usr/bin type system (binmode)
C:\cygwin\lib on /usr/bin type system (binmode)
C:\cygwin on /type system (binmode)
c: on /cygdrive/c type system (binmode, noumount)
d: on /cygdrive/d type system (binmode, noumount)

That all looks reasonable. ... Gulp, no it doesn't! This one is wrong:

C:\cygwin\lib on /usr/bin type system (binmode)

That should be

C:\cygwin\lib on /usr/lib type system (binmode)

That could be the cause of your problems. If the mount table listing you have given me is what you actually have (ie not a typo) then you have to delete the existing entry for C:\cygwin\lib and create a new one that points it to /usr/lib. Consult the manual for info on how to do that.

Where were we? Oh yes, the mount table says that the Cygwin root directory "/" maps to C:\Cygwin, which is what I would expect. So (given that you have no other mount table entries that affect the following mappings) /usr is C:\Cygwin\usr, /usr/local is C:\Cygwin\usr\local, etc. I don't think there's any good reason why you would have a usr subdirectory under /home/Administrator and it suggests you have more than one Cygwin installation, which is a bad thing. Or maybe you have an installation of another Windows-Gnu package called MinGW

http://mingw.sourceforge.net/index.shtml

which isn't necessarily a bad thing, but obviously could lead to confusion.

You ask how & where to create g95.exe? Nowhere. /usr/local/bin/g95 should be a symbolic link. You have an existing g95.exe? Unless you created it by copying i686-pc-cygwin-g95.exe, as I suggested (perhaps unwisely) a few posts back, then this shouldn't be there and suggests maybe you have installed the MinGW version of g95?? Or some other reason, but I suggest you delete it, as it could be interfering with your attempts to create the symbolic link.

I hope you can make sense of all of this. Good luck.

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

#26 Unread post by m.hadfield »

I don't think there's any good reason why you would have a usr subdirectory under /home/Administrator and it suggests you have more than one Cygwin installation
On second thoughts, it suggests you unpacked the Cygwin tarball without first cd'ing to "/", which is no big deal, so just delete it.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#27 Unread post by luis.chetu.83 »

Thanks m.hadfield again for your reply!!

I`m a little conffussed now, so, I`m gonna install cygwin again and I will not copy anything of the last installation to my new one, but I need ask you something before beggining to install cygwin again:

When do I have to uncomppress the g95-x86-cygwin.tgz file in the installation?

I have to install X11, perl, mingv, binutils, and someone else right?, So, when I finish to install them I have to configurate the netcdf libraries and after I have to configurate ROMS right=?.

So, I would like to know when and where do I have to uncomppress the tar file g95 to make a succesfully installtion?

I hope your reply!!

Cheers
Luis A.

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

#28 Unread post by m.hadfield »

When do I have to uncomppress the g95-x86-cygwin.tgz file in the installation?
Any time after installing Cygwin.
I have to install X11, perl, mingv, binutils, and someone else right?
I don't think you need X11. I don't know of any package called mingv--anyway I doubt you need it. The ones I can think of that you will need for ROMSx are:

bash, binutils, gcc, gcc-g77, make, perl, tar

Some of these will be installed by the Cygwin setup by default, some not. There are several others you probably will need, sooner or later:

bison, bzip2, chere, cygutils, diffutils, file, findutils, gzip, less, m4, man, patch, subversion, rxvt, zip, zlib

If in doubt, get it.
So, I would like to know when and where do I have to uncomppress the tar file g95 to make a succesfully installtion?
Put the tar file anywhere you like. Let's say ~/software/g95. As I said above, unpack it any time after installing Cygwin. The commands are

Code: Select all

$ cd /
$ tar -xvzf ${HOME}/software/g95/g95-x86-cygwin.tgz
The "cd /" is important.

Regarding the problem with the mount table I identified earlier, removing and re-installing Cygwin may not fix that, so you will have to fix it with the mount command.

Also, before you reinstall Cygwin, search your entire system for files named cygwin1.dll and delete them all.

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#29 Unread post by luis.chetu.83 »

Hi m.hadfield!!

I`m installing cygwin again, so, when I tried to uncomppress g95-x86-cygwin.tgz using:

$ cd/
$ tar -xvzf ${HOME}/software/g95/g95-x86-cygwin.tgz

I received this message:

$ tar -xvzf ${HOME}/software/g95/g95-x86-cygwin.tgz
tar (child): $: Cannot open: No such file or directory
tar (child): Error is not recoverable: existing now
tar: Child returned status 2
tar: {HOME}/software/g95/g95-x86-cygwin.tgz: Not found in archive
tar: Error exit delayed from previous errors

What do I have to do?

Luis A

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#30 Unread post by luis.chetu.83 »

By the way, if I type ls I receive:

$ ls
Cygwin.bat
Cygwin.ico
bin
cygdrive
dev
etc
home
lib
proc
tmp
usr
var
g95-x86-cygwin.tgz
netcdf.tar

Because I copied g95-x86-cygwin.tgz and netcdf.tar to this directory

Is it correct if I have these files here? (g95-x86... and netcdf...)

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

#31 Unread post by m.hadfield »

Re your earlier message, the fact that this failed

$ tar -xvzf ${HOME}/software/g95/g95-x86-cygwin.tgz

with "no such file or directory" suggests there is no such file as ${HOME}/software/g95/g95-x86-cygwin.tgz. So presumably you have put it somewhere else, in which case you should modify the command line so appropriately.

Now, in the next message you give the output from "ls", presumably after you had typed "cd /" and the listing you give looks like the listing of a Cygwin root directory. So the above command could be replaced by the following

$ tar -xvzf g95-x86-cygwin.tgz

However I suggest that after you have run this command you either delete the .tgz file or move it somewhere else for long-term storage, because the root directory is not an appropriate place for storing software archives. (As you can see I store mine in a subdirectory called "software" in my home directory.)

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#32 Unread post by luis.chetu.83 »

Hello m.hadfield!!

I finished to install cygwin, and I uncomppressed the g95-x86-cygwin.tar file and this generated me g95.exe and i686-pc-cygwin.exe in the /usr/local/bin directory, so, before I configurate netcdf I compiled ROMS to see if it will work succesfully and it worked without errors, then I configurated netcdf libraries using:

$ tar -xf netcdf.tar
$ cd netcdf-3.6.1/src
$ ./configurate --prefix=/usr/local
$ make
$ make check
$ make install

And it seems to work fine, but when I tried to compile ROMS again using make I received this message:

$ make
g95 -c -03 -ffast-math mod_netcdf.f90
In file mod_netcdf.f90:369

integer, parameter ::NF_FOUT = nf_real
1
Error: Symbol 'nf_real' at (1) has no IMPLICIT type
In file mod_netcdf.f90:374

integer, parameter ::NF_FRST = nf_double
1
Error: Symbol 'nf_double' at (1) has no IMPLICIT type
In file mod_netcdf.f90:377

integer, parameter ::NF_TYPE = nf_double
1
Error: Symbol 'nf_double' at (1) has no IMPLICIT type
make: *** [mod_netcdf.o] Error 1


What do I have to do now?

Is it easy to fix this errors?

Cheers
Luis A.

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

#33 Unread post by arango »

Well, if you check the e-mail that was sent to you when you registered you will notice that there are several links for :arrow: getting started. There are several basic steps that you need to follow and software that you need to have in order to compile ROMS. The error that you are having is because the makefile cannot find the NetCDF library.

Mark very kindly gave you very good instructions on how to install CygWin and g95. This is very trivial. This is the first time that I notice a user having so much problem installing both. There is great information in the web to do so . Now installing NetCDF under CygWin is not trivial using either g95 or ifort. If you use the google powered seach above in this forum you will see that there are a lot of messages on this subject. I recommend you to check these messages and give it a try. Otherwise, you need to get help from someone in your group with experience in Unix/Linux.

Good luck :!:

User avatar
luis.chetu.83
Posts: 25
Joined: Mon Jan 21, 2008 8:52 pm
Location: U. de G.

#34 Unread post by luis.chetu.83 »

Thanks a lot for your reply Arango!!

I`ll check carefully to solve this problem myself!!

Cheers
Luis A.

Post Reply