digego / extempore

A cyber-physical programming environment
1.4k stars 127 forks source link

git make aot_extended fails to find nanovg #221

Closed neilt closed 8 years ago

neilt commented 8 years ago

git pull on extempore with complete cmake make rebuild from scratch. OS X El Capitan.

Starting primary process
Trying to connect to 'localhost' on port 17069
New Client Connection 
Successfully connected to remote process

Evaluating expression: (impc:aot:compile-xtm-file "libs/external/nanovg.xtm" #t #t)

Loading xtmbase library... done in 0.000000 seconds
sys:load notification base already loaded 
Loading xtmglcore-directbind library... done in 0.000000 seconds
sys:load notification gl already loaded 
Error: could not find libnanovg dynamic library

^C
Received interrupt signal (SIGINT), exiting Extempore...
make[2]: *** [CMakeFiles/aot_nanovg.dir/all] Interrupt: 2
make[1]: *** [CMakeFiles/aot_extended.dir/rule] Interrupt: 2
make: *** [aot_extended] Interrupt: 2

Made sure the git pull, make clean, make install for nanovg and sure enough nanovg is present.

MBP:cmake-build nt$ ls -lah /usr/local/lib/libna*
-rwxr-xr-x  1 nt          admin   381K May 17  2014 /usr/local/lib/libnanomsg.0.dylib
-rw-r--r--  1 nt          admin   1.0M May 17  2014 /usr/local/lib/libnanomsg.a
-rwxr-xr-x  1 nt          admin   937B May 17  2014 /usr/local/lib/libnanomsg.la
-rwxr-xr-x  1 root        admin   219K Dec 28 08:42 /usr/local/lib/libnanovg.dylib
benswift commented 8 years ago

Hi Neil

Is there any reason that there's no "." in the output of your ls command, i.e. why it's libnanovgdylib rather than libnanovg.dylib ?

neilt notifications@github.com writes:

Starting primary process
Trying to connect to 'localhost' on port 17069
New Client Connection 
Successfully connected to remote process

Evaluating expression: (impc:aot:compile-xtm-file "libs/external/nanovgxtm" #t #t)

Loading xtmbase library done in 0000000 seconds
sys:load notification base already loaded 
Loading xtmglcore-directbind library done in 0000000 seconds
sys:load notification gl already loaded 
Error: could not find libnanovg dynamic library

^C
Received interrupt signal (SIGINT), exiting Extempore
make[2]: *** [CMakeFiles/aot_nanovgdir/all] Interrupt: 2
make[1]: *** [CMakeFiles/aot_extendeddir/rule] Interrupt: 2
make: *** [aot_extended] Interrupt: 2

Made sure the git pull, make clean, make install for nanovg and sure enough nanovg is present

MBP:cmake-build nt$ ls -lah /usr/local/lib/libna*
-rwxr-xr-x  1 neiltiffin  admin   381K May 17  2014 /usr/local/lib/libnanomsg0dylib
-rw-r--r--  1 neiltiffin  admin   10M May 17  2014 /usr/local/lib/libnanomsga
-rwxr-xr-x  1 neiltiffin  admin   937B May 17  2014 /usr/local/lib/libnanomsgla
-rwxr-xr-x  1 root        admin   219K Dec 28 08:42 /usr/local/lib/libnanovgdylib

Reply to this email directly or view it on GitHub: https://github.com/digego/extempore/issues/221

neilt commented 8 years ago

Nope it is present. For some reason the email removed it. If you look on the web version of github issues it is present. And I just checked again on my system and it is present.

MBP:cmake-build nt$  ls -lah /usr/local/lib/libna*
-rwxr-xr-x  1 nt          admin   381K May 17  2014 /usr/local/lib/libnanomsg.0.dylib
-rw-r--r--  1 nt          admin   1.0M May 17  2014 /usr/local/lib/libnanomsg.a
-rwxr-xr-x  1 nt          admin   937B May 17  2014 /usr/local/lib/libnanomsg.la
-rwxr-xr-x  1 root        admin   219K Dec 28 08:42 /usr/local/lib/libnanovg.dylib
benswift commented 8 years ago

Ok, sorry about that - I only looked in my email client, not on GH.

A few questions:

Are you working from HEAD, or 0.6.0?

Which version of OSX are you on?

Does the nanovg library load up ok if you're not aot-compiling?

Cheers, Ben

neilt notifications@github.com writes:

Nope it is present. For some reason the email removed it. It you look on the web version of github issues it is present. And I just checked again on my system and it is present.

MBP:cmake-build nt$  ls -lah /usr/local/lib/libna*
-rwxr-xr-x  1 nt  admin   381K May 17  2014 /usr/local/lib/libnanomsg.0.dylib
-rw-r--r--  1 nt  admin   1.0M May 17  2014 /usr/local/lib/libnanomsg.a
-rwxr-xr-x  1 nt  admin   937B May 17  2014 /usr/local/lib/libnanomsg.la
-rwxr-xr-x  1 root        admin   219K Dec 28 08:42 /usr/local/lib/libnanovg.dylib

Reply to this email directly or view it on GitHub: https://github.com/digego/extempore/issues/221#issuecomment-167914230

neilt commented 8 years ago

OS X, El Capitan 10.11.2

MBP:myPolitics nt$ uname -a
Darwin MBP.localdomain 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64

git HEAD

MBP:cmake-build nt$ git log -n 1
commit 5d922722d1cec90ec9ae6bb87af31552aef912d1
Author: Andrew Sorensen <andrew@moso.com.au>
Date:   Wed Dec 30 16:15:41 2015 +1000

    new adsr_c + change sig of square and tri

It will not load when not aot-compiliing.

Error: could not find xtmnanovg dynamic library
benswift commented 8 years ago

Sorry about the delay, I've been on holidays.

I've just tried it on my machine (same OS, similar box) and it worked.

The line

Error: could not find xtmnanovg dynamic library

indicates that it's the aot-compiled dylib (i.e. xtmnanovg rather than libnanovg) that's the problem. There are a few potential causes:

To diagnose further, you can use an optional second argument to sys:open-dylib, which (if truthy) will print the error messages from dlopen if it fails.

So, what is the output from

(sys:open-dylib "libnanovg.dylib" #t)

neilt notifications@github.com writes:

OS X, El Capitan 10.11.2

MBP:myPolitics nt$ uname -a
Darwin MBP.localdomain 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64

git HEAD

MBP:cmake-build nt$ git log -n 1
commit 5d922722d1cec90ec9ae6bb87af31552aef912d1
Author: Andrew Sorensen <andrew@moso.com.au>
Date:   Wed Dec 30 16:15:41 2015 +1000

    new adsr_c + change sig of square and tri

It will not load when not not-compiliing.

Error: could not find xtmnanovg dynamic library

Reply to this email directly or view it on GitHub: https://github.com/digego/extempore/issues/221#issuecomment-167985503

neilt commented 8 years ago

There is no error, (sys:open-dylib "libnanovg.dylib" #t) loads fine. Please ignore the previous version of this message I misspelled the lib name.

(sys:load "libs/external/nanovg.xtm") fails with

Error: could not find libnanovg dynamic library

I'm not using homebrew. nanovg is installed using a git pull from https://github.com/extemporelang/nanovg.git then make then make install.

benswift commented 8 years ago

I think at this point the best thing to try the aot-compiled "header" file for nanovg, which will be in libs/aot-cache/nanovg.xtm. If you go through it line-by-line (maybe skip/comment out the (set! *impc:compiler:message:level* 'low) line so you can see all the compiler output) you should be able to see exactly what's going wrong.

neilt commented 8 years ago

It appears that commit 4354cf0e5cb842be6006e05546223c8c0a1a5292 fixed the issue for nanovg. Thank you.

However a new issue arose with libassimp not being found from MacPorts. MacPorts stuff is in /opt/local/lib/. The following diff is verified to fix the problem of locating libs installed from the MacPorts default location.

diff --git a/runtime/llvmti.xtm b/runtime/llvmti.xtm
index 243e53b..ad22d35 100644
--- a/runtime/llvmti.xtm
+++ b/runtime/llvmti.xtm
@@ -9570,7 +9570,7 @@ xtlang's `let' syntax is the same as Scheme"
                                             (sys:command-output
                                              "echo $LD_LIBRARY_PATH")
                                             ":")
-                                           '("/usr/local/lib/" "/usr/lib/")))
+                                           '("/usr/local/lib/" "/usr/lib/" "/opt/local/lib/")))
                                   '()))))
       (if (null? rel-paths)
           #f
benswift commented 8 years ago

seems like this is fixed