One thought on FFI+Linux: in the spirit of "not all .so files are plugins," I've had problems understanding where to place files and how #moduleName interacts with that decision. Two vm hacks have been helpful: (1) when a module fails to load, trace (see below) the full path that the vm chose to use; it can be enlightening (2) if the "#moduleName" (whatever is passed into the vm) starts with / (it is an absolute path), then load from there. It might be that (2) is best handled with symlinks or by copying a newly compiled .so into a path where the vm should be able to find it. I am open to advice. In general, any time the vm alters a file name, port name/number, etc. and then fails to find the altered result, it needs to somehow record what it failed to find. Ideally, that would appear in an exception signaled in the image, but it should at least be available via syslog(), stdout or some other means. The nice thing about syslog() is that the output is viewable after the fact w/o any need to have run the image from a terminal or otherwise captured the output, and the logs are rotated automatically. Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Max Leske [maxleske@gmail.com] Sent: Monday, December 13, 2010 4:44 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Is executing a file platform dependent? Thanks for the answers. That should do. Cheers, Max On 13.12.2010, at 09:54, Stéphane Ducasse wrote:
Guys
we should create a nice documentation for the OSProcess please please spend some time on the collabactive book because we need more documentation.
Stef
On Dec 12, 2010, at 6:34 PM, Schwab,Wilhelm K wrote:
OSProcess, which I am learning to like more as I learn more about it, is not well supported on Windows. Dave recently advised me to use ProcessWrapper on Windows; if he is saying that, then it must be the better path for now.
I have done FFI on both Windows and Linux. I have not (yet anyway) done any one task in a cross-platform way. So far, I have not seen anything horrible that would prevent it. I have zero interest (at least so far) in moving my numerical analysis adventures back toward Windows (they started there and moved to Linux where I am quite happy). I have a .so interface to Acces IO A/D hardware and a DLL interface to Ascension Technology's 3D tracking software. Ultimately, I hope to be able to use both of them on either platform (the software exists on both), but have not yet made the connections.
I transparently use OutputDebugString() on Linux and syslog() on Linux, but that does a test on platform and calls completely different code, so it does not count here.
Sorry I can't be of more help. I urge you to wade into it and ask for help as you get stuck. For creating libraries, you might want to have a look at Code::Blocks; I don't push it very hard, but I have no complaints. The "default" is to install MinGW on Windows (last time I looked at least) and it uses gcc on Linux.
Bill
________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Lukas Renggli [renggli@gmail.com] Sent: Sunday, December 12, 2010 11:43 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Is executing a file platform dependent?
With OS Process you can run scripts. That should work identical on Mac and Unix systems; probably also Windows, but I haven't tried.
With FFI and Alien you can call C libraries. I have not much experience with those, but normally it should be possible to use them on all platforms.
Lukas
On 12 December 2010 17:31, Max Leske <maxleske@gmail.com> wrote:
Hi guys
I was wondering if it is true that executing a file from within Pharo is platform dependent. I don't actually need to execute a file; it's more a theoretical question and I have no idea what the mechanisms are that would be used. To give you a clearer picture: Imagine you have C, sh, and perl files. What I'm thinking about is that I would have some data in the image that I would want to process with the code in one of those files. I would then wait for the result and process the result in the image.
So my questions are: is there a platform independent way to execute C, sh or perl files from Pharo? Does the VM handle the platform dependencies? Are there any other issues with the idea I described?
Don't go out of your way to find answers, please. But I'd be happy to hear your thoughts.
Cheers, Max
-- Lukas Renggli www.lukas-renggli.ch