[EVALUATION] - E02 - Support for MinGW Open Source Compiler

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Lundh

    #46
    Re: - E02 - Support for MinGW Open Source Compiler

    "Pat" wrote:
    [color=blue]
    > If you are telling me that minGW can compile extensions that are
    > compatible with the Python 2.4 that uses msvcr71.dll, then that is good
    > news indeed. Is there anything that needs to be configured or patched
    > to make this happen? And how does minGW know which dll to link? What
    > if I have both versions of Python installed - 2.3.5 and 2.4? Is there
    > an easy way to detect this and switch between the two dlls?[/color]

    just use the right Python to run the setup.py script, and distutils will take
    care of the rest.

    </F>



    Comment

    • Fredrik Lundh

      #47
      Re: - E02 - Support for MinGW Open Source Compiler

      "Pat" wrote:
      [color=blue]
      > Having to tell users that they need to download, install, and configure
      > all this additional compiler stuff is asking too much from my potential
      > user base, since I'm also targeting novices and developers from other
      > languages for whom C compiler stuff is going to be a barrier to entry.
      >
      > I hope that makes sense. :-)[/color]

      telling them to download and configure subversion just to be able to use
      your stuff doesn't make much sense, no.

      (not that subversion is hard to install, though, but it's a lot harder than just
      running a bdist installer).

      </F>



      Comment

      • Fredrik Lundh

        #48
        Re: - E02 - Support for MinGW Open Source Compiler

        Stephen Kellett wrote:
        [color=blue][color=green]
        >>if I have both versions of Python installed - 2.3.5 and 2.4? Is there
        >>an easy way to detect this and switch between the two dlls?[/color]
        >
        > Easy? Depends what you call easy.[/color]

        in the context of "building a C extension when you have multiple versions
        installed", the answer is "easy". setup.py automatically finds the right DLL,
        mingw seems take care of the rest.
        [color=blue]
        > a) You just need to detect if pythonNN.dll is implicitly linked to msvcrt.dll or msvcrXX.dll
        > (where XX indicates a VS studio number, currently XX can only be 71, but if Python is done for
        > Visual Studio 2005 (8.0) then XX may also have a value of 80).
        >
        > b) GetModuleHandle (name of DLL from a) to get the DLL handle.
        >
        > c) GetProcAddress on the respective to get the C runtime function you want to call (for example,
        > fopen).
        >
        > d) call the function.
        >
        > You either need (a) or all of (a)...(d) depending on what you are doing. Those embedding Python
        > but no idea of the Python version in advance will do the latter.[/color]

        if someone needs code that does it all, check the exemaker sources:



        </F>



        Comment

        • Stephen Kellett

          #49
          Re: - E02 - Support for MinGW Open Source Compiler

          In message <gjA3VcsQFQECFw 0m@objmedia.dem on.co.uk>, Stephen Kellett
          <snail@objmedia .demon.co.uk> writes[color=blue]
          >In message <1108409476.874 751.16600@l41g2 000cwc.googlegr oups.com>, Pat
          ><pobrien@orbte ch.com> writes[color=green]
          >>if I have both versions of Python installed - 2.3.5 and 2.4? Is there
          >>an easy way to detect this and switch between the two dlls?[/color]
          >
          >Easy? Depends what you call easy.
          >
          >a) You just need to detect if pythonNN.dll is implicitly linked to
          >msvcrt.dll or msvcrXX.dll (where XX indicates a VS studio number,
          >currently XX can only be 71, but if Python is done for Visual Studio
          >2005 (8.0) then XX may also have a value of 80).[/color]

          I should have also mentioned that if you don't know how to do get the
          list of imported DLLs you can grab the source code for the PE Explorer
          DLL from:



          If you want to see how to use this DLL you can also grab:



          Stephen
          --
          Stephen Kellett
          Object Media Limited http://www.objmedia.demon.co.uk
          RSI Information: http://www.objmedia.demon.co.uk/rsi.html

          Comment

          • Stephen Kellett

            #50
            Re: - E02 - Support for MinGW Open Source Compiler

            In message <1108411614.268 293.61270@z14g2 000cwz.googlegr oups.com>, Pat
            <pobrien@orbtec h.com> writes[color=blue][color=green]
            >> What configuration hassle? Can't be any harder than specifying a
            >> different CRT surely?[/color]
            >
            >I don't want to have to ask users of my code to have to go through
            >this:
            >
            >http://www.vrplumber.com/programming/mstoolkit/[/color]

            OK. I misunderstood your original intent. I thought the original
            question was can we redistribute this DLL? I answered this bit. I wasn't
            attempting to answer the larger question about building extensions etc.
            My development environment has all the things in that article by default
            - I wouldn't even start work without them, so I had them "taken for
            granted" in my thoughts. I can see your problem :-) but I have no easy
            answer. Sorry.
            --
            Stephen Kellett
            Object Media Limited http://www.objmedia.demon.co.uk
            RSI Information: http://www.objmedia.demon.co.uk/rsi.html

            Comment

            • Pat

              #51
              Re: - E02 - Support for MinGW Open Source Compiler


              Fredrik Lundh wrote:[color=blue]
              > "Pat" wrote:
              >[color=green]
              > > Okay, I think we are pretty much talking about the same thing. My
              > > problem is not that I'm unable or unwilling to purchase a good
              > > compiler. My problem is that I don't want to make it a requirement[/color][/color]
              of[color=blue][color=green]
              > > my users. The twist is that my users will be working out of a
              > > Subversion repository that includes source code for extensions[/color][/color]
              written[color=blue][color=green]
              > > in C. Those extensions need to be compiled, and the code changes[/color][/color]
              too[color=blue][color=green]
              > > frequently for me to want to deal with supplying compiled binaries.[/color]
              >
              > here's what I do to supply compiled binaries for 2.1 through 2.4:
              >[color=green]
              > > mkall
              > > upload dist[/color]
              >[color=green]
              > > So I'm looking for options for Windows users who do not have, and[/color][/color]
              are[color=blue][color=green]
              > > unwilling to get, a Microsoft compiler. For some users, minGW is[/color][/color]
              an[color=blue][color=green]
              > > attractive option. For those who want to use minGW, I'm trying to
              > > establish whether or not minGW is a viable option, particularly for
              > > Python 2.4.[/color]
              >
              > here's what I just did (time in minutes):
              >
              > +00: googled for the mingw home page
              > +00: found the mingw download page
              > +02: finally figured out what to download
              > +03: noticed that my usual SF site only offered 1K/s; aborted[/color]
              download[color=blue]
              > +07: finished downloading the mingw kit from another SF site
              > +17: finished installing
              > +18: added \mingw\bin to the path
              > +18: typed "python setup.py install --compiler=mingw3 2"
              > +18: got a linker error; googled for help
              > +19: copied python24.dll to \mingw\lib
              > +20: finished building the sample library (cElementTree); all[/color]
              tests pass[color=blue]
              >
              > so what's your excuse for not doing this? ;-)[/color]

              A few things. Primarily the fact that I'm not very experienced in C
              (the extensions that I need to have compiled are not written by me).
              Secondarily, the fact that the discussion threads I read made it seem
              much more complicated than what you just described. Third, the fact
              that some of the code we've tried to compile didn't compile cleanly,
              the way your cElementTree did (but I can't remember what exactly the
              problem was and I didn't do the compiling). And, finally, an aversion
              to trial-and-error solutions. I prefer to Google and ask questions
              when I'm out of my element.

              Thanks for the info.

              --
              Patrick K. O'Brien
              Orbtech http://www.orbtech.com
              Schevo http://www.schevo.org
              Pypersyst http://www.pypersyst.org

              Comment

              • Stephen Kellett

                #52
                Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                In message <cuqta4$4c1$2@u senet.otenet.gr >, Ilias Lazaridis
                <ilias@lazaridi s.com> writes[color=blue]
                >I like to synchronize any efforts with the existing ones.[/color]

                I assume the reason for doing that would be to avoid duplicating effort?
                If that is the case why do you want lots of people all to answer your
                questionnaire. Thats a huge duplication of effort.

                A much more effective use of effort would be for you to do the research
                and when you are done to ask people to comment on the *results* of the
                research, not the questions.

                This accomplishes several things:
                o Reduction in duplication of effort.
                o Demonstrates to everyone else that you are prepared to do some work
                before asking questions.
                o When you find that the response is much more welcoming than you have
                had so far you will have learnt that you need to put some effort in to
                get some reward out (which is what most of us have been trying to tell
                you).

                Of course, based on your behaviour here (and currently in comp.lang.ruby
                where you are spinning a nice yarn in not bothering to read up on the
                answers people give you, even when their answers are detailed), I have
                not much hope of you taking the above approach.

                Stephen
                --
                Stephen Kellett
                Object Media Limited http://www.objmedia.demon.co.uk
                RSI Information: http://www.objmedia.demon.co.uk/rsi.html

                Comment

                • Fredrik Lundh

                  #53
                  Re: - E02 - Support for MinGW Open Source Compiler

                  "Pat" wrote:
                  [color=blue]
                  > A few things. Primarily the fact that I'm not very experienced in C
                  > (the extensions that I need to have compiled are not written by me).
                  > Secondarily, the fact that the discussion threads I read made it seem
                  > much more complicated than what you just described.[/color]

                  from two posts at the top of this thread:

                  "Writing a setup.py and running
                  python setup.py build_ext --compiler=mingw3 2
                  works for me *without* any more work. Things can't get much
                  simpler."

                  and

                  "The mingw compiler *is* supported through distutils. distutils
                  can straightforward ly be configured to build extensions with
                  mingw."

                  (now go read Ilias replies to those posts)
                  [color=blue]
                  > Third, the fact that some of the code we've tried to compile didn't compile
                  > cleanly, the way your cElementTree did (but I can't remember what exactly
                  > the problem was and I didn't do the compiling).[/color]

                  was that code tested under gcc? code that compiles under visual C doesn't
                  necessarily compile silently under gcc, but fixing that is usually pretty trivial
                  (no worse than porting mostly portable code between platforms).
                  [color=blue]
                  > And, finally, an aversion to trial-and-error solutions. I prefer to Google and
                  > ask questions when I'm out of my element.[/color]

                  sure didn't sound that way when you entered this thread:

                  "So in an effort to make some headway, I'm going to try to summarize the
                  current state of affairs. The bottom line is that compiling C extension modules
                  on the Windows platform for Python 2.4 is, today, a royal pain in the ass.
                  Period. Here's why. /.../"

                  now go download MinGW and figure out what's wrong with your C code.
                  if you get stuck, post the error messages, and I'm sure some c.l.pythoneer
                  will help you sort it out.

                  </F>



                  Comment

                  • Steve Horsley

                    #54
                    Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                    Stephen Kellett wrote:[color=blue]
                    > In message <cuq5du$k7g$1@u senet.otenet.gr >, Ilias Lazaridis
                    > <ilias@lazaridi s.com> writes
                    >[color=green][color=darkred]
                    >>> And yet there is not one company that has someone devoted full-time
                    >>> to developing Python. Not even Guido.[/color]
                    >>
                    >>
                    >> Who's "Guido"?[/color]
                    >
                    >
                    > LOL Falling off my chair!!!!!![/color]

                    I think the expression you are looking for is ROFL!

                    Comment

                    • Mike Meyer

                      #55
                      Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                      Ilias Lazaridis <ilias@lazaridi s.com> writes:[color=blue]
                      > If it is a programming language, the requirement "using an open-source
                      > toolchain" is a rational and valid one.[/color]

                      It is. However, mingW has nothing to do with "using an open-sourcer
                      toolchain".

                      Python runs in an environment with a full, open-source tool chain. You
                      can use it on Linux or any of the various BSDs. It also runs in an
                      environment where you can't have an open-source toolchain: Windows.

                      Once you've given up on an open-source environment, arguing about
                      trivia like which free compiler you are going to use is a waste of
                      time. Either use a real open-source environment, or live with the
                      closed-source tools/environment that someone is willing to support.

                      Or, of course, support the environment you want yourself.

                      <mike
                      --
                      Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
                      Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

                      Comment

                      • Ilias Lazaridis

                        #56
                        Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                        Stephen Kellett wrote:[color=blue]
                        > In message <cuqta4$4c1$2@u senet.otenet.gr >, Ilias Lazaridis
                        > <ilias@lazaridi s.com> writes
                        >[color=green]
                        >> I like to synchronize any efforts with the existing ones.[/color]
                        >
                        > I assume the reason for doing that would be to avoid duplicating effort?[/color]
                        [...] - (off-topic suggestions processing model)

                        Your suggestions were irrelevant to me.

                        Please avoid further off-topic posts.

                        ..

                        --

                        Comment

                        • Ilias Lazaridis

                          #57
                          Re: - E02 - Support for MinGW Open Source Compiler

                          Duncan Booth wrote:[color=blue]
                          > Ilias Lazaridis wrote:
                          >[color=green][color=darkred]
                          >>>There is a OS-tool-chain supported on windows, cygwin.[/color]
                          >>
                          >>this depends on cygwin.dll, which is GPL licensed
                          >>
                          >>[or am I wrong?][/color]
                          >
                          > It is GPL licensed with an amendment which prevents the GPL spreading to
                          > other open source software with which it is linked.
                          >
                          > "In accordance with section 10 of the GPL, Red Hat, Inc. permits programs
                          > whose sources are distributed under a license that complies with the Open
                          > Source definition to be linked with libcygwin.a without libcygwin.a itself
                          > causing the resulting program to be covered by the GNU GPL."[/color]

                          If I understand this right, I cannot produce commercial software with
                          the cygwin toolset.

                          ..

                          --

                          Comment

                          • Ilias Lazaridis

                            #58
                            Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                            [Sorry, I'm to tired to read more posts today. I'll try to answer to
                            each message adressed to me tomorrow. Thank you for your time.]

                            -

                            I find this thread facinating.

                            I don't know wich of the posters in this thread belong to the python team.

                            Nearly no one community member gives simply some answers to this very
                            simple questions.

                            Please summarize all the efforts the community has taken to write within
                            this thread.

                            This sum of efforts should be enouth to setup a basic official MinGW
                            compilation.

                            I have the strange feeling, that some people within the community and
                            the team are not intrested in this.

                            -

                            copied from another answer:

                            "The Python Foundation could create an official sub-project to create an
                            automated build target based on the MinGW toolchain. I am sure that many
                            community members would be more than happy to contribute."

                            -

                            Let's see:

                            The process would be:

                            a) A Python Foundation official states: "of course we accept diversity
                            and of course we are intrested that our source-code-base compiles
                            directly with MinGW (and other compilers)".

                            b) the pyMinGW developer states: "I am intrested that my patches are
                            included within the main python source code base" [of course this
                            contribution would deserve to be mentioned somewhere]

                            c) One part of the Python Community states: "look those loosers, like to
                            use MinGW toolkit - pah! I'll continue to use my super-optimizing, xx%
                            faster results, less hassle Microsoft-Compiler"

                            d) One part of the Python Community states: "I'm very happy that my
                            toolset of choice gets official support, to which I can contribute as a
                            community member"

                            e) there is no point e. People start simply to cooperate, thus python's
                            evolution is ensured.

                            -

                            I try to sleep after this communicational desaster here.

                            Good night to all.

                            ..

                            --

                            Comment

                            • Stephen Kellett

                              #59
                              Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

                              In message <cur8m5$g8h$1@n ews.freedom2sur f.net>, Steve Horsley
                              <shoot@the.moon > writes[color=blue]
                              >Stephen Kellett wrote:[color=green][color=darkred]
                              >>> Who's "Guido"?[/color]
                              >> LOL Falling off my chair!!!!!![/color]
                              >
                              >I think the expression you are looking for is ROFL![/color]

                              :-) Yes, but with that I could've been standing up before ending up on
                              the floor. I wrote it as I felt it!. Its a really good demonstration as
                              to the depth of the research performed by Illias.

                              I'm waiting for the "Who's Matz?" comment in comp.lang.ruby. ...

                              Stephen
                              --
                              Stephen Kellett
                              Object Media Limited http://www.objmedia.demon.co.uk
                              RSI Information: http://www.objmedia.demon.co.uk/rsi.html

                              Comment

                              • Robert Kern

                                #60
                                Re: - E02 - Support for MinGW Open Source Compiler

                                Ilias Lazaridis wrote:[color=blue]
                                > Duncan Booth wrote:
                                >[color=green]
                                >> Ilias Lazaridis wrote:
                                >>[color=darkred]
                                >>>> There is a OS-tool-chain supported on windows, cygwin.
                                >>>
                                >>>
                                >>> this depends on cygwin.dll, which is GPL licensed
                                >>>
                                >>> [or am I wrong?][/color]
                                >>
                                >>
                                >> It is GPL licensed with an amendment which prevents the GPL spreading
                                >> to other open source software with which it is linked.
                                >>
                                >> "In accordance with section 10 of the GPL, Red Hat, Inc. permits
                                >> programs whose sources are distributed under a license that complies
                                >> with the Open Source definition to be linked with libcygwin.a without
                                >> libcygwin.a itself causing the resulting program to be covered by the
                                >> GNU GPL."[/color]
                                >
                                >
                                > If I understand this right, I cannot produce commercial software with
                                > the cygwin toolset.[/color]

                                Wait, you demand a completely open source toolchain on a proprietary
                                operating system to develop proprietary software?

                                The mind *boggles*.

                                --
                                Robert Kern
                                rkern@ucsd.edu

                                "In the fields of hell where the grass grows high
                                Are the graves of dreams allowed to die."
                                -- Richard Harter

                                Comment

                                Working...