Loading ...
Sorry, an error occurred while loading the content.

Re: vim + OSX + [perl|python|tcl|ruby]

Expand Messages
  • Benji Fisher
    ... [snip] I assume that the patch I just snipped is the same as official patch 6.2.140 . I tried it with 10.3 and got errors during linking: ld: Undefined
    Message 1 of 13 , Oct 29, 2003
    • 0 Attachment
      On Wed, Oct 29, 2003 at 12:23:02PM +0100, Bram Moolenaar wrote:
      >
      > Bob Ippolito wrote:
      >
      > > On Oct 28, 2003, at 10:37 PM, Benji Fisher wrote:
      > >
      > > > I cannot get vim to compile on OS X.iii with any of perl, python,
      > > > tcl, nor ruby. There seem to be different reasons each time.
      > >
      > > --
      > >
      > > > Python: During compilation, I get warnings: "gcc: unrecognized option
      > > > `-pthread' ." Then, during linking, "ld: can't locate file for:
      > > > -lpython2.3 ."
      > >
      > > <I haven't tried building vim, but> The correct linker flags for Python
      > > on OS X 10.3 are -framework Python
      >
      > This argument was already there, but also much more than that. I
      > removed the "-lpython2.3" part and now I managed to compile Vim with
      > Python support. Yeah! This is on 10.2. I think it works for Python
      > 2.3 and later (which is included with 10.3, I installed it myself on
      > 10.2).
      >
      > Now we need to make a configure check for this... The patch below
      > appears to work.
      >
      > The check for adding "-pthread" doesn't work, because configure expects
      > the compiler to fail, not that it gives a warning message only. It's
      > harmless, but I don't like getting a warning message.
      [snip]

      I assume that the patch I just snipped is the same as official
      patch 6.2.140 . I tried it with 10.3 and got errors during linking:

      ld: Undefined symbols:
      _init_codecs
      _initerrno
      _initzipimport
      make[1]: *** [Vim] Error 1
      make: *** [myself] Error 2

      Any suggestions are welcome.

      If "-framework Python" works, shouldn't "-framework Tcl" work as
      well?

      --Benji Fisher
    • Bob Ippolito
      ... Yes, also note that tclConfig.sh is at /System/Library/Frameworks/Tcl.framework/tclConfig.sh -- it s highly likely that autoconf wants to find this
      Message 2 of 13 , Oct 29, 2003
      • 0 Attachment
        On Oct 29, 2003, at 2:32 PM, Benji Fisher wrote:

        > On Wed, Oct 29, 2003 at 12:23:02PM +0100, Bram Moolenaar wrote:
        >>
        >> Bob Ippolito wrote:
        >>
        >>> On Oct 28, 2003, at 10:37 PM, Benji Fisher wrote:
        >>>
        >>>> I cannot get vim to compile on OS X.iii with any of perl,
        >>>> python,
        >>>> tcl, nor ruby. There seem to be different reasons each time.
        >>>
        >>> --
        >>>
        >>>> Python: During compilation, I get warnings: "gcc: unrecognized
        >>>> option
        >>>> `-pthread' ." Then, during linking, "ld: can't locate file for:
        >>>> -lpython2.3 ."
        >>>
        >>> <I haven't tried building vim, but> The correct linker flags for
        >>> Python
        >>> on OS X 10.3 are -framework Python
        >>
        >> This argument was already there, but also much more than that. I
        >> removed the "-lpython2.3" part and now I managed to compile Vim with
        >> Python support. Yeah! This is on 10.2. I think it works for Python
        >> 2.3 and later (which is included with 10.3, I installed it myself on
        >> 10.2).
        >>
        >> Now we need to make a configure check for this... The patch below
        >> appears to work.
        >>
        >> The check for adding "-pthread" doesn't work, because configure
        >> expects
        >> the compiler to fail, not that it gives a warning message only. It's
        >> harmless, but I don't like getting a warning message.
        > [snip]
        >
        > I assume that the patch I just snipped is the same as official
        > patch 6.2.140 . I tried it with 10.3 and got errors during linking:
        >
        > ld: Undefined symbols:
        > _init_codecs
        > _initerrno
        > _initzipimport
        > make[1]: *** [Vim] Error 1
        > make: *** [myself] Error 2
        >
        > Any suggestions are welcome.
        >
        > If "-framework Python" works, shouldn't "-framework Tcl" work as
        > well?

        Yes, also note that tclConfig.sh is at
        /System/Library/Frameworks/Tcl.framework/tclConfig.sh -- it's highly
        likely that autoconf wants to find this script.

        -bob
      • Bram Moolenaar
        ... Is this with/without Perl/Python? I don t recognize these items, they are not from Vim. ... Give it a try. The implications of these linker arguments are
        Message 3 of 13 , Oct 29, 2003
        • 0 Attachment
          Benji Fisher wrote:

          > I assume that the patch I just snipped is the same as official
          > patch 6.2.140 . I tried it with 10.3 and got errors during linking:
          >
          > ld: Undefined symbols:
          > _init_codecs
          > _initerrno
          > _initzipimport
          > make[1]: *** [Vim] Error 1
          > make: *** [myself] Error 2
          >
          > Any suggestions are welcome.

          Is this with/without Perl/Python? I don't recognize these items, they
          are not from Vim.

          > If "-framework Python" works, shouldn't "-framework Tcl" work as well?

          and:

          > Yes, also note that tclConfig.sh is at
          > /System/Library/Frameworks/Tcl.framework/tclConfig.sh -- it's highly
          > likely that autoconf wants to find this script.

          Give it a try. The implications of these linker arguments are a mystery
          to me. But if you can figure out which arguments work we can probably
          come up with a configure check to use them.

          In src/auto/configure there is a list of directories that is searched
          for the "tcl.h" include file. You could try adding a directory there
          and see if that works. On 10.2 the file you mention doesn't exist, thus
          this must be a new 10.3 thing.

          You can often tweak the contents of src/auto/config.mk to try out what
          happens. But it's overwritten when configure is run again.

          --
          If "R" is Reverse, how come "D" is FORWARD?

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
        • Bob Ippolito
          ... Those are indeed from Python. Not sure what you re doing, but those symbols are defined in /System/Library/Frameworks/Python.framework/Python -bob
          Message 4 of 13 , Oct 29, 2003
          • 0 Attachment
            On Oct 29, 2003, at 3:36 PM, Bram Moolenaar wrote:

            >
            > Benji Fisher wrote:
            >
            >> I assume that the patch I just snipped is the same as official
            >> patch 6.2.140 . I tried it with 10.3 and got errors during linking:
            >>
            >> ld: Undefined symbols:
            >> _init_codecs
            >> _initerrno
            >> _initzipimport
            >> make[1]: *** [Vim] Error 1
            >> make: *** [myself] Error 2
            >>
            >> Any suggestions are welcome.
            >
            > Is this with/without Perl/Python? I don't recognize these items, they
            > are not from Vim.

            Those are indeed from Python. Not sure what you're doing, but those
            symbols are defined in
            /System/Library/Frameworks/Python.framework/Python

            -bob
          • Bram Moolenaar
            ... That s strange, because I have Python 2.3 on my 10.2 system and I can compile Vim there with Python just fine now. Is there a difference between the
            Message 5 of 13 , Oct 29, 2003
            • 0 Attachment
              Bob Ippolito wrote:

              > On Oct 29, 2003, at 3:36 PM, Bram Moolenaar wrote:
              >
              > > Benji Fisher wrote:
              > >
              > >> I assume that the patch I just snipped is the same as official
              > >> patch 6.2.140 . I tried it with 10.3 and got errors during linking:
              > >>
              > >> ld: Undefined symbols:
              > >> _init_codecs
              > >> _initerrno
              > >> _initzipimport
              > >> make[1]: *** [Vim] Error 1
              > >> make: *** [myself] Error 2
              > >>
              > >> Any suggestions are welcome.
              > >
              > > Is this with/without Perl/Python? I don't recognize these items, they
              > > are not from Vim.
              >
              > Those are indeed from Python. Not sure what you're doing, but those
              > symbols are defined in
              > /System/Library/Frameworks/Python.framework/Python

              That's strange, because I have Python 2.3 on my 10.2 system and I can
              compile Vim there with Python just fine now. Is there a difference
              between the Python 2.3 that's included with 10.3 and the Python that you
              can download and install yourself?

              If nobody can think of a cause I might have to ask a Mac-Python expert...

              --
              Why isn't there mouse-flavored cat food?

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
              \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
              \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
            • Bob Ippolito
              ... Not as far as Vim is concerned.. the only difference to Vim is that the one you install yourself is in /Library/Frameworks and the one that comes with 10.3
              Message 6 of 13 , Oct 29, 2003
              • 0 Attachment
                On Oct 29, 2003, at 4:40 PM, Bram Moolenaar wrote:

                >
                > Bob Ippolito wrote:
                >
                >> On Oct 29, 2003, at 3:36 PM, Bram Moolenaar wrote:
                >>
                >>> Benji Fisher wrote:
                >>>
                >>>> I assume that the patch I just snipped is the same as official
                >>>> patch 6.2.140 . I tried it with 10.3 and got errors during linking:
                >>>>
                >>>> ld: Undefined symbols:
                >>>> _init_codecs
                >>>> _initerrno
                >>>> _initzipimport
                >>>> make[1]: *** [Vim] Error 1
                >>>> make: *** [myself] Error 2
                >>>>
                >>>> Any suggestions are welcome.
                >>>
                >>> Is this with/without Perl/Python? I don't recognize these items,
                >>> they
                >>> are not from Vim.
                >>
                >> Those are indeed from Python. Not sure what you're doing, but those
                >> symbols are defined in
                >> /System/Library/Frameworks/Python.framework/Python
                >
                > That's strange, because I have Python 2.3 on my 10.2 system and I can
                > compile Vim there with Python just fine now. Is there a difference
                > between the Python 2.3 that's included with 10.3 and the Python that
                > you
                > can download and install yourself?

                Not as far as Vim is concerned.. the only difference to Vim is that the
                one you install yourself is in /Library/Frameworks and the one that
                comes with 10.3 is in /System/Library/Frameworks

                > If nobody can think of a cause I might have to ask a Mac-Python
                > expert...

                I'm one of those ;) I'd have to see the linker flags and possibly take
                a look at Vim source to determine a cause. I can't imagine a reason
                why Vim should be referencing those functions -- they're builtin module
                initializers that you don't need to call when you're embedding Python,
                it should take care of that on its own.

                -bob
              • Benji Fisher
                ... Sorry, I should have included a little more of the make output. Here are the last file compiled and the linking step: gcc -c -I. -Iproto -DHAVE_CONFIG_H
                Message 7 of 13 , Oct 29, 2003
                • 0 Attachment
                  On Wed, Oct 29, 2003 at 05:00:40PM -0500, Bob Ippolito wrote:
                  >
                  > On Oct 29, 2003, at 4:40 PM, Bram Moolenaar wrote:
                  >
                  > >>Those are indeed from Python. Not sure what you're doing, but those
                  > >>symbols are defined in
                  > >>/System/Library/Frameworks/Python.framework/Python
                  > >
                  > >That's strange, because I have Python 2.3 on my 10.2 system and I can
                  > >compile Vim there with Python just fine now. Is there a difference
                  > >between the Python 2.3 that's included with 10.3 and the Python that
                  > >you
                  > >can download and install yourself?
                  >
                  > Not as far as Vim is concerned.. the only difference to Vim is that the
                  > one you install yourself is in /Library/Frameworks and the one that
                  > comes with 10.3 is in /System/Library/Frameworks
                  >
                  > >If nobody can think of a cause I might have to ask a Mac-Python
                  > >expert...
                  >
                  > I'm one of those ;) I'd have to see the linker flags and possibly take
                  > a look at Vim source to determine a cause. I can't imagine a reason
                  > why Vim should be referencing those functions -- they're builtin module
                  > initializers that you don't need to call when you're embedding Python,
                  > it should take care of that on its own.

                  Sorry, I should have included a little more of the "make" output.
                  Here are the last file compiled and the linking step:

                  gcc -c -I. -Iproto -DHAVE_CONFIG_H -arch ppc -fno-common
                  -fpascal-strings -Wall
                  -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I. -Iproto
                  -I/Developer/Headers/FlatCarbon -O2 -fno-strength-reduce -Wall
                  -DMACOS_X_UNIX -no-cpp-precomp
                  -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3
                  -pthread version.c -o objects/version.o
                  gcc: unrecognized option `-pthread'
                  gcc -L/usr/local/lib -o Vim objects/buffer.o objects/charset.o
                  objects/diff.o objects/digraph.o objects/edit.o objects/eval.o
                  objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o
                  objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/fold.o
                  objects/getchar.o objects/if_cscope.o objects/if_xcmdsrv.o
                  objects/main.o objects/mark.o objects/memfile.o objects/memline.o
                  objects/menu.o objects/message.o objects/misc1.o objects/misc2.o
                  objects/move.o objects/mbyte.o objects/normal.o objects/ops.o
                  objects/option.o objects/os_unix.o objects/pathdef.o objects/quickfix.o
                  objects/regexp.o objects/screen.o objects/search.o objects/syntax.o
                  objects/tag.o objects/term.o objects/ui.o objects/undo.o
                  objects/window.o objects/gui.o objects/gui_mac.o objects/pty.o
                  objects/if_python.o objects/py_config.o objects/os_macosx.o
                  objects/netbeans.o objects/version.o -framework Carbon -ltermcap
                  -lncurses -liconv -framework Python
                  ld: Undefined symbols:
                  _init_codecs
                  _initerrno
                  _initzipimport
                  make[1]: *** [Vim] Error 1
                  make: *** [myself] Error 2

                  --Benji Fisher
                • Bram Moolenaar
                  ... Well, in that case you can perhaps think of a solution where we can build a binary version of Vim that runs on 10.2 and 10.3 with Python 2.2 and Python
                  Message 8 of 13 , Oct 30, 2003
                  • 0 Attachment
                    Bob Ippolito wrote:

                    > > If nobody can think of a cause I might have to ask a Mac-Python
                    > > expert...
                    >
                    > I'm one of those ;)

                    Well, in that case you can perhaps think of a solution where we can
                    build a binary version of Vim that runs on 10.2 and 10.3 with Python 2.2
                    and Python 2.3? Previously I thought that dynamically loading the
                    library could work, but now this "-framework Python" argument is
                    obscuring what is actually being linked with.

                    The alternative is that we distribute Vim without Python support (that
                    would run on most sytems) and several versions with Python support that
                    run on specific systems. Add to that the optional Perl, Tcl and Ruby
                    interface and we are soon distributing a dozen different Vim versions...

                    --
                    An indication you must be a manager:
                    You feel sorry for Dilbert's boss.

                    /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                    /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                    \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                    \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
                  • Bob Ippolito
                    ... There is no way to compile vim +python on OS X 10.2 (unless the user has installed Python on their own, or you include your own version of Python in the
                    Message 9 of 13 , Oct 30, 2003
                    • 0 Attachment
                      On Oct 30, 2003, at 6:15, Bram Moolenaar wrote:

                      > Bob Ippolito wrote:
                      >
                      >>> If nobody can think of a cause I might have to ask a Mac-Python
                      >>> expert...
                      >>
                      >> I'm one of those ;)
                      >
                      > Well, in that case you can perhaps think of a solution where we can
                      > build a binary version of Vim that runs on 10.2 and 10.3 with Python
                      > 2.2
                      > and Python 2.3? Previously I thought that dynamically loading the
                      > library could work, but now this "-framework Python" argument is
                      > obscuring what is actually being linked with.

                      There is no way to compile vim +python on OS X 10.2 (unless the user
                      has installed Python on their own, or you include your own version of
                      Python in the Vim app bundle). Apple did not provide a dynamic library
                      or framework to link to with their installed with OS X 10.2 version of
                      Python 2.2.

                      It is possible to dynamically load frameworks, it's actually really
                      easy (CFBundle). The "core" of a framework is really just a dylib,
                      which can be loaded on its own if you really wanted to (but don't do
                      that, use CFBundle).

                      > The alternative is that we distribute Vim without Python support (that
                      > would run on most sytems) and several versions with Python support that
                      > run on specific systems. Add to that the optional Perl, Tcl and Ruby
                      > interface and we are soon distributing a dozen different Vim
                      > versions...

                      Not really, why don't you have two.. one for pre-10.3, and one for
                      10.3? In 10.3, you can theoretically compile against Python, Perl, Tcl
                      and (probably, but haven't looked) Ruby.

                      As for the compilation issue that Benji is having, I'm going to have to
                      look at the Vim source, I'll do that tonight. It shouldn't be asking
                      for those symbols. Perhaps the way that Vim initializes an embedded
                      Python is incorrect.

                      -bob
                    • Bram Moolenaar
                      ... The idea is that we compile Vim with Python in such a way that someone that wants Python support can install Python (probably 2.3) and start using it.
                      Message 10 of 13 , Oct 30, 2003
                      • 0 Attachment
                        Bob Ippolito wrote:

                        > >>> If nobody can think of a cause I might have to ask a Mac-Python
                        > >>> expert...
                        > >>
                        > >> I'm one of those ;)
                        > >
                        > > Well, in that case you can perhaps think of a solution where we can
                        > > build a binary version of Vim that runs on 10.2 and 10.3 with Python
                        > > 2.2
                        > > and Python 2.3? Previously I thought that dynamically loading the
                        > > library could work, but now this "-framework Python" argument is
                        > > obscuring what is actually being linked with.
                        >
                        > There is no way to compile vim +python on OS X 10.2 (unless the user
                        > has installed Python on their own, or you include your own version of
                        > Python in the Vim app bundle). Apple did not provide a dynamic library
                        > or framework to link to with their installed with OS X 10.2 version of
                        > Python 2.2.

                        The idea is that we compile Vim with Python in such a way that someone
                        that wants Python support can install Python (probably 2.3) and start
                        using it. Currently someone also has to install a different version of
                        Vim. And that version will crash when you uninstall Python...

                        > It is possible to dynamically load frameworks, it's actually really
                        > easy (CFBundle). The "core" of a framework is really just a dylib,
                        > which can be loaded on its own if you really wanted to (but don't do
                        > that, use CFBundle).

                        That sounds like something useful.

                        > > The alternative is that we distribute Vim without Python support (that
                        > > would run on most sytems) and several versions with Python support that
                        > > run on specific systems. Add to that the optional Perl, Tcl and Ruby
                        > > interface and we are soon distributing a dozen different Vim
                        > > versions...
                        >
                        > Not really, why don't you have two.. one for pre-10.3, and one for
                        > 10.3? In 10.3, you can theoretically compile against Python, Perl, Tcl
                        > and (probably, but haven't looked) Ruby.

                        And next year one for 10.4. Oh, and there are also a few 10.1 users.
                        The point is: we would like to solve the problem, not work around it.
                        That saves us a lot of work in the future and make it simpler for users.

                        > As for the compilation issue that Benji is having, I'm going to have to
                        > look at the Vim source, I'll do that tonight. It shouldn't be asking
                        > for those symbols. Perhaps the way that Vim initializes an embedded
                        > Python is incorrect.

                        It works fine for me, thus it must be something strange. Perhaps a
                        difference between the Python 2.3 distributed from python.org and the
                        version included with 10.3?

                        --
                        Veni, Vidi, VW -- I came, I saw, I drove around in a little car.

                        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                        \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
                      Your message has been successfully submitted and would be delivered to recipients shortly.