Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

configuring a gfortran capability on cygwin

47 views
Skip to first unread message

Uno

unread,
May 8, 2011, 12:57:00 AM5/8/11
to
I seem to be always traipsing back and forth between ubuntu maverick and
windows xp on my dual-boot machine. So I thought I would try to
decrease the frequency of re-boots by filling out my capabilities on
both sides.

I was going along pretty good:

[sorry, can only paste as quotation:]

> Copying skeleton files.
> These files are for the users to personalise their cygwin experience.
>
> They will never be overwritten nor automatically updated.
>
> `./.bashrc' -> `/home/dan//.bashrc'
> `./.bash_profile' -> `/home/dan//.bash_profile'
> `./.inputrc' -> `/home/dan//.inputrc'
> `./.profile' -> `/home/dan//.profile'
>
> dan@tja1-d5768e2d16 ~
> $ pwd
> /home/dan
>
> dan@tja1-d5768e2d16 ~
> $ cd ..
>
> dan@tja1-d5768e2d16 /home
> $ cd ..
>
> dan@tja1-d5768e2d16 /
> $ cd media
> bash: cd: media: No such file or directory
>
> dan@tja1-d5768e2d16 /
> $ cd media/
> bash: cd: media/: No such file or directory
>
> dan@tja1-d5768e2d16 /
> $ dir
> Cygwin.bat Thumbs.db cygdrive etc lib tmp var
> Cygwin.ico bin dev home proc usr
>
> dan@tja1-d5768e2d16 /
> $

q1) What does this filesystem have to do with any other? Once I send
this, I'm gonna go take a look from the ubuntu side, and I'll know about
where it is in the filesystem, but how does cygwin "see out," if, for
example, it doesn't have 'media'?
--
Uno

Uno

unread,
May 8, 2011, 2:50:36 AM5/8/11
to
On 5/7/2011 9:57 PM, Uno wrote:

> q1) What does this filesystem have to do with any other? Once I send
> this, I'm gonna go take a look from the ubuntu side, and I'll know about
> where it is in the filesystem, but how does cygwin "see out," if, for
> example, it doesn't have 'media'?

So let me ask a better question. I found my thumbdrive under /cygdrive/e:

dan@tja1-d5768e2d16 ~
$ pwd
/home/dan

dan@tja1-d5768e2d16 ~
$ cd ..

dan@tja1-d5768e2d16 /home
$ cd ..

dan@tja1-d5768e2d16 /
$ ls


Cygwin.bat Thumbs.db cygdrive etc lib tmp var
Cygwin.ico bin dev home proc usr

dan@tja1-d5768e2d16 /
$ cd cygdrive/

dan@tja1-d5768e2d16 /cygdrive
$ ls
c e

dan@tja1-d5768e2d16 /cygdrive
$ cd e

...
$ cd gcc_eq32/

dan@tja1-d5768e2d16 /cygdrive/e/gcc_eq32
$ ls
Shortcut.bat echo lib run1.bat type
bin gcc-4.6-20100501-32.exe libexec share udtmod.mod
cls gfortran out source wtc1.f90
crude1.f90 i686-pc-mingw32 out.exe tem1.c
crude1.f90~ include p1.f90 tem2.c
da1.f90 jk3.f p2.f90 tobias1.f90
dir judy1.f90 p3.f90 tobias1.f90~

dan@tja1-d5768e2d16 /cygdrive/e/gcc_eq32
$ cd ..

dan@tja1-d5768e2d16 /cygdrive/e
$ cd fortran_stuff/

dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
$ ls
b.f90 include p1.f90
bin jb1.f90 r1.f90
blev1.f90 k1.f90 r1.f90~
caller1.f90 k1.f90~ run2.bat
caller2.f90 k1.mod run2.bat~
directory.mod libexec share
dw3.f90 m1.f90 sharp entry first rate-MERRILL.skp
fortran_resources.pdf m2.f90 template1.f90
fortranlog1.txt m3.f90 test1.f90
gcc-4.6-20100515-64.exe m3.f90~ test2.f90
gfortran m4.f90 tobias1.f90
gfortran.pdf m5.f90 type
holl1.f77 out x86_64-pc-mingw32
holl1.for out1

dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
$

So I've got source there now, but not only do I not have gfortran, I
don't have ftp and any other thing I tried.

The one thing I wanted to make people aware of who are smarter than me
is that the gcc_eq32 was a 32-bit thing, while 'fortran_stuff' was 64-bit.

Thanks for your comment.
--
Uno

glen herrmannsfeldt

unread,
May 8, 2011, 2:44:36 AM5/8/11
to
Uno <merril...@q.com> wrote:
> I seem to be always traipsing back and forth between ubuntu maverick and
> windows xp on my dual-boot machine. So I thought I would try to
> decrease the frequency of re-boots by filling out my capabilities on
> both sides.

Do you have the NTFS driver for the linux side? That helps.

As far as I know, there is no Windows driver for any unix
file system.

-- glen

Ian

unread,
May 8, 2011, 4:22:05 PM5/8/11
to
I have used a number of linux distributions on
dual boot systems and have had the most success
with mixing windows and suse linux.

the suse side can see ntfs windows disks
and generally can read and write ntfs
disks.

so a working practice i use is

boot windows
write fortran programs
reboot and start suse
mount disks and copy files over

i've never been able to 'see' linux
disks from a windows os that would enable me
to use files and directories.

i have not used ubuntu, as most linux software
i have to deal with supports redhat and suse.
the oracle/sun sunstudio fortran ide
and sun compiler works really well on suse linux.

i also tar files on the linux side and email
to myself and then use cygwin
on the windows side to extract stuff.

bit tedious i admit.

unix2dos and dos2unix are also life savers :-)

cheers

Ian Chivers

> Uno- Hide quoted text -
>
> - Show quoted text -

carolus

unread,
May 11, 2011, 10:49:35 AM5/11/11
to
On 5/7/2011 11:57 PM, Uno wrote:
> I seem to be always traipsing back and forth between ubuntu maverick and
> windows xp on my dual-boot machine. So I thought I would try to decrease
> the frequency of re-boots by filling out my capabilities on both sides.

If you don't need graphics, just do everything in Cygwin. It is almost
exactly the same as using telnet to connect to a linux server. No
rebooting, no driver problems, no file system incompatibilities, and the
usual linux commands can be used without risk on your NTFS file system.

But perhaps only us old-timers can get by without graphics.

Ivan D. Reid

unread,
May 12, 2011, 4:48:50 PM5/12/11
to
On Sat, 07 May 2011 23:50:36 -0700, Uno <merril...@q.com>
wrote in <92mp9d...@mid.individual.net>:

> On 5/7/2011 9:57 PM, Uno wrote:

>> q1) What does this filesystem have to do with any other? Once I send
>> this, I'm gonna go take a look from the ubuntu side, and I'll know about
>> where it is in the filesystem, but how does cygwin "see out," if, for
>> example, it doesn't have 'media'?

> So let me ask a better question. I found my thumbdrive under /cygdrive/e:

Yes; /cygdrive is the root of the Windows file system in cygwin;
your Windows-mounted drives appear there as the appropriate letter of the
alphabet.

> So I've got source there now, but not only do I not have gfortran, I
> don't have ftp and any other thing I tried.

> The one thing I wanted to make people aware of who are smarter than me
> is that the gcc_eq32 was a 32-bit thing, while 'fortran_stuff' was 64-bit.

> Thanks for your comment.

Go to www.cygwin.com with your favourite browser
Right-click on the link to setup.exe; select "Save as..." and save
it in C:\cygwin
Exit the browser, open a Windows Explorer window and navigate to
C:\cygwin
Double-click on the setup.exe entry to run it
Keep clicking on "Next" to take all the default options
When you get to the mirror selection, choose one near you
At the "Select Packages" panel, click on "View" until ypu get to
"Category" view
Click the [+] next to "Devel" then scroll down until you get to
"gcc4-fortran" -- select it
At this point you may want to go to "View" category "All" and
select anything else you want, such as ftp
Click "Next" to install the selected packages (and any others that
need updating or are required for gfortran)
You now have gfortran:

Compaq_Owner@HomePC01 /cygdrive/c/ivan/words
$ gfortran --v
Using built-in specs.
Target: i686-pc-cygwin

Configured with:
/gnu/gcc/releases/respins/4.3.4-4/gcc4-4.3.4-4/src/gnfigure
--srcdir=/gnu/gcc/releases/respins/4.3.4-4/gcc4-4.3.4-4/src/g prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbinr=/usr/lib
--datadir=/usr/share --localstatedir=/var --sysconfdir=/et
=/usr/share/info --mandir=/usr/share/man -C --datadir=/usr/share
--inshare/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/us
bootstrap --enable-version-specific-runtime-libs
--with-slibdir=/usr/ecdir=/usr/lib --enable-static --enable-shared
--enable-shared-libgcc __cxa_atexit --with-gnu-ld --with-gnu-as
--with-dwarf2 --disable-sjlj
--enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-sym
le-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --ena
--enable-threads=posix --with-arch=i686 --with-tune=generic --enable- ibs
CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATM
GET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/j

Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)

Compaq_Owner@HomePC01 /cygdrive/c/ivan/words
$ which gfortran
/usr/bin/gfortran

Simples!

--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".

Tim Prince

unread,
May 13, 2011, 6:42:48 PM5/13/11
to
The cygwin setup menu also offers good mingw cross compilers (cross
compiling from cygwin to native Windows target) for both 32- and 64-bit
mode. For some purposes, I find the native 64-bit target mode
preferable to the 32-bit cygwin mode.
Caution: the mingw cross compilers are generally off topic on the
cygwin support mail list.

Uno

unread,
May 20, 2011, 3:09:21 AM5/20/11
to

I've got my windows partition in media/ if I want to find it. I believe
that I have the capability that you allude to except that anything in my
pull-down menu for nautilus gives me my music player.

I figure that's the gnomes forcing me to use a terminal like a grown-up.
Alternatively, they just might like music more than my programming.

Let me ask you this question. How do I guery my *nix compliant system
to tell me where the files are that make compilation happen when I
invoke the gfortran compiler?
--
Uno

Alberto Luaces

unread,
May 20, 2011, 4:02:20 AM5/20/11
to
Uno writes:

gfortran only looks for files in the current directory from which you
call it if relative or absolute paths to sources are not given.

--
Alberto

Uno

unread,
May 22, 2011, 12:08:36 AM5/22/11
to
On 5/20/2011 1:02 AM, Alberto Luaces wrote:
> Uno writes:

>> Let me ask you this question. How do I guery my *nix compliant system
>> to tell me where the files are that make compilation happen when I
>> invoke the gfortran compiler?
>
> gfortran only looks for files in the current directory from which you
> call it if relative or absolute paths to sources are not given.
>

I suppose I meant files like gfortran.exe and the libraries. Meanwhile,
I seem to be going backwards with cygwin:

dan@tja1-d5768e2d16 ~
$ ls -l
total 0

dan@tja1-d5768e2d16 ~
$

What do you do when root has no files?
--
Uno

timprince

unread,
May 22, 2011, 7:15:05 AM5/22/11
to
Do you mean
$ ls /
Cygwin.bat proc
Cygwin.ico sbin
bin setup.exe
cygdrive setup.log
dev setup.log.full
etc tmp
home usr
http%3a%2f%2fmirrors.kernel.org%2fsourceware%2fcygwin%2f var
lib

or, do you mean you forgot to put a Fortran source file in your working
directory?

$ which gfortran
/usr/bin/gfortran

$ gfortran -print-search-dirs
install: /usr/lib/gcc/i686-pc-cygwin/4.3.4/
programs: =/usr/lib/gcc/i686-pc-cygwin/4.3.4/
..........

If you've mucked up your cygwin installation, you could remove it,
preferably after reading the docs, and install again, including
selection of gcc4-fortran or your other preferred gfortran.

If you could get your act together and choose an appropriate forum among
the gcc-fortran, gcc-help, and cygwin lists, you might make faster
progress (most of it by reading the docs and preparing before asking
questions).

Uno

unread,
May 23, 2011, 4:25:05 PM5/23/11
to
On 5/22/2011 4:15 AM, timprince wrote:

> Do you mean
> $ ls /

Thanks for your comment, Tim. Indeed, I did. There's a grab bag of
little differences between the commands of cygwin and *nix.

> or, do you mean you forgot to put a Fortran source file in your working
> directory?
>
> $ which gfortran
> /usr/bin/gfortran

This is what I get, too.

So, following what Dr. Reid and Tim posted, I do now have a cygwin
fortran capability.

[sorry, could only paste as quotation with thunderbird]
[it's confusing as heck, and I don't know why]
[it's sometimes my only choice]
>
> dan@tja1-d5768e2d16 ~
> $ ls /
> Cygwin.bat cygdrive http%3a%2f%2fmirrors.xmission.com%2fcygwin%2f tmp
> Cygwin.ico dev lib usr
> Thumbs.db etc proc var
> bin home setup.exe
>
> dan@tja1-d5768e2d16 ~
> $ cd /cygdrive/
>
> dan@tja1-d5768e2d16 /cygdrive
> $ ls
> c d e


>
> dan@tja1-d5768e2d16 /cygdrive
> $ cd e
>

> dan@tja1-d5768e2d16 /cygdrive/e
> $ ls
> 32 bit.lnk index.html
...
> germanresistance.com.zip zax2.html
>
> dan@tja1-d5768e2d16 /cygdrive/e
> $ cd fortran_stuff


>
> dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
> $ ls
> b.f90 include p1.f90

...
> gfortran m4.f90 tobias1.f90
...
>
> dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
> $ gfortran test1.f90 -o out.exe
> $ dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
> $ ./out.exe
> 4 8 -1 8
> 3.1415927 3.1415927410125732 3.1415927410125732
>
> dan@tja1-d5768e2d16 /cygdrive/e/fortran_stuff
> $ cat test1.f90
> implicit none
>
> integer, parameter :: sp = selected_real_kind(1,3)
> integer, parameter :: dp = selected_real_kind(15,300)
> integer, parameter :: qp_preferred = selected_real_kind(30,1000)
> integer, parameter :: qp = (1+sign(1,qp_preferred))/2*qp_preferred+ &
> (1-sign(1,qp_preferred))/2*dp
>
>
>
> real (kind=sp) w
> real (kind=dp) y
> real (kind=qp) z
>
> w = 4.0*atan(1.0)
> y = 4.0*atan(1.0)
> z = 4.0*atan(1.0)
>
> print *, sp,dp,qp_preferred,qp
> print *, w,y,z
> endprogram
>
>
> ! gfortran -Wall -Wextra test1.f90 -o out.exe

I was disappointed that a person can't paste commands into the window.

[quoted comments past this point are Tim's again]

> $ gfortran -print-search-dirs
> install: /usr/lib/gcc/i686-pc-cygwin/4.3.4/
> programs: =/usr/lib/gcc/i686-pc-cygwin/4.3.4/
> ..........

That's what I get, too.


>
> If you've mucked up your cygwin installation, you could remove it,
> preferably after reading the docs, and install again, including
> selection of gcc4-fortran or your other preferred gfortran.

I did remove it, when I couldn't find anything under root and followed
Dr. Reid's recipe closely thereafter on rebuilding.


>
> If you could get your act together and choose an appropriate forum among
> the gcc-fortran, gcc-help, and cygwin lists, you might make faster
> progress (most of it by reading the docs and preparing before asking
> questions).

I'm definitely overdue to read through the cygwin stuff at least once.
I've never been able to use a mailing list fruitfully. Of course, I
only tried with gfortran and gcc, where I might be less than popular.

I wish there were a place on usenet where you can go and ask: is there a
group out there where this question ____ is topical. A search for
cygwin reveals this group: de.alt.comp.cygwin+co. While I can
communicate in german, the place just looks rather forlorn. I rarely
find useful ng's by searching for them with keywords.
--
Uno

0 new messages