Anaconda3 Install on Big Sur

I am trying to install the Anaconda3 enviroment based package on Big Sur. I am using Python 3.8.10 on Big Sur 11.4

I have made the symbolic link etc as described in the package: LW-klayout-0.27.2-macOS-BigSur-1-qt5Ana3-Rana3Pana3.dmg

Everytime I try to run KLayout it does not open and crashes mostly I believe because of a path issue

"Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
dyld: Using shared cache: 4A889CE9-8D7E-304E-A5F7-84D819B0BF9C
Library not loaded: @rpath/libpython3.8.dylib
Referenced from: /Applications/klayout.app/Contents/MacOS/klayout
Reason: image not found"

Obviously I'm missing something but cannot make it work. Can you help please

Thanks

Mike

Comments

  • Hi Mike,

    Thank you for posting this issue.
    It might be an issue with Python version compatibility.
    I expect that your Python 3.8.10 can work with the published KLayout binary.
    But it does not work actually; weird :s

    [1] My "anaconda3" environment in which I built the LW*dmg is a bit old, as shown below.

        (base) BigSur2{kazzz-s} ~ (1)% which python
        /Users/kazzz-s/opt/anaconda3/bin/python
    
        (base) BigSur2{kazzz-s} ~ (2)% python --version
        Python 3.8.2
    
        (base) BigSur2{kazzz-s} ~ (3)% conda list | grep python
        ipython                   7.22.0           py38h01d92e1_0
        ipython_genutils          0.2.0              pyhd3eb1b0_1
        msgpack-python            1.0.2            py38hf7b0b51_1
        python                    3.8.2                hc70fcce_0
        python-dateutil           2.8.1              pyhd3eb1b0_0
        python-jsonrpc-server     0.4.0                      py_0
        python-language-server    0.36.2             pyhd3eb1b0_0
        python-libarchive-c       2.9                pyhd3eb1b0_1
        python.app                3                py38h9ed2024_0
    
        (base) BigSur2{kazzz-s} lib (4)% pwd
        /Applications/anaconda3/lib
    
        (base) BigSur2{kazzz-s} lib (5)% ll | grep python
        -rwxrwxr-x   2 kazzz-s staff 18102552 Mar 27  2020 libpython3.8.a
        -rwxrwxr-x   1 kazzz-s staff  3626608 Jan  9  2021 libpython3.8.dylib
        -rw-rw-r--   2 kazzz-s staff  5531512 Mar 27  2020 libpython3.8.nolto.a
        drwxr-xr-x 214 kazzz-s staff     6848 Jan  9  2021 python3.8
    
        (base) BigSur2{kazzz-s} lib (6)% otool -L ./libpython3.8.dylib
        ./libpython3.8.dylib:
            @rpath/libpython3.8.dylib (compatibility version 3.8.0, current version 3.8.0)
            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    

    [2] KLayout uses dynamic-link libraries:

    (base) BigSur2{kazzz-s} MacOS (7)% pwd
    /Applications/klayout-ana32.app/Contents/MacOS  <== I've renamed the application bundle.
    
    (base) BigSur2{kazzz-s} MacOS (8)% otool -L ./klayout | grep python
        @rpath/libpython3.8.dylib (compatibility version 3.8.0, current version 3.8.0)
    
    (base) BigSur2{kazzz-s} MacOS (9)% ./klayout   ===> KLayout can start normally.
    

    My suggestions:

    1. Test the KLayoutAna3.app script bundle, which is included in the DMG.
      Please read section [2] through [4] of the "Anaconda3User-ReadMeFirst.txt" file.

    2. Install anaconda3's python 3.8.2 if acceptable.

    3. Build KLayout from the source code. It's easy but takes time.

         $ ./build4mac -q qt5ana3  -r ana3  -p ana3
         $ ./build4mac -q qt5ana3  -r ana3  -p ana3  -Y
             Please refer to section 6E. of the "macbuild/ReadMe.md" file for more details.
    

    Regards,
    Kazzz-S

  • Kazzz-S
    Thanks for the quick response. Might take me a couple of days to get around to further investigation but I'll keep you posted
    Mike

  • I'm not sure I can follow. But maybe "@rpath/..." is not pointing the to right place?

    Another thing I see on other OS: if the message is "shared object not found" this may also mean that this shared object is found, but it depends on other shared objects which are not found. On Linux "LD_DEBUG" is your friend in this case. I think that "DYLD_DEBUG" exists on MacOS. You can set this environment variable to print details about the shared object loading sequence.

    Matthias

  • edited July 14

    Hi Matthias,

    Thank you for your suggestions. :)
    When KLayout normally starts...

    (base) BigSur2{kazzz-s} MacOS (1)% pwd
    /Applications/klayout-ana32.app/Contents/MacOS
    
    (base) BigSur2{kazzz-s} MacOS (2)% ll
    total 88
    
    drwxr-xr-x 11 kazzz-s admin   352 Jun 23 06:42 .
    drwxr-xr-x  8 kazzz-s admin   256 Jun 23 04:29 ..
    drwxr-xr-x 10 kazzz-s admin   320 Jun 23 04:29 db_plugins
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 drc
    -rwxr-xr-x  1 kazzz-s admin 89600 Jun 23 04:29 klayout
    drwxr-xr-x 16 kazzz-s admin   512 Jun 23 04:29 lay_plugins
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 lvs
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 macros
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 pymacros
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 python
    drwxr-xr-x  2 kazzz-s admin    64 Jun 23 06:42 ruby
    
    (base) BigSur2{kazzz-s} MacOS (3)% export DYLD_PRINT_LIBRARIES=1
    
    (base) BigSur2{kazzz-s} MacOS (4)% ./klayout 2>&1 | tee ~/temp/aaa.txt
    
    (base) BigSur2{kazzz-s} temp (5)% grep python ~/temp/aaa.txt
    dyld: loaded: <6D96AA6D-3E06-3556-819F-60DF875F35BD> /Users/kazzz-s/opt/anaconda3/lib/libpython3.8.dylib
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                         != /Applications/anaconda3
    :
    :
    117 lines follow
    

    Kazzz-S

  • edited July 14

    I got the reason. A bit embarrassing. :(

    (base) BigSur2{kazzz-s} MacOS (1)% otool -l klayout
    :
    :
    Load command 64
              cmd LC_RPATH
          cmdsize 48
             path /Users/kazzz-s/opt/anaconda3/lib (offset 12)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  |
                  | This should have been...
                  V
             path /Applications/anaconda3/lib (offset 12)
    

    The Catalina version is OK.

    I'll rebuild the DMG for Big Sur with Aanaconda3.
    Would you please give me some time?

    You can try the Catalina version on Big Sure for the time being if you like.

    Kazzz-S

  • The DMGs (for Catalina and Big Sur) with Anaconda3 bind both Python 3.8.x and Ruby 2.5.x.
    So you need to install Ruby by:
    $ conda install ruby
    When installing the Ruby package, Python is downgraded from 3.8.10 to 3.8.2.

    Kazzz-S

  • edited July 14

    I have rebuilt the second DMG for Big Sur + Anaconda3 (LW-klayout-0.27.2-macOS-BigSur-2-qt5Ana3-Rana3Pana3.dmg), which will be published soon.

    Kazzz-S

  • edited July 19

    @kazzz Thanks for taking care of this! :)

    Let me know when the new version is ready so I can put it on the server.

    BTW: I'll publish 0.27.3 soon.

    Matthias

  • Hi Matthias,

    It's ready. I have added a comment to the closed ticket: https://github.com/KLayout/klayout/issues/844#issuecomment-879853650 , and sent you a separate mail.

    It is in https://www.dropbox.com/sh/l6jin4ggqsm4am1/AAD5kLFVG0QhQVTG6GT2MWtwa?dl=0
    Please find

    • LW-klayout-0.27.2-macOS-BigSur-2-qt5Ana3-Rana3Pana3.dmg
    • LW-klayout-0.27.2-macOS-BigSur-2-qt5Ana3-Rana3Pana3.dmg.md5

    Thank you for your effort in making the next release 0.27.3; I'll do as usual :)

    Kazzz-S

Sign In or Register to comment.