#196 fix absolute path support for [declare] and #X declare

open
puredata (375)
7
2010-09-02
2008-03-18
marius schebella
No

I am not sure if declare is working the way it is supposed to on OSX
the object I am trying to create is [OSCroute].
I can create [oscx/OSCroute], but what I want to accomplish is to avoid the oscx prefix, so I tried
[declare -stdpath extra/oscx]
[declare -stdpath oscx]
[declare -path extra/oscx]
[declare -path oscx]
[declare -stdlib extra/oscx]
[declare -stdlib oscx]
[declare -lib extra/oscx]
[declare -lib oscx]
I even tried [declare -stdpath extra/oscx] in combination with import oscx. and I get a console printout saying [import] loaded library: oscx,
but OSCroute
... couldn't create
don't know how to track down the error, or if I am maybe doing something wrong.
pd-extended-0.40.3-20080222.

Discussion

1 2 > >> (Page 1 of 2)
  • Roman Haefeli
    Roman Haefeli
    2008-03-20

    Logged In: YES
    user_id=1895440
    Originator: NO

    while [declare -stdlib] seems to work, [declare -stdpath] doesn't work on windows as well. i created a folder 'foo' into the extra directory and put a file 'bar.pd' in there.

    my test setup:
    --------------

    pd installation path:
    D:\programme\pd-0.41\

    pd executable:
    D:\programme\pd-0.41\bin\pd.exe

    test-abstraction:
    D:\programme\pd-0.41\extra\foo\bar.pd

    test-patch:
    D:\home\declare_test.pd

    test-patch contains:

    [declare -stdpath extra/foo]

    [bar]

    pd start command:
    D:\programme\pd-0.41\bin\pd.exe -verbose -open D:\home\declare_test.pd

    output from pd-window:
    ----------------------

    tried D:\\home\\declare_test.pd and succeeded
    tried D:\\home\\..\\extra\\foo\\bar.m_i386 and failed
    tried D:\\home\\bar.m_i386 and failed
    tried D:\\programme\\pd-0.41\\extra\\bar.m_i386 and failed
    tried D:\\home\\..\\extra\\foo\\bar.dll and failed
    tried D:\\home\\bar.dll and failed
    tried D:\\programme\\pd-0.41\\extra\\bar.dll and failed
    tried D:\\home\\..\\extra\\foo\\bar\\bar.m_i386 and failed
    tried D:\\home\\bar\\bar.m_i386 and failed
    tried D:\\programme\\pd-0.41\\extra\\bar\\bar.m_i386 and failed
    tried D:\\home\\..\\extra\\foo\\bar\\bar.dll and failed
    tried D:\\home\\bar\\bar.dll and failed
    tried D:\\programme\\pd-0.41\\extra\\bar\\bar.dll and failed
    tried D:\\home\\..\\extra\\foo\\bar.pd and failed
    tried D:\\home\\bar.pd and failed
    tried D:\\programme\\pd-0.41\\extra\\bar.pd and failed
    tried D:\\home\\..\\extra\\foo\\bar.pat and failed
    tried D:\\home\\bar.pat and failed
    tried D:\\programme\\pd-0.41\\extra\\bar.pat and failed
    bar
    ... couldn't create

    it looks like [declare -stdpath] is adding the search path relative to the patch instead of relative to pd.

     
  • Roman Haefeli
    Roman Haefeli
    2008-03-20

    Logged In: YES
    user_id=1895440
    Originator: NO

    the same test on a ubuntu ppc machine with pd 0.41-4 compiled from source and installed to the default location gave similar results:

    output from pd-window:
    ----------------------

    tried /home/olivia/declare_test.pd and succeeded
    tried /home/olivia/extra/foo/bar.l_i386 and failed
    tried /home/olivia/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar.l_i386 and failed
    tried /home/olivia/extra/foo/bar.pd_linux and failed
    tried /home/olivia/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar.pd_linux and failed
    tried /home/olivia/extra/foo/bar/bar.l_i386 and failed
    tried /home/olivia/bar/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
    tried /home/olivia/extra/foo/bar/bar.pd_linux and failed
    tried /home/olivia/bar/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
    tried /home/olivia/extra/foo/bar.pd and failed
    tried /home/olivia/bar.pd and failed
    tried /usr/local/lib/pd/extra/bar.pd and failed
    tried /home/olivia/extra/foo/bar.pat and failed
    tried /home/olivia/bar.pat and failed
    tried /usr/local/lib/pd/extra/bar.pat and failed
    bar
    ... couldn't create

    instantiating [foo/bar] works fine, which means, that installation of [bar] is correct and pd finds it in extra/foo.

     
  • Roman Haefeli
    Roman Haefeli
    2008-03-20

    Logged In: YES
    user_id=1895440
    Originator: NO

    could we give this issue a higher priority? the longer [declare] is not working correctly, the more confusion it will cause. also it currently cannot be used to create portable patches, that work on every platform with every pd-distro, which i find would be the strong point in using [declare].

     
  • Roman Haefeli
    Roman Haefeli
    2008-03-20

    Logged In: YES
    user_id=1895440
    Originator: NO

    i just did the same test again on my box, ubuntu dapper i686:

    tried /home/roman/declare_test.pd and succeeded
    tried /home/roman/extra/foo/bar.l_i386 and failed
    tried /home/roman/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar.l_i386 and failed
    tried /home/roman/extra/foo/bar.pd_linux and failed
    tried /home/roman/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar.pd_linux and failed
    tried /home/roman/extra/foo/bar/bar.l_i386 and failed
    tried /home/roman/bar/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
    tried /home/roman/extra/foo/bar/bar.pd_linux and failed
    tried /home/roman/bar/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
    tried /home/roman/extra/foo/bar.pd and succeeded

    which means:
    - there is a difference between linux ppc and linux intel
    - currently linux intel is the _only_ platform where [declare] works as documented.

     
  • Roman Haefeli
    Roman Haefeli
    2008-03-20

    Logged In: YES
    user_id=1895440
    Originator: NO

    oops...

    from some quick fix from before i accidently still had a symbolic link from /home/roman/extra pointing to /usr/local/lib/pd/extra/, that is why it found [bar] in that funny place:

    /home/roman/extra/foo/bar.pd

    tried again without the symlink:
    --------------------------------

    tried /home/roman/declare_test.pd and succeeded
    tried /home/roman/../extra/foo/bar.l_i386 and failed
    tried /home/roman/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar.l_i386 and failed
    tried /home/roman/../extra/foo/bar.pd_linux and failed
    tried /home/roman/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar.pd_linux and failed
    tried /home/roman/../extra/foo/bar/bar.l_i386 and failed
    tried /home/roman/bar/bar.l_i386 and failed
    tried /usr/local/lib/pd/extra/bar/bar.l_i386 and failed
    tried /home/roman/../extra/foo/bar/bar.pd_linux and failed
    tried /home/roman/bar/bar.pd_linux and failed
    tried /usr/local/lib/pd/extra/bar/bar.pd_linux and failed
    tried /home/roman/../extra/foo/bar.pd and failed
    tried /home/roman/bar.pd and failed
    tried /usr/local/lib/pd/extra/bar.pd and failed
    tried /home/roman/../extra/foo/bar.pat and failed
    tried /home/roman/bar.pat and failed
    tried /usr/local/lib/pd/extra/bar.pat and failed

     
  • Logged In: YES
    user_id=1856112
    Originator: YES

    I just realized that I made some mistakes in the past and that declare actually is working better than I thought. here is what I forgot:
    1) declare only takes effect when you open the patch. stupid, I think I read it, but... Some alleged "bugs" were caused by the assumption that it is enough to create a declare object and paths will be set...
    2) no absolute paths! absolute paths work for -lib, but not for -path/-stdpath. at least on OS X it is not possible to set absolute paths (or at least I don't know how), all paths have to be relative to Pd (-stdpath) or to the patch (-path).

     
  • Logged In: YES
    user_id=1856112
    Originator: YES

    that's how -stdpath works on os x. it does not work for absolute paths, and seems to be relative to some directory outside of /Applications. I tried all relations with less ../ and from inside /Applications.
    declare -stdpath ../../../../../../../../Applications/Pd-0.40.3-extended-20080428.app/Contents/Resources/extra/boids
    maybe this helps.
    m.

     
    • labels: --> puredata
    • assigned_to: nobody --> millerpuckette
    • summary: declare not working on osx --> fix absolute path support for [declare] and #X declare
     
  • Logged In: YES
    user_id=313747
    Originator: NO

    I patched 0.42 with th epart of it that dealt with declare... there's
    something else in the patch that invokes a "realpath" function I don't
    know about (and I assume won't compile as is) so I ignored that bit.

    I think I should also update 0.41 since this is a fairly important bug fix and also a safe-looking one.

     
1 2 > >> (Page 1 of 2)


Anonymous


Cancel   Add attachments