Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #12672 > unrolled thread

MinGW--New to it

Started by"W. eWatson" <wolftracks@invalid.com>
First post2011-12-19 19:47 -0800
Last post2011-12-27 07:47 -0800
Articles 11 — 3 participants

Back to article view | Back to comp.lang.c++


Contents

  MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-19 19:47 -0800
    Re: MinGW--New to it Geoff <geoff@invalid.invalid> - 2011-12-19 21:35 -0800
      Re: MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-20 08:09 -0800
        Re: MinGW--New to it Geoff <geoff@invalid.invalid> - 2011-12-20 10:47 -0800
          Re: MinGW--New to it gwowen <gwowen@gmail.com> - 2011-12-21 01:52 -0800
            Re: MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-22 13:31 -0800
              Re: MinGW--New to it gwowen <gwowen@gmail.com> - 2011-12-24 01:21 -0800
                Re: MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-26 13:01 -0800
                  Re: MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-26 13:18 -0800
                  Re: MinGW--New to it Geoff <geoff@invalid.invalid> - 2011-12-26 16:31 -0800
                    Re: MinGW--New to it "W. eWatson" <wolftracks@invalid.com> - 2011-12-27 07:47 -0800

#12672 — MinGW--New to it

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-19 19:47 -0800
SubjectMinGW--New to it
Message-ID<jcp0fp$e2n$1@dont-email.me>
Maybe the procedure outlined below is the same for C++ to Fortran.

Apparently, there's a package called MinGW that includes several 
languages, C, C++, fortran, ... for Windows. I use Win7, 64-bit. I 
downloaded mingw-get-inst-201111118.exe the other day for an install. At 
one point it asked what compilers I wanted. I checked only fortran 
(Gfortran, I believe). When it completed the install I could not find 
any compiler, but did find some sort of "mingw.get..." exe file. Am I 
supposed to execute it to get the fortran compiler?


[toc] | [next] | [standalone]


#12675

FromGeoff <geoff@invalid.invalid>
Date2011-12-19 21:35 -0800
Message-ID<a060f7lmkhusa0mqgs8vc56stnhp7gnk6o@4ax.com>
In reply to#12672
On Mon, 19 Dec 2011 19:47:03 -0800, "W. eWatson"
<wolftracks@invalid.com> wrote:

>Maybe the procedure outlined below is the same for C++ to Fortran.
>
>Apparently, there's a package called MinGW that includes several 
>languages, C, C++, fortran, ... for Windows. I use Win7, 64-bit. I 
>downloaded mingw-get-inst-201111118.exe the other day for an install. At 
>one point it asked what compilers I wanted. I checked only fortran 
>(Gfortran, I believe). When it completed the install I could not find 
>any compiler, but did find some sort of "mingw.get..." exe file. Am I 
>supposed to execute it to get the fortran compiler?
>
>

Did you read the Getting Started documentation on the mingw.org web
site?

You must set the PATH variable for the command line tools, the default
installation for those tools is "\mingw\bin\" or "Program
Files\mingw\bin". The installation dialog box should have presented
you with that information.

There are two Fortran compilers in the package, g77.exe and
gfortran.exe.

c:\>gfortran --version
GNU Fortran (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

[toc] | [prev] | [next] | [standalone]


#12695

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-20 08:09 -0800
Message-ID<jcqbve$5us$1@dont-email.me>
In reply to#12675
On 12/19/2011 9:35 PM, Geoff wrote:
> On Mon, 19 Dec 2011 19:47:03 -0800, "W. eWatson"
> <wolftracks@invalid.com>  wrote:
>
>> Maybe the procedure outlined below is the same for C++ to Fortran.
>>
>> Apparently, there's a package called MinGW that includes several
>> languages, C, C++, fortran, ... for Windows. I use Win7, 64-bit. I
>> downloaded mingw-get-inst-201111118.exe the other day for an install. At
>> one point it asked what compilers I wanted. I checked only fortran
>> (Gfortran, I believe). When it completed the install I could not find
>> any compiler, but did find some sort of "mingw.get..." exe file. Am I
>> supposed to execute it to get the fortran compiler?
>>
>>
>
> Did you read the Getting Started documentation on the mingw.org web
> site?
Completely missed it, or assumed that it would be a simple download and 
install like many MS products. Found the download quickly, and started 
there. I think the basis for MinGW looks like Linux, which I used long 
ago with C and maybe Perl and others.

I just copied Getting Started into MS Word to avoid printing all the 
extra marginal stuff, and will print it shortly.
>
> You must set the PATH variable for the command line tools, the default
> installation for those tools is "\mingw\bin\" or "Program
It sounds like I should uninstall mingw and start again. I guess I was 
expecting a simple install that's usually the case for most MS programs.

Since I'm using Win 7, I suspect I should add \mingw\bin\ to the end of 
the system PATH variable.  PATH = C:\stuff\...\morestuff;C:\mingw\bin\
> Files\mingw\bin". The installation dialog box should have presented
> you with that information.
Don't recall.
>
> There are two Fortran compilers in the package, g77.exe and
> gfortran.exe.
I want gfortran. I believe it has a Make facility, which is key to what 
I'm doing. I'm working with another fellow who is using G90 to recode an 
old fortran program. He's working in a Linux environment.

Is there some sort of general users manual for it? I noticed on Getting 
Started some GUI. Does that have a manual, and is it a separate install?


>
> c:\>gfortran --version
> GNU Fortran (GCC) 4.6.1
So gfortran is GNU fortran?

I tried joining the mailing list by providing my sbcglobal address. 
Never got a confirmation. I then used my mail facility on my web host 
site, and did get registered, and even logged into something. I have not 
rcvd any mailings. Found a sort of forum where posts had been made, but 
none looked current.

Ran into gmane.comp.gnu.mingw.user wandering around the mingw web pages. 
It appears it might be a mailing list disguised as a newsgroup. Still 
haven't figured how to reach it. Found this though:

http://en.wikipedia.org/wiki/Gmane
http://gmane.org/faq.php

Maybe that will help.

[toc] | [prev] | [next] | [standalone]


#12703

FromGeoff <geoff@invalid.invalid>
Date2011-12-20 10:47 -0800
Message-ID<ogl1f7h4e47c2klqo2o7p7pef8a2k8mnc7@4ax.com>
In reply to#12695
On Tue, 20 Dec 2011 08:09:16 -0800, "W. eWatson"
<wolftracks@invalid.com> wrote:

>On 12/19/2011 9:35 PM, Geoff wrote:
>> On Mon, 19 Dec 2011 19:47:03 -0800, "W. eWatson"
>> <wolftracks@invalid.com>  wrote:
>>
>>> Maybe the procedure outlined below is the same for C++ to Fortran.
>>>
>>> Apparently, there's a package called MinGW that includes several
>>> languages, C, C++, fortran, ... for Windows. I use Win7, 64-bit. I
>>> downloaded mingw-get-inst-201111118.exe the other day for an install. At
>>> one point it asked what compilers I wanted. I checked only fortran
>>> (Gfortran, I believe). When it completed the install I could not find
>>> any compiler, but did find some sort of "mingw.get..." exe file. Am I
>>> supposed to execute it to get the fortran compiler?
>>>
>>>
>>
>> Did you read the Getting Started documentation on the mingw.org web
>> site?
>Completely missed it, or assumed that it would be a simple download and 
>install like many MS products. Found the download quickly, and started 
>there. I think the basis for MinGW looks like Linux, which I used long 
>ago with C and maybe Perl and others.
>
>I just copied Getting Started into MS Word to avoid printing all the 
>extra marginal stuff, and will print it shortly.
>>
>> You must set the PATH variable for the command line tools, the default
>> installation for those tools is "\mingw\bin\" or "Program
>It sounds like I should uninstall mingw and start again. I guess I was 
>expecting a simple install that's usually the case for most MS programs.
>
I don't know that an uninstall is necessary but you will probably want
to install with the MSYS option to get the *nix terminal environment
that you'll need to run make and the other tools. This will also put
you in a home directory where you can begin your project. Running MSYS
also makes fooling with PATH unnecessary.

>Since I'm using Win 7, I suspect I should add \mingw\bin\ to the end of 
>the system PATH variable.  PATH = C:\stuff\...\morestuff;C:\mingw\bin\
>> Files\mingw\bin". The installation dialog box should have presented
>> you with that information.
>Don't recall.

It was in the GUI installer, just after the license dialog. One
important caveat, DON'T install to a path with spaces in it. Take the
default c:\mingw.

>>
>> There are two Fortran compilers in the package, g77.exe and
>> gfortran.exe.
>I want gfortran. I believe it has a Make facility, which is key to what 
>I'm doing. I'm working with another fellow who is using G90 to recode an 
>old fortran program. He's working in a Linux environment.
>
>Is there some sort of general users manual for it? I noticed on Getting 
>Started some GUI. Does that have a manual, and is it a separate install?
>
The only GUI program is the installer, all the other tools are
command-line. You might be able to customize a third-party tool like
UltraEdit to be your IDE for the tools.

>
>>
>> c:\>gfortran --version
>> GNU Fortran (GCC) 4.6.1
>So gfortran is GNU fortran?
>
>I tried joining the mailing list by providing my sbcglobal address. 
>Never got a confirmation. I then used my mail facility on my web host 
>site, and did get registered, and even logged into something. I have not 
>rcvd any mailings. Found a sort of forum where posts had been made, but 
>none looked current.
>
>Ran into gmane.comp.gnu.mingw.user wandering around the mingw web pages. 
>It appears it might be a mailing list disguised as a newsgroup. Still 
>haven't figured how to reach it. Found this though:
>
>http://en.wikipedia.org/wiki/Gmane
>http://gmane.org/faq.php
>
>Maybe that will help.

Yes, I am far from expert in MinGW, it's a tool I use occasionally,
nothing more.

[toc] | [prev] | [next] | [standalone]


#12725

Fromgwowen <gwowen@gmail.com>
Date2011-12-21 01:52 -0800
Message-ID<76987354-258e-4b67-8b58-f34af011a9f6@f11g2000yql.googlegroups.com>
In reply to#12703
On Dec 20, 6:47 pm, Geoff <ge...@invalid.invalid> wrote:

> >Is there some sort of general users manual for it? I noticed on Getting
> >Started some GUI. Does that have a manual, and is it a separate install?
>
> The only GUI program is the installer, all the other tools are
> command-line. You might be able to customize a third-party tool like
> UltraEdit to be your IDE for the tools.

I believe Code::Blocks is an IDE with reasonable MinGW compatibility
http://wiki.codeblocks.org/index.php?title=MinGW_installation
Some colleague use it - I don't.

> >So gfortran is GNU fortran?

It is.  g77 is (basically) Fortran77 only, gfortran supports things
from Fortran90 and later. I don't know whether the whole standard is
covered - it wasn't when I last used it but that was 5 years ago.

> Yes, I am far from expert in MinGW, it's a tool I use occasionally,
> nothing more.

I use the tdragon MinGW releases (http://tdm-gcc.tdragon.net/) almost
every day, but only for GCC and G++, and only from an MSYS command
line or within emacs...

[toc] | [prev] | [next] | [standalone]


#12747

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-22 13:31 -0800
Message-ID<jd07jb$sbf$1@dont-email.me>
In reply to#12725
On 12/21/2011 1:52 AM, gwowen wrote:
> On Dec 20, 6:47 pm, Geoff<ge...@invalid.invalid>  wrote:
>
>>> Is there some sort of general users manual for it? I noticed on Getting
>>> Started some GUI. Does that have a manual, and is it a separate install?
>>
>> The only GUI program is the installer, all the other tools are
>> command-line. You might be able to customize a third-party tool like
>> UltraEdit to be your IDE for the tools.
>
> I believe Code::Blocks is an IDE with reasonable MinGW compatibility
> http://wiki.codeblocks.org/index.php?title=MinGW_installation
> Some colleague use it - I don't.
>
>>> So gfortran is GNU fortran?
>
> It is.  g77 is (basically) Fortran77 only, gfortran supports things
> from Fortran90 and later. I don't know whether the whole standard is
> covered - it wasn't when I last used it but that was 5 years ago.
>
>> Yes, I am far from expert in MinGW, it's a tool I use occasionally,
>> nothing more.
>
> I use the tdragon MinGW releases (http://tdm-gcc.tdragon.net/) almost
> every day, but only for GCC and G++, and only from an MSYS command
> line or within emacs...

Does it allow for "free form" on lines? That is, no column # concerns.

[toc] | [prev] | [next] | [standalone]


#12785

Fromgwowen <gwowen@gmail.com>
Date2011-12-24 01:21 -0800
Message-ID<4c48d195-13b6-4f29-bcea-9363f20989da@v14g2000yqh.googlegroups.com>
In reply to#12747
On Dec 22, 9:31 pm, "W. eWatson" <wolftra...@invalid.com> wrote:
> Does it allow for "free form" on lines? That is, no column # concerns.


gfortran definitely. g77, can't remember, its been so long.
A quick google suggests it does.
http://uw714doc.sco.com/cgi-bin/info2html?%28g77.info%29Source%2520Form&lang=en

[toc] | [prev] | [next] | [standalone]


#12820

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-26 13:01 -0800
Message-ID<jdanc1$flc$1@dont-email.me>
In reply to#12785
On 12/24/2011 1:21 AM, gwowen wrote:
> On Dec 22, 9:31 pm, "W. eWatson"<wolftra...@invalid.com>  wrote:
>> Does it allow for "free form" on lines? That is, no column # concerns.
>
>
> gfortran definitely. g77, can't remember, its been so long.
> A quick google suggests it does.
> http://uw714doc.sco.com/cgi-bin/info2html?%28g77.info%29Source%2520Form&lang=en

OK, I uninstalled, and added mysys to the install. I got to the 
folder/mingw/bin and entered mingw-get forthran gdb.

I had added to my PATH: ;C:\MinGW\bin

After a few lines it tells me "**ERROR** pkg 
gcc-fortran-4.6.1-2-mingw32-bin.bar.lzma is already installed."

It then tried to install (with ERROR) gdb-7.3.1=1 ... lsmza, which it 
claims is installed already.

Then it tries installing a gdb-7.3 ... doc file with success.

So where am I? I don't see gfortran on the Win 7 start menu.

(BTW, how do I copy anything from the shell window?)

A search for gfortran turns up gfortran.exe

Ah, I do see under Users\Wayne\Fortran\SourceForge\bin the gfortran.exe 
file.

I'm sending this as is, and will report back if I get gfortran to 
execute successfully, or my computer blew up.  :-)

[toc] | [prev] | [next] | [standalone]


#12822

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-26 13:18 -0800
Message-ID<jdaobj$l0q$1@dont-email.me>
In reply to#12820
...
>
> I'm sending this as is, and will report back if I get gfortran to
> execute successfully, or my computer blew up. :-)

Well it didn't blow up, and I tried executed at the command prompt in 
bin. Apparently, it needs an input file. Probably helloworld.for or 
something. I tried to create something vi, but it appears to have pulled 
it out of of a WATCOM f77 install, which I do not use.

OK, I found for program that was incomplete, and used it. It gave me 
enough info when I tried to compile it that I do have a working fortran 
compiler.

So where is a users manual that will tell me more, and where is the gdb 
doc I mentioned? Is there a choice of an editor here that I can access 
w/o drifing off to WATCOM f77 vi editor?  I presume there's a Make 
ability here, and I have a make file I could try it on.

Definite progress.

[toc] | [prev] | [next] | [standalone]


#12824

FromGeoff <geoff@invalid.invalid>
Date2011-12-26 16:31 -0800
Message-ID<f13if7hq8uhdqttkbpm6q6c6chfo0s5mnn@4ax.com>
In reply to#12820
On Mon, 26 Dec 2011 13:01:47 -0800, "W. eWatson"
<wolftracks@invalid.com> wrote:

>So where am I? I don't see gfortran on the Win 7 start menu.

You should end up with a MinGW group and MinGW Shell shortcut in your
Programs group. The shortcut to the shell sets up your environment.
The shell home directory has the absolute Windows path of:
C:\MinGW\msys\1.0\home\Username so you need to create a Windows
Explorer shortcut to open that for copying files to it. You can also
open a quick explorer shell by typing "explorer ." at the prompt,
without the quotes of course.

You don't do another mingw-get. You already have everything via the
installer.

Here's a Fortran 77 program that compiles correctly and prints command
line arguments it receives. I just grabbed it off the web, I don't
have anything in newer Fortran.

--------------- cut here ---------------
      program main

c*********************************************************************72
c
cc MAIN is the main program for ARGS.
c
c  Discussion:
c
c    ARGS demonstrates the use of the (semi-standard) GETARGS utility.
c
c  Licensing:
c
c    This code is distributed under the GNU LGPL license. 
c
c  Modified:
c
c    24 January 2009
c
c  Author:
c
c    John Burkardt
c
c  Modified:
c
c    26 April 2007
c
c  Author:
c
c    John Burkardt
c
c  Usage:
c
c    args arg1 arg2 arg3 ...
c
      implicit none

      character * ( 80 ) arg
      integer i
      integer iargc
      integer numarg

      call timestamp ( )
      write ( *, '(a)' ) ' '
      write ( *, '(a)' ) 'ARGS'
      write ( *, '(a)' ) '  FORTRAN77 version'
      write ( *, '(a)' ) '  Demonstrate the use of the command line'
      write ( *, '(a)' ) '  argument routines GETARG and IARGC.'

      numarg = iargc ( )

      write ( *, '(a)' ) ' '
      write ( *, '(a,i8,a)' ) 
     &  '  ARGS was called with IARGC() = ', numarg, ' arguments.'

      write ( *, '(a)' ) ' '
      write ( *, '(a)' ) '  CALL GETARG(I,ARG) returns the arguments:'
      write ( *, '(a)' ) ' '
      write ( *, '(a)' ) '  I     ARG '
      write ( *, '(a)' ) ' '

      do i = 0, numarg
        call getarg ( i, arg )
        write ( *, '(2x,i3,2x,a)' ) i, arg
      end do

      write ( *, '(a)' ) ' '
      write ( *, '(a)' ) 'ARGS:'
      write ( *, '(a)' ) '  Normal end of execution.'
      write ( *, '(a)' ) ' '
      call timestamp ( )

      stop
      end
      subroutine timestamp ( )

c*********************************************************************72
c
cc TIMESTAMP prints out the current YMDHMS date as a timestamp.
c
c  Discussion:
c
c    This FORTRAN77 version is made available for cases where the
c    FORTRAN90 version cannot be used.
c
c  Licensing:
c
c    This code is distributed under the GNU LGPL license. 
c
c  Modified:
c
c    24 January 2009
c
c  Author:
c
c    John Burkardt
c
c  Modified:
c
c    12 January 2007
c
c  Author:
c
c    John Burkardt
c
c  Parameters:
c
c    None
c
      implicit none

      character * ( 8 ) ampm
      integer d
      character * ( 8 ) date
      integer h
      integer m
      integer mm
      character * ( 9 ) month(12)
      integer n
      integer s
      character * ( 10 ) time
      integer y

      save month

      data month /
     &  'January  ', 'February ', 'March    ', 'April    ', 
     &  'May      ', 'June     ', 'July     ', 'August   ', 
     &  'September', 'October  ', 'November ', 'December ' /

      call date_and_time ( date, time )

      read ( date, '(i4,i2,i2)' ) y, m, d
      read ( time, '(i2,i2,i2,1x,i3)' ) h, n, s, mm

      if ( h .lt. 12 ) then
        ampm = 'AM'
      else if ( h .eq. 12 ) then
        if ( n .eq. 0 .and. s .eq. 0 ) then
          ampm = 'Noon'
        else
          ampm = 'PM'
        end if
      else
        h = h - 12
        if ( h .lt. 12 ) then
          ampm = 'PM'
        else if ( h .eq. 12 ) then
          if ( n .eq. 0 .and. s .eq. 0 ) then
            ampm = 'Midnight'
          else
            ampm = 'AM'
          end if
        end if
      end if

      write ( *, 
     &  '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) 
     &  d, month(m), y, h, ':', n, ':', s, '.', mm, ampm

      return
      end

-------------- cut here -------------

compile:
$ gfortran -o args args.f

run:
$ args test1 test2
26 December  2011   4:25:45.691 PM

ARGS
  FORTRAN77 version
  Demonstrate the use of the command line
  argument routines GETARG and IARGC.

  ARGS was called with IARGC() =        2 arguments.

  CALL GETARG(I,ARG) returns the arguments:

  I     ARG

    0  C:\MinGW\msys\1.0\home\Geoff\args.exe

    1  test1

    2  test2


ARGS:
  Normal end of execution.

26 December  2011   4:25:45.704 PM

----------------

Hello World in Fortran 90:

program helloworld
     write (*,*) "Hello, world."
end program helloworld

[toc] | [prev] | [next] | [standalone]


#12829

From"W. eWatson" <wolftracks@invalid.com>
Date2011-12-27 07:47 -0800
Message-ID<jdcpav$g8g$1@dont-email.me>
In reply to#12824
On 12/26/2011 4:31 PM, Geoff wrote:
> On Mon, 26 Dec 2011 13:01:47 -0800, "W. eWatson"
> <wolftracks@invalid.com>  wrote:
>
>> So where am I? I don't see gfortran on the Win 7 start menu.
>
> You should end up with a MinGW group and MinGW Shell shortcut in your
> Programs group. The shortcut to the shell sets up your environment.
...

> Hello World in Fortran 90:
>
> program helloworld
>       write (*,*) "Hello, world."
> end program helloworld
>

Thanks for the tips, and the programs. I think I need to find next some 
docs like a users manual for gfortran and graphics, etc. I think I can 
get them through queries on the mingw mail list, but something seems 
amiss there. I hope to have that cleared up today.

Oddly, despite the fact I only requested gfortran, I seem to have gotten 
other compilers including Python.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web