From kalyanov.dmitry at gmail.com Sat Jul 4 14:15:28 2009 From: kalyanov.dmitry at gmail.com (Kalyanov Dmitry) Date: Sat, 4 Jul 2009 18:15:28 +0400 Subject: [cl-gtk2-devel] Build problems In-Reply-To: <95f1acd0906231021x5fd87bb5h328f000c1649158e@mail.gmail.com> References: <95f1acd0906231021x5fd87bb5h328f000c1649158e@mail.gmail.com> Message-ID: <200907041815.28327.Kalyanov.Dmitry@gmail.com> I made some fixes that should improve the situation. Could you please try running cl-gtk2 again (using the latest version in git)? Notably: 1) the "Unhandled memory fault at #x0." error should be gone 2) SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERRORs should also be gone From elzacho at gmail.com Sat Jul 4 18:22:17 2009 From: elzacho at gmail.com (Zach) Date: Sat, 4 Jul 2009 12:22:17 -0600 Subject: [cl-gtk2-devel] Build problems In-Reply-To: <200907041815.28327.Kalyanov.Dmitry@gmail.com> References: <95f1acd0906231021x5fd87bb5h328f000c1649158e@mail.gmail.com> <200907041815.28327.Kalyanov.Dmitry@gmail.com> Message-ID: <95f1acd0907041122p5defb0b6me8b4d227a34adff9@mail.gmail.com> Thank you for informing me of these new developments. I am happy to report that CL-GTK2 builds just fine on my Ubuntu 8.10 box. In addition, the examples seem to work as well. I think I will enjoy playing with this library (and making some GUI applications that don't rely on Tk). I was surprised to see that the examples spawn a new thread, any reason for that? Also, I will give a stab at getting this to build against the OS X GTK framework I recently installed. Perhaps I can increase the number of platforms this works on. Zach On Sat, Jul 4, 2009 at 8:15 AM, Kalyanov Dmitry wrote: > I made some fixes that should improve the situation. > Could you please try running cl-gtk2 again (using the latest version in > git)? > Notably: > 1) the "Unhandled memory fault at #x0." error should be gone > 2) SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERRORs should also be gone > > > _______________________________________________ > cl-gtk2-devel mailing list > cl-gtk2-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cl-gtk2-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalyanov.dmitry at gmail.com Sat Jul 4 18:53:18 2009 From: kalyanov.dmitry at gmail.com (Kalyanov Dmitry) Date: Sat, 4 Jul 2009 22:53:18 +0400 Subject: [cl-gtk2-devel] Build problems In-Reply-To: <95f1acd0907041122p5defb0b6me8b4d227a34adff9@mail.gmail.com> References: <95f1acd0906231021x5fd87bb5h328f000c1649158e@mail.gmail.com> <200907041815.28327.Kalyanov.Dmitry@gmail.com> <95f1acd0907041122p5defb0b6me8b4d227a34adff9@mail.gmail.com> Message-ID: <200907042253.19512.Kalyanov.Dmitry@gmail.com> On ??????? 04 ???? 2009 22:22:17 you wrote: > Thank you for informing me of these new developments. > > I am happy to report that CL-GTK2 builds just fine on my Ubuntu 8.10 box. > In addition, the examples seem to work as well. > That's great news! > I think I will enjoy playing with this library (and making some GUI > applications that don't rely on Tk). I was surprised to see that the > examples spawn a new thread, any reason for that? The primary reason is because of the desire to have the REPL: if GUI is on another thread, then REPL is "alive" whlie the GUI is running, you can manipulate objects, redefine functions, etc. and have the GUI respond to changes (not to all kinds of changes, of course, but e.g. you can redefine the function that is called by GUI without having to close windows and restart application). This is somewhat explained in recently updated version of tutorial at http://common-lisp.net/project/cl-gtk2/tutorial.html (in the "Main loop" section). As far as I know, the only problem this creates is the requirement that the lisp must be multi-threaded. As for SBCL and Clozure CL on Linux, CCL on Mac, Allegro it should work fine (don't know about clisp) > > Also, I will give a stab at getting this to build against the OS X GTK > framework I recently installed. Perhaps I can increase the number of > platforms this works on. I guess that on OS X it should work. I am not so sure about Windows, however; it will require some work. From elzacho at gmail.com Sun Jul 5 22:38:47 2009 From: elzacho at gmail.com (Zach) Date: Sun, 5 Jul 2009 16:38:47 -0600 Subject: [cl-gtk2-devel] Build problems In-Reply-To: <95f1acd0907041457k10088370t6766387f8920c6dd@mail.gmail.com> References: <95f1acd0906231021x5fd87bb5h328f000c1649158e@mail.gmail.com> <200907041815.28327.Kalyanov.Dmitry@gmail.com> <95f1acd0907041122p5defb0b6me8b4d227a34adff9@mail.gmail.com> <200907042253.19512.Kalyanov.Dmitry@gmail.com> <95f1acd0907041457k10088370t6766387f8920c6dd@mail.gmail.com> Message-ID: <95f1acd0907051538r33f95fc3n818521a76f56c87b@mail.gmail.com> So, I have been looking at building CL-GTK2 on OS X and realized that I know nothing about this stuff. I will just provide a dump of my understanding of things. All of this is using a pull from the repo on July 5th, 2009 that I am building on SBCL 1.0.25 on OS X 10.4. I am in no way a Mac expert (or fan...), so this should all be taken with a grain of salt. It's not all bad news, see the end. I installed a GTK framework. In OS X a framework is basically a bundle of libraries and header files (and a few other odds and ends. The framework has the following libraries in it: $ ls /Library/Frameworks/Gtk.framework/Libraries/ libatk-1.0.0.dylib* libjpeg.62.dylib* libcairo.2.dylib* libpango-1.0.0.dylib* libgdk-pixbuf-2.0.0.dylib* libpangocairo-1.0.0.dylib* libgdk-quartz-2.0.0.dylib* libpixman-1.0.dylib* libgtk-quartz-2.0.0.dylib* libpng12.0.dylib* libigemacintegration.0.dylib* libtiff.3.dylib* libintl.8.dylib So it looks like it contains libgtk and libgdk. There is also a glib framework (not sure if this was installed with the OS or what) which contains libraries: $ ls /Library/Frameworks/GLib.framework/Libraries/ libgio-2.0.0.dylib* libgmodule-2.0.0.dylib* libgthread-2.0.0.dylib* libglib-2.0.0.dylib* libgobject-2.0.0.dylib* libintl.8.dylib So that looks like everything we need, and they are all native libraries. If I add the proper lines (:darwin (:framework "GTK")) and (:darwin (:framework "Glib")) everything builds without warning. Some examples seem to do nothing while some appear to perhaps almost work. The CPU usage usually jumps up around to 150% (on my dual core). If I try the "Hello, World" example from the tutorial: (gtk:within-main-loop (let ((window (make-instance 'gtk:gtk-window :title "Hello, world!" ))) (gtk:widget-show window) )) A window does appear, but it has no title or buttons for maximizining/minimizing/closing, so that is weird. I don't know how to debug something running in a different thread (the stuff I read on line regarding SLIME and attaching threads didn't seem to work), so I don't know what it was doing at 150% CPU load. Does anyone have any experience with this? The fact that it builds and a window actually appears makes me think this could be fixed with a little work (on my part, maybe). It would remove a lot of the dependencies to getting CL application with a GUI running on OS X, and it will satisfy all the whiny Mac users that don't like windows that look different than the current Apple UI. It absolutely works to link these against Fink or MacPorts libraries (or ones you built from source, if so skilled). These will have to run underneath the X11 server (that you run on top of the OS X gui). This is less than ideal as it is not as "integrated" with the OS X environment (e.g. the menu bar is not at the top of the screen and X11 has to be running to run your program), but it is great that it works. To do this all we need to do is add a (:darwin (:or "libxxx.dylib")) to the library definitions. Of course it would be up to the user to install these libraries and add the Fink/MacPorts paths to CFFI:*FOREIGN-LIBRARY-DIRECTORIES*. I could give you a (very simple) patch, but I really don't know how... any tips? Anyway, thanks for putting together this binding, Zach 2009/7/4 Zach > I run threaded SBCL on OS X and have had no problems (however, the SBCL > developers do list it as experimental). So, maybe this will still work on > SBCL under OS X. CMUCL has non-native threads, so I guess that this should > work there too. Of course CLISP doesn't have threads... and from what I > hear ACL has a working GTK interface. > > One thought, it seems like even if CL-GTK2 didn't spawn a new thread then > you could get the same effect by invoking your function via (make-thread > #'demo-class-browser). > > Zach > > > 2009/7/4 Kalyanov Dmitry > > On ??????? 04 ???? 2009 22:22:17 you wrote: >> > Thank you for informing me of these new developments. >> > >> > I am happy to report that CL-GTK2 builds just fine on my Ubuntu 8.10 >> box. >> > In addition, the examples seem to work as well. >> > >> That's great news! >> >> > I think I will enjoy playing with this library (and making some GUI >> > applications that don't rely on Tk). I was surprised to see that the >> > examples spawn a new thread, any reason for that? >> >> The primary reason is because of the desire to have the REPL: if GUI is on >> another thread, then REPL is "alive" whlie the GUI is running, you can >> manipulate objects, redefine functions, etc. and have the GUI respond to >> changes (not to all kinds of changes, of course, but e.g. you can redefine >> the >> function that is called by GUI without having to close windows and restart >> application). >> >> This is somewhat explained in recently updated version of tutorial at >> http://common-lisp.net/project/cl-gtk2/tutorial.html (in the "Main loop" >> section). >> >> As far as I know, the only problem this creates is the requirement that >> the >> lisp must be multi-threaded. As for SBCL and Clozure CL on Linux, CCL on >> Mac, >> Allegro it should work fine (don't know about clisp) >> >> > >> > Also, I will give a stab at getting this to build against the OS X GTK >> > framework I recently installed. Perhaps I can increase the number of >> > platforms this works on. >> >> I guess that on OS X it should work. I am not so sure about Windows, >> however; >> it will require some work. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: