Re: pil21 on Mac, some errors

2020-11-09 Thread Jon Kleiser
Hi Alex,

Yes, but after the Ctrl-D I have to click in the cube window to make it go 
away. OK as long as one knows this.

The pil21 now seems to be usable on macOS, however, the "(cd src; make)” did 
not work for me; I got some errors. I used the instructions at 
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 
 instead.

/Jon

> On 9 Nov 2020, at 09:11, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> All three misc examples now worked quite fine.
> 
> Great! So we can say pil21 is usable on MacOS.
> 
> 
>> The only problem I had, was exiting the cube.l in a nice way. I can maybe 
>> take
>> a look at that tomorrow.
> 
> Just press Ctrl-D at the REPL prompt.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-09 Thread Alexander Burger
Hi Jon,

> Yes, but after the Ctrl-D I have to click in the cube window to make it go 
> away.

I see! Strange, here it is closed automatically.


> The pil21 now seems to be usable on macOS, however, the "(cd src; make)” did
> not work for me; I got some errors. I used the instructions at
> https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md
>  
> instead.

Yeah, the current Makefile does not cover other systems yet.

Not sure how do do it. I'd like to avoid a messy Makefile as we had with pil64.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-09 Thread Alexander Burger
Hi Jon,

> All three misc examples now worked quite fine.

Great! So we can say pil21 is usable on MacOS.


> The only problem I had, was exiting the cube.l in a nice way. I can maybe take
> a look at that tomorrow.

Just press Ctrl-D at the REPL prompt.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-08 Thread Jon Kleiser
Hi all,

I now installed a fresh pil21 from https://software-lab.de/pil21.tgz 
, followed the build instructions at 
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 
, and 
used the modified lib/openGl.l that I had from my previous try. All three misc 
examples now worked quite fine. The only problem I had, was exiting the cube.l 
in a nice way. I can maybe take a look at that tomorrow.
It was nice to see my old pyramids.l working again. I still haven’t got around 
to have something similar working with WebGL in the browser. ;-)
Thanks for the nice work!

/Jon

> On 8 Nov 2020, at 17:02, Alexander Burger  wrote:
> 
> Hi Andras,
> 
>> On Ubuntu only -D_GNU_SOURCE helps, -D__USE_GNU is not enough.
> 
> On plain Debian, only _GNU_SOURCE still gives an error. So I've defined both 
> now
> (in @src/lib.c, to keep it local).
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 



Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
Hi Andras,

> On Ubuntu only -D_GNU_SOURCE helps, -D__USE_GNU is not enough.

On plain Debian, only _GNU_SOURCE still gives an error. So I've defined both now
(in @src/lib.c, to keep it local).

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Andras Pahi
Hi Alex,

On Ubuntu only -D_GNU_SOURCE helps, -D__USE_GNU is not enough.
It seems that the portability of the glibc API is gone as well…

Regards,
Andras

PS: I found the following on stackoverflow:

_GNU_SOURCE is the only one you should ever define yourself. __USE_GNU is 
defined internally through a mechanism in features.h (which is included by all 
other glibc headers) when _GNU_SOURCE is defined, and possibly under other 
conditions. Defining or undefining __USE_GNU yourself will badly break the 
glibc headers.

> On 2020. Nov 8., at 13:59, Alexander Burger  wrote:
> 
> On Sun, Nov 08, 2020 at 01:48:16PM +0100, Alexander Burger wrote:
>> Should we really do that? How portable are we then?
> 
> Anyway, I released it. Though I don't like it.
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
On Sun, Nov 08, 2020 at 01:48:16PM +0100, Alexander Burger wrote:
> Should we really do that? How portable are we then?

Anyway, I released it. Though I don't like it.

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
On Sun, Nov 08, 2020 at 01:15:00PM +0100, Alexander Burger wrote:
> Yes, I did
> 
>#define _GNU_SOURCE
>#include 
> 
> This works here on Termux, but on Debian I get
> 
>lib.c:493:33: error: use of undeclared
>  identifier 'RTLD_DEFAULT'
> (p->fun = dlsym(lib ?: RTLD_DEF...
>^
>1 error generated.

OK, with

   #define __USE_GNU

it works. Very ugly!

Should we really do that? How portable are we then?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
Hi Andras,

> I’ve checked pil21.tgz which you reverted yesterday on Ubuntu Linux with 
> llvm-10.
> I need to define _GNU_SOURCE to get the definition of RTLD_DEFAULT to compile 
> lib.c.

Yes, I did

   #define _GNU_SOURCE
   #include 

This works here on Termux, but on Debian I get

   lib.c:493:33: error: use of undeclared
 identifier 'RTLD_DEFAULT'
(p->fun = dlsym(lib ?: RTLD_DEF...
   ^
   1 error generated.


> It passes the pil21 tests with ./pil @lib/test.l +
> (%@ “cos” 1.0 (1.0 . 1.0)) and (native “@“ “cos” 1.0 (1.0 . 1.0)) works also.

Also on MacOS?


> Why do you reverted the sources ?

For the above reasons. And also, it smells bad to have an explicit
GNU-dependendy in the code.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Andras Pahi
Hi Alex,

I’ve checked pil21.tgz which you reverted yesterday on Ubuntu Linux with 
llvm-10.
I need to define _GNU_SOURCE to get the definition of RTLD_DEFAULT to compile 
lib.c.
It passes the pil21 tests with ./pil @lib/test.l +
(%@ “cos” 1.0 (1.0 . 1.0)) and (native “@“ “cos” 1.0 (1.0 . 1.0)) works also.

Why do you reverted the sources ?
It works perfectly on Darwin (macOS Mojave 10.14.6) and Ubuntu Linux 18.04.5 
LTS.

Regards,
Andras



> On 2020. Nov 8., at 9:51, Alexander Burger  wrote:
> 
> On Sun, Nov 08, 2020 at 08:46:23AM +0100, Andras Pahi wrote:
>> SHARED = -dynamiclib -undefined dynamic_lookup
> 
> Also, SHARED does not address the problem.
> 
> It is used for linking the *libraries* ext.so and ht.so
> 
> The problem with native is that symbols in the *executable* bin/picolisp are 
> not
> found by dlsym() at runtime.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
On Sun, Nov 08, 2020 at 08:46:23AM +0100, Andras Pahi wrote:
> SHARED = -dynamiclib -undefined dynamic_lookup

Also, SHARED does not address the problem.

It is used for linking the *libraries* ext.so and ht.so

The problem with native is that symbols in the *executable* bin/picolisp are not
found by dlsym() at runtime.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-08 Thread Alexander Burger
On Sun, Nov 08, 2020 at 08:46:23AM +0100, Andras Pahi wrote:
> SHARED = -dynamiclib -undefined dynamic_lookup
> ...

Yes? And does now (native "@" ...) and (%@ ...) work with it?

BTW, if '%@' does not work, we should notice immediately, as all network access
depends on it now (@lib/net.l).

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi all,

I modified the Makefile to match my llvm-10 installation (the executables
Are postfixed with “-mp-10”) and added include and lib directory pathes,
modified the SHARED define as

SHARED = -dynamiclib -undefined dynamic_lookup

Then issued

make
make clean
make

To rebuild the resulting picolisp executable with itself.

Regards,
Andras


> On 2020. Nov 8., at 7:14, Alexander Burger  wrote:
> 
> On Sat, Nov 07, 2020 at 09:22:48PM +0100, Alexander Burger wrote:
>> On Sat, Nov 07, 2020 at 08:01:01PM +0100, Andras Pahi wrote:
>> I revert for now
> 
> Perhaps it needs some command-line flag expoting the symbols in the 
> executable?
> 
> ☺/ A!ex
> 
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 09:22:48PM +0100, Alexander Burger wrote:
> On Sat, Nov 07, 2020 at 08:01:01PM +0100, Andras Pahi wrote:
> I revert for now

Perhaps it needs some command-line flag expoting the symbols in the executable?

☺/ A!ex


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 08:01:01PM +0100, Andras Pahi wrote:
> Yes, it works.
> ...

But now it does not build in Linux any more :(

I revert for now

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Jon Kleiser
Hi Alex,

I have now changed lib/openGl.l as you described, and when I do
$ ./pil misc/sphere.l +
then I get a nice sphere.

If I do
$ ./pil misc/cube.l +
then I get a window with a gray background, but no visible cube.

If I do
$ ./pil misc/pyramids.l +
then I get no graphics, only this:
[misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1")
Bad ffi
openGl? 

In my opinion, the *OS value on macOS should be "macOS", as that’s the correct 
spelling according to Apple.

/Jon

> On 7 Nov 2020, at 11:31, Alexander Burger  wrote:
> 
> On Sat, Nov 07, 2020 at 11:14:13AM +0100, Andras Pahi wrote:
>> I’ve checked Alex’s code on my picoLisp fork only.
>> What is the value of *OS on pil21 ?
>> It seems, that it is NOT “Darwin”, because *GlutLib is “libglut.so.3” 
>> instead of “GLUT.framework/GLUT"
> 
> Yes, I have already changed
> 
>   < (if (= *OS "Darwin")
>   ---
>> (if (= *OS "Macos")
>   17,18c17,18
>   <   *GluLib "libGLU.so.1"
>   <   *GlutLib "libglut.so.3" ) )
>   ---
>>  *GluLib "libGLU.so"
>>  *GlutLib "libglut.so" ) )
> 
> in lib/openGl.l
> 
> Not sure what the right lib names are, depending
> on the system.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex,

Yes, it works.

Running @lib/test.l returns “OK” and all openGl examples 
are working on Darwin replacing glutMainLoopEvent with glutCheckLoop.

As I see you’ve updated the documentation on pil21.
So it’s time to include those changes in my fork as well.

Regards,
Andras

> On 2020. Nov 7., at 19:32, Alexander Burger  wrote:
> 
> I fixed and released it :)
> 
> ☺/ A!ex


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 07:32:29PM +0100, Alexander Burger wrote:
> Yes, indeed. Must be.
> 
> I fixed and released it :)

.. and that after some Beer and Whiskey.

Celebrating the kick-out of the WhiteHouseClown.
I hope I didn't code complete nonsense.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
Hi Andras,

> Nope, native does NOT work with “@“ on Darwin.

Aahh! I misunderstood.


> The definition of RTLD_DEFAULT is
> dlfcn.h:#define   RTLD_DEFAULT((void *) -2)
> 
> So it seems that is the culprit.

Yes, indeed. Must be.

I fixed and released it :)

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex,

Nope, native does NOT work with “@“ on Darwin.

The definition of RTLD_DEFAULT is

dlfcn.h:#define RTLD_DEFAULT((void *) -2)

So it seems that is the culprit.

Regards,
Andras


> On 2020. Nov 7., at 18:37, Alexander Burger  wrote:
> 
> On Sat, Nov 07, 2020 at 06:17:30PM +0100, Alexander Burger wrote:
>>> : (de %@ @ (pass 'native "libSystem.B.dylib"))
>> ...
> 
> Hmm, an idea:
> 
> Can it be that RTLD_DEFAULT is not zero (null) in Darwin?
> 
> Looks like 'native' has such an assumption. But then, on the other hand, 
> neither
> (native "@" "foo" ..) nor (%@ "foo" ...) would work. And, as I understood you,
> 'native' *does* work with "@" ...
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 06:17:30PM +0100, Alexander Burger wrote:
> > : (de %@ @ (pass 'native "libSystem.B.dylib"))
> ...

Hmm, an idea:

Can it be that RTLD_DEFAULT is not zero (null) in Darwin?

Looks like 'native' has such an assumption. But then, on the other hand, neither
(native "@" "foo" ..) nor (%@ "foo" ...) would work. And, as I understood you,
'native' *does* work with "@" ...

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 05:59:34PM +0100, Andras Pahi wrote:
> Yes, it is the same issue as Mike pointed out: accessing the main binary with 
> “@“ does not work.
> 
> But with some cheating:
> 
> ===> ./pil +
> : (de %@ @ (pass 'native "libSystem.B.dylib"))

Cool! As I suspected.

So it must be a bug in %@

I'll check

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex,

Yes, it is the same issue as Mike pointed out: accessing the main binary with 
“@“ does not work.

But with some cheating:

===> ./pil +
: (de %@ @ (pass 'native "libSystem.B.dylib"))
# %@ redefined
-> %@
: (scl 6)
-> 6
: (%@ "cos" 1.0 (1.0 . 1.0))
-> 540302
: (load "misc/pyramids.l")

pyramids.l works as expected.

Regards,
Andras

> On 2020. Nov 7., at 17:36, Alexander Burger  wrote:
> 
> Hi Jon & Andras,
> 
>> I have now changed lib/openGl.l as you described, and when I do
> 
> OK, so "Darwin" is generated in 'make', and not "Macos". I change it back.
> 
>> $ ./pil misc/sphere.l +
>> then I get a nice sphere.
> 
> Cool!
> 
> 
>> If I do
>> $ ./pil misc/cube.l +
>> then I get a window with a gray background, but no visible cube.
> 
> So this might be what Andras wrote: It needs glutCheckLoop instead of
> glutMainLoopEvent?
> 
> 
>> If I do
>> $ ./pil misc/pyramids.l +
>> then I get no graphics, only this:
>> [misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1")
>> Bad ffi
> 
> And this is the issue Mike talked about: Accessing code in the main binary 
> with
> "@" does not work.
> 
> Perhaps it is only '%@'? If
> 
>   : (%@ "cos" 1.0 (1.0 . 1.0))
>   -> 540302
> 
> does not work, how about this one?
> 
>   : (native "@" "cos" 1.0 (1.0 . 1.0))
>   -> 540302
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
Hi Jon & Andras,

> I have now changed lib/openGl.l as you described, and when I do

OK, so "Darwin" is generated in 'make', and not "Macos". I change it back.

> $ ./pil misc/sphere.l +
> then I get a nice sphere.

Cool!


> If I do
> $ ./pil misc/cube.l +
> then I get a window with a gray background, but no visible cube.

So this might be what Andras wrote: It needs glutCheckLoop instead of
glutMainLoopEvent?


> If I do
> $ ./pil misc/pyramids.l +
> then I get no graphics, only this:
> [misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1")
> Bad ffi

And this is the issue Mike talked about: Accessing code in the main binary with
"@" does not work.

Perhaps it is only '%@'? If

   : (%@ "cos" 1.0 (1.0 . 1.0))
   -> 540302

does not work, how about this one?

   : (native "@" "cos" 1.0 (1.0 . 1.0))
   -> 540302

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Alex & Jon,

I’ve grabbed the latest pil21 sources (6nov2020), and compiled on macOS Mojave.
*OS gives back:

===> ./pil +
: *OS
-> "Darwin"
:

Running @lib/test.l produces:

===> ./pil @lib/test.l +
[test/src/main.l:19] !? (%@ "socket" 'I AF_INET6 "Type" 0)
Bad ffi
?

The openGl examples cube.l and sphere.l works as expected.
Running misc/pyramids.l produces:

===> ./pil @misc/pyramids.l +
[misc/pyramids.l:182] !? (%@ "cos" 100 "Dbl1")
Bad ffi
openGl?


Regards,
Andras


> On 2020. Nov 7., at 11:31, Alexander Burger  wrote:
> 
> On Sat, Nov 07, 2020 at 11:14:13AM +0100, Andras Pahi wrote:
>> I’ve checked Alex’s code on my picoLisp fork only.
>> What is the value of *OS on pil21 ?
>> It seems, that it is NOT “Darwin”, because *GlutLib is “libglut.so.3” 
>> instead of “GLUT.framework/GLUT"
> 
> Yes, I have already changed
> 
>   < (if (= *OS "Darwin")
>   ---
>> (if (= *OS "Macos")
>   17,18c17,18
>   <   *GluLib "libGLU.so.1"
>   <   *GlutLib "libglut.so.3" ) )
>   ---
>>  *GluLib "libGLU.so"
>>  *GlutLib "libglut.so" ) )
> 
> in lib/openGl.l
> 
> Not sure what the right lib names are, depending
> on the system.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Jon Kleiser
Hi Andras,

I have now modified my openGl.l the same way, but I still get this:

[misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
"libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found
openGl? 

Am I missing some libglut.so? I have macOS Mojave 10.14.6.

/Jon

> On 5 Nov 2020, at 19:42, Andras Pahi  wrote:
> 
> Hi all,
> 
> I’ve modified openGl.l as follows:
> 
> (if (= *OS "Darwin")
>(default
>   *GluLib "OpenGL.framework/OpenGL"
>   *GlutLib "GLUT.framework/GLUT"
>   *GlutCheckEvent "glutCheckLoop" )
>(default
>   *GluLib "libGLU.so.1"
>   *GlutLib "libglut.so.3"
>   *GlutCheckEvent "glutMainLoopEvent" ) )
> 
> ...
> (de glutMainLoopEvent ()
>(native `*GlutLib `*GlutCheckEvent) )
> 
> Regards,
> Andras
> 
>> On 2020. Nov 5., at 19:35, Andras Pahi > > wrote:
>> 
>> Hi all,
>> 
>> You need to change glutMainLoopEvent to glutCheckLoop on MacOS.
>> Everything works as expected on my fork (not pil21, sorry).
>> 
>> I have attached the screenshots.
>> 
>> Regards,
>> Andras
>> 
>> 
>> 
>> 
>>> On 2020. Nov 5., at 19:00, Alexander Burger >> > wrote:
>>> 
>>> On Thu, Nov 05, 2020 at 07:50:01PM +0200, Mike wrote:
 
> I hear from Mike that "Darwin" is not correct for pil21.
> 
> "Macos"?
 
 This is not issue anymore, I have manually disabled this if to use correct 
 definitions. 
>>> 
>>> Right. But it is needed so that it also runs on other systems.
>>> The else-bodo of the 'if' works for me under Debian.
>>> 
>>> ☺/ A!ex
>>> 
>>> -- 
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe 
>>> 
>> 
> 



Re: pil21 on Mac, some errors

2020-11-07 Thread Alexander Burger
On Sat, Nov 07, 2020 at 11:14:13AM +0100, Andras Pahi wrote:
> I’ve checked Alex’s code on my picoLisp fork only.
> What is the value of *OS on pil21 ?
> It seems, that it is NOT “Darwin”, because *GlutLib is “libglut.so.3” instead 
> of “GLUT.framework/GLUT"

Yes, I have already changed

   < (if (= *OS "Darwin")
   ---
   > (if (= *OS "Macos")
   17,18c17,18
   <   *GluLib "libGLU.so.1"
   <   *GlutLib "libglut.so.3" ) )
   ---
   >   *GluLib "libGLU.so"
   >   *GlutLib "libglut.so" ) )

in lib/openGl.l

Not sure what the right lib names are, depending
on the system.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-07 Thread Andras Pahi
Hi Jon,

I’ve checked Alex’s code on my picoLisp fork only.
What is the value of *OS on pil21 ?
It seems, that it is NOT “Darwin”, because *GlutLib is “libglut.so.3” instead 
of “GLUT.framework/GLUT"

Regards,
Andras

> On 2020. Nov 7., at 10:56, Jon Kleiser  wrote:
> 
> Hi Andras,
> 
> I have now modified my openGl.l the same way, but I still get this:
> 
> [misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
> "libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found
> openGl? 
> 
> Am I missing some libglut.so? I have macOS Mojave 10.14.6.
> 
> /Jon
> 
>> On 5 Nov 2020, at 19:42, Andras Pahi > > wrote:
>> 
>> Hi all,
>> 
>> I’ve modified openGl.l as follows:
>> 
>> (if (= *OS "Darwin")
>>(default
>>   *GluLib "OpenGL.framework/OpenGL"
>>   *GlutLib "GLUT.framework/GLUT"
>>   *GlutCheckEvent "glutCheckLoop" )
>>(default
>>   *GluLib "libGLU.so.1"
>>   *GlutLib "libglut.so.3"
>>   *GlutCheckEvent "glutMainLoopEvent" ) )
>> 
>> ...
>> (de glutMainLoopEvent ()
>>(native `*GlutLib `*GlutCheckEvent) )
>> 
>> Regards,
>> Andras
>> 
>>> On 2020. Nov 5., at 19:35, Andras Pahi >> > wrote:
>>> 
>>> Hi all,
>>> 
>>> You need to change glutMainLoopEvent to glutCheckLoop on MacOS.
>>> Everything works as expected on my fork (not pil21, sorry).
>>> 
>>> I have attached the screenshots.
>>> 
>>> Regards,
>>> Andras
>>> 
>>> 
>>> 
>>> 
 On 2020. Nov 5., at 19:00, Alexander Burger >>> > wrote:
 
 On Thu, Nov 05, 2020 at 07:50:01PM +0200, Mike wrote:
> 
>> I hear from Mike that "Darwin" is not correct for pil21.
>> 
>> "Macos"?
> 
> This is not issue anymore, I have manually disabled this if to use 
> correct definitions. 
 
 Right. But it is needed so that it also runs on other systems.
 The else-bodo of the 'if' works for me under Debian.
 
 ☺/ A!ex
 
 -- 
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe 
 
>>> 
>> 
> 



Re: pil21 on Mac, some errors

2020-11-06 Thread Alexander Burger
Hi Andras,

> So you’ve found it yourself, that the types and the number of args 
> should not change between invocations.

In fact the type is not critical, at least on a 64-bit machine, as all arguments
are passed to a function as opaque word-sized values (pointer, scalar, double or
whatever). The rest is handled by 'native' dynamically.

And passing *less* arguments is also not a problem. Only passing more args than
on the first call gives garbage.

I think Varargs functions are quite out of fashion since a few decades, since C
compilers became more and more strictly type-checking. Normally, printf() is the
only one being used, and printf() in turn is not needed in PicoLisp
applications.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-06 Thread Andras Pahi
Hi Alex,

So you’ve found it yourself, that the types and the number of args 
should not change between invocations.

So I’ve changed the native call syntax to mark variable-args functions,
instead of using a fresh binding for every call.

Regards,
Andras

> On 2020. Nov 6., at 8:07, Alexander Burger  wrote:
> 
> On Thu, Nov 05, 2020 at 11:00:39PM +0100, Alexander Burger wrote:
>> Also, I see no reason why 'native' should not work with normal variable-args
>> functions like printf() in pil21. As far as I see, it works fine.
>> 
>>   : (native "@" "printf" 'I "abc%d%s^J" (+ 3 4) (pack "X" "Y" "Z"))
>>   abc7XYZ
>>   -> 8
> 
> Well, this is not completely true. It works under certain conditions (if the
> types of the calls stay the same, and the number of args is not increased in
> subsequent calls). Even such cases can be handled though, by simply using a
> fresh transient for the function argument symbol.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Mike
> Right. But it is needed so that it also runs on other systems.
> The else-bodo of the 'if' works for me under Debian.

Just hack for testing.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
On Thu, Nov 05, 2020 at 08:30:18PM +0100, Alexander Burger wrote:
> In fact, in pil21 I decided simply *not* to support ffi calls to functions 
> with
> a variable number of arguments. The reason is to keep it simple (and because
> such functions are not frequent).

Also, I see no reason why 'native' should not work with normal variable-args
functions like printf() in pil21. As far as I see, it works fine.

   : (native "@" "printf" 'I "abc%d%s^J" (+ 3 4) (pack "X" "Y" "Z"))
   abc7XYZ
   -> 8

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Mike


> I hear from Mike that "Darwin" is not correct for pil21.
> 
> "Macos"?

This is not issue anymore, I have manually disabled this if to use correct 
definitions. 

(mike)



--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Mike
November 5, 2020 7:09 PM, "Alexander Burger"  wrote:

> On Thu, Nov 05, 2020 at 05:14:03PM +0100, Alexander Burger wrote:
> 
>> So perhaps the output of strace tells us more.
> 
> Hmm, not really. Mike posted one in IRC. It says "invalid kernel access" 
> several
> times, but I have no idea what it means.
> 
> Does anybody have experience with libffi on Mac?
> 

1. it was system integrity protection, disabled for dtruss for future run.

2. installation
brew cask install xquartz
brew install freeglut
reboot

3. changed pathes to glut libraries in @lib/openGl.l
 (default
  *GluLib "libGLU1.dylib"
  *GlutLib "libglut.3.dylib" ) )

4. and now i am getting this error:
$ pil21 @misc/cube.l
: !? (native "libGLU.1.dylib" "gluPerspective" NIL "*Dbl1" "*Dbl2" "*Dbl3" 
"*Dbl4")
"libGLU.1.dylib" -- [DLL] dlopen(libGLU.1.dylib, 9): image not found
? 
: 


(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
On Thu, Nov 05, 2020 at 08:10:49PM +0100, Andras Pahi wrote:
> For reference see https://github.com/pahihu/picoLisp/blob/master/README 
> 

Cool: "fixed arguments must be marked with T". Good idea!

In fact, in pil21 I decided simply *not* to support ffi calls to functions with
a variable number of arguments. The reason is to keep it simple (and because
such functions are not frequent).

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi all,

On macOS Mojave 10.14 the system supplied GLUT.framework/GLUT
does not contain glutMainLoopEvent, only glutCheckLoop.
I’ve just made it work on my Mac.

I use the pil21-version of @lib/openGl.l
See the sources at https://github.com/pahihu/picoLisp/blob/master/lib/openGl.l 

For reference see https://github.com/pahihu/picoLisp/blob/master/README 


Regards,
Andras

> On 2020. Nov 5., at 19:50, Alexander Burger  wrote:
> 
> It was Jon who wrote those demos (and large parts of @lib/openGl.l), so we
> should better let him decide what to do.
> 
> 
>> Everything works as expected on my fork (not pil21, sorry).
> 
> Great! For me on Debian (pil21) it works fine too.
> 
> As you have your own system, I presume you did also not use the pil21-version 
> of
> @lib/openGl.l, right? It is heavily re-coded, using a separate namespace.


Re: pil21 on Mac, some errors

2020-11-05 Thread Mike
hi all,


> 3. It is the general problem with libffi which was mentioned by Mike. I don't
> know more about it atm.

I've got access to MacOs again to test libffi interface:

1. trivial test works:
$ pil21 +
: (native "./native.so" "returnbyte" 'B)
-> 255
: 

2. (native "@" ...) will fail because macos has different libc system name:
$ pil21 + 
: (native "@" "getenv" 'S "TERM")
Bad ffi
? 
: (native "libSystem.B.dylib" "getenv" 'S "TERM")
-> "xterm-256color"

In general should be fine.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
On Thu, Nov 05, 2020 at 07:35:58PM +0100, Andras Pahi wrote:
> Hi all,
> 
> You need to change glutMainLoopEvent to glutCheckLoop on MacOS.

Interesting.

It was Jon who wrote those demos (and large parts of @lib/openGl.l), so we
should better let him decide what to do.


> Everything works as expected on my fork (not pil21, sorry).

Great! For me on Debian (pil21) it works fine too.

As you have your own system, I presume you did also not use the pil21-version of
@lib/openGl.l, right? It is heavily re-coded, using a separate namespace.


Still the question remains if and what is wrong with openGl in pil21.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi all,

I’ve modified openGl.l as follows:

(if (= *OS "Darwin")
   (default
  *GluLib "OpenGL.framework/OpenGL"
  *GlutLib "GLUT.framework/GLUT"
  *GlutCheckEvent "glutCheckLoop" )
   (default
  *GluLib "libGLU.so.1"
  *GlutLib "libglut.so.3"
  *GlutCheckEvent "glutMainLoopEvent" ) )

..
(de glutMainLoopEvent ()
   (native `*GlutLib `*GlutCheckEvent) )

Regards,
Andras

> On 2020. Nov 5., at 19:35, Andras Pahi  wrote:
> 
> Hi all,
> 
> You need to change glutMainLoopEvent to glutCheckLoop on MacOS.
> Everything works as expected on my fork (not pil21, sorry).
> 
> I have attached the screenshots.
> 
> Regards,
> Andras
> 
> 
> 
> 
>> On 2020. Nov 5., at 19:00, Alexander Burger > > wrote:
>> 
>> On Thu, Nov 05, 2020 at 07:50:01PM +0200, Mike wrote:
>>> 
 I hear from Mike that "Darwin" is not correct for pil21.
 
 "Macos"?
>>> 
>>> This is not issue anymore, I have manually disabled this if to use correct 
>>> definitions. 
>> 
>> Right. But it is needed so that it also runs on other systems.
>> The else-bodo of the 'if' works for me under Debian.
>> 
>> ☺/ A!ex
>> 
>> -- 
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe 
>> 
> 



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
On Thu, Nov 05, 2020 at 07:50:01PM +0200, Mike wrote:
> 
> > I hear from Mike that "Darwin" is not correct for pil21.
> > 
> > "Macos"?
> 
> This is not issue anymore, I have manually disabled this if to use correct 
> definitions. 

Right. But it is needed so that it also runs on other systems.
The else-bodo of the 'if' works for me under Debian.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
Hi Andras,

> Yes, I have some experience.
> I use libffi to implement native calls in my picoLisp fork (32bit/64bit) on 
> MacOS.

Yes, I remember, you patched some files to use clang.

On the other hand, the original @lib/openGl.l was widely extended
and ported to Mac by Jon.

I hear from Mike that "Darwin" is not correct for pil21.

"Macos"?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi Alex,

Yes, I have some experience.
I use libffi to implement native calls in my picoLisp fork (32bit/64bit) on 
MacOS.

Andras

> On 2020. Nov 5., at 17:47, Alexander Burger  wrote:
> 
> On Thu, Nov 05, 2020 at 05:14:03PM +0100, Alexander Burger wrote:
>> So perhaps the output of strace tells us more.
> 
> Hmm, not really. Mike posted one in IRC. It says "invalid kernel access" 
> several
> times, but I have no idea what it means.
> 
> Does anybody have experience with libffi on Mac?
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
On Thu, Nov 05, 2020 at 05:14:03PM +0100, Alexander Burger wrote:
> So perhaps the output of strace tells us more.

Hmm, not really. Mike posted one in IRC. It says "invalid kernel access" several
times, but I have no idea what it means.

Does anybody have experience with libffi on Mac?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
Hi Andras,

> Yes. It works with emu under MacOS.

Thanks! Good to know. :)


So perhaps the output of strace tells us more.

@Jon or @Mike:

I would recommend to use "sphere.l" instead of "cube.l", because the latter goes
into a REPL after that and produces too much output.

It can be started as

   $ strace bin/picolisp lib.l lib/misc.l misc/sphere.l 2>err

A mouse click in the OpenGl window closes it. The pastebin the resulting "err"
file.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-05 Thread Andras Pahi
Hi all,

> On 2020. Nov 5., at 16:03, Alexander Burger  wrote:

> This is strange, because "@" is *no* lib at all. It is a special token
> interpreted by PicoLisp as "in this executable binary".
> 
> Did it work with "emu" under MacOS? It used the same mechanism.

Yes. It works with emu under MacOS.

Andras Pahi


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
Hi Mike,

> 2. (native "@" ...) will fail because macos has different libc system name:
> $ pil21 + 
> : (native "@" "getenv" 'S "TERM")
> Bad ffi

This is strange, because "@" is *no* lib at all. It is a special token
interpreted by PicoLisp as "in this executable binary".

Did it work with "emu" under MacOS? It used the same mechanism.

I think 'strace' shows where it goes wrong.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Jon Kleiser
Hi Alex,

I tried
$ ./pil misc/cube.l +

and then I got

[misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
"libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found
openGl? 

/Jon

> On 4 Nov 2020, at 21:28, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I have put the files into lib and misc.
> 
> This is all right.
> 
> 
>> However, I have not installed pil21 "globally" with required symlinks. When I
> 
> This is also good. Here on my systems I haven't installed it globally either 
> (I
> usually leave the Linux distro's (older) version global as it is).
> 
> 
>> cd to my pil21 directory and then do
>> $ pil21 misc/cube.l
> 
> Out of the box, the command is
> 
>   $ cd pil21
>   $ ./pil misc/cube.l +
> 
> or anything analog, like
> 
>   $ pil21/pil pil21/misc/cube.l +
> 
> i.e. with relative pathes.
> 
> (the '+' is optional, as ever)
> 
> 
>> then I get this:
>> 
>> [misc/cube.l:6] !? (load "@lib/openGl.l")
>> "@lib/openGl.l" -- Open error: No such file or directory
> 
> PicoLisp determines the value of "@.." from the start path. I don't know what
> 'pil21' is in your case.
> 
> 
>> What is the minimal thing (symlink) I have to fix for the lib/openGl.l to be
>> found?
> 
> If you really want to install it globally, I believe the description in the
> INSTALL file is correct.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-05 Thread Alexander Burger
Hi Jon,

> [misc/cube.l:13] !? (native "libglut.so.3" "glutInit" NIL '(NIL (8) . 0))
> "libglut.so.3" -- [DLL] dlopen(libglut.so.3, 9): image not found

Probably one or more of:

1. openGl.l says (if (= *OS "Darwin"). Perhaps this is not properly set by
   Makefile?

2. "libglut.so.3" does not exist. In fact, originally it was just "libglut.so",
   but at least on my system a proper link or so was not set.

3. It is the general problem with libffi which was mentioned by Mike. I don't
   know more about it atm.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-11-04 Thread Jon Kleiser
Hi Alex,

I have put the files into lib and misc. However, I have not installed pil21 
"globally" with required symlinks. When I cd to my pil21 directory and then do
$ pil21 misc/cube.l
then I get this:

[misc/cube.l:6] !? (load "@lib/openGl.l")
"@lib/openGl.l" -- Open error: No such file or directory
? 

What is the minimal thing (symlink) I have to fix for the lib/openGl.l to be 
found?

/Jon

> On 2 Nov 2020, at 09:59, Alexander Burger  wrote:
> 
> Hi Jon,
> 
>> I look forward to refresh my PicoLisp knowledge. ;-)
> 
> If you like to experiment:
> 
> I have updated the OpenGL library in @lib/openGl.l (now using a namespace) and
> put it together with some of your demo files (cube, sphere and pyramid) into a
> separate tarball:
> 
>   https://software-lab.de/openGl.tgz
> 
> The reason is that I want to keep the core pil21 distribution small.
> 
> Not sure if it already works on MacOS. As Mike pointed out, there may still be
> issues with the 'native' calls.
> 
> ☺/ A!ex
> 
> -- 
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-04 Thread Alexander Burger
Hi Jon,

> I have put the files into lib and misc.

This is all right.


> However, I have not installed pil21 "globally" with required symlinks. When I

This is also good. Here on my systems I haven't installed it globally either (I
usually leave the Linux distro's (older) version global as it is).


> cd to my pil21 directory and then do
> $ pil21 misc/cube.l

Out of the box, the command is

   $ cd pil21
   $ ./pil misc/cube.l +

or anything analog, like

   $ pil21/pil pil21/misc/cube.l +

i.e. with relative pathes.

(the '+' is optional, as ever)


> then I get this:
> 
> [misc/cube.l:6] !? (load "@lib/openGl.l")
> "@lib/openGl.l" -- Open error: No such file or directory

PicoLisp determines the value of "@.." from the start path. I don't know what
'pil21' is in your case.


> What is the minimal thing (symlink) I have to fix for the lib/openGl.l to be
> found?

If you really want to install it globally, I believe the description in the
INSTALL file is correct.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-11-02 Thread Alexander Burger
Hi Jon,

> I look forward to refresh my PicoLisp knowledge. ;-)

If you like to experiment:

I have updated the OpenGL library in @lib/openGl.l (now using a namespace) and
put it together with some of your demo files (cube, sphere and pyramid) into a
separate tarball:

   https://software-lab.de/openGl.tgz

The reason is that I want to keep the core pil21 distribution small.

Not sure if it already works on MacOS. As Mike pointed out, there may still be
issues with the 'native' calls.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-10-27 Thread Jon Kleiser
Hi Mike,

I now started with a fresh pil21 source and followed your updated macOS 
instructions. This time I got no error messages. Thanks!

My setup is this:

macOS Mojave 10.14.6
llvm 11.0.0
libffi 3.3
ncurses 6.2
readline 8.0.4

I look forward to refresh my PicoLisp knowledge. ;-)

/Jon

> On 26 Oct 2020, at 18:13, Mike  wrote:
> 
> October 26, 2020 10:08 AM, "Jon Kleiser"  wrote:
> 
>> Hi,
>> 
>> Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
>> instructions here:
>> 
>> https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md
>> 
>> Here’s the output from the last line:
>> 
>> $ gcc sysdefs.c && ./a.out > ../lib/sysdefs
>> sysdefs.c:45:21: error: use of undeclared identifier '_OS'
>> printf("# %s\n", _OS);
>> ^
>> sysdefs.c:46:21: error: use of undeclared identifier '_CPU'
>> printf("# %s\n", _CPU);
>> ^
>> 2 errors generated.
>> 
>> And here’s the output from my first attempt to use pil:
>> 
>> $ ../pil
>> [../lib/net.l:3] !? (in (or "Alt" "@lib/sysdefs") (if (from (pack "^J[" 
>> "Sym" "]^J")) (while (and
>> (skip) (<> "[" @)) (def (read) (read))) (quit "No sysdefs" "Sym")))
>> "@lib/sysdefs" -- Open error: No such file or directory
>> ?
>> : (version)
>> 21.0.0
>> -> (21 0 0)
>> : (bye)
>> 
>> Is there some easy fix to get rid of these errors?
>> 
> 
> I've updated and tested Macos compilation:
> https://git.envs.net/mpech/pil21-tests/commit/fa7dee9050b736ecc9067433e3c0006b71a5e514
> 
> In general MacOs platform works except (native) interface.
> It requires additional research in portability.
> 
> (mike)
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> 


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-10-27 Thread Alexander Burger
Hi Jon,

> I now started with a fresh pil21 source and followed your updated macOS 
> instructions. This time I got no error messages. Thanks!
> 
> My setup is this:
> 
> macOS Mojave 10.14.6
> llvm 11.0.0
> libffi 3.3
> ncurses 6.2
> readline 8.0.4

Cool, congratulations!


> I look forward to refresh my PicoLisp knowledge. ;-)

Perhaps we should first find out about 'native':

> > On 26 Oct 2020, at 18:13, Mike  wrote:
> > In general MacOs platform works except (native) interface.
> > It requires additional research in portability.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-10-26 Thread Mike
October 26, 2020 10:08 AM, "Jon Kleiser"  wrote:

> Hi,
> 
> Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
> instructions here:
> 
> https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md
> 
> Here’s the output from the last line:
> 
> $ gcc sysdefs.c && ./a.out > ../lib/sysdefs
> sysdefs.c:45:21: error: use of undeclared identifier '_OS'
> printf("# %s\n", _OS);
> ^
> sysdefs.c:46:21: error: use of undeclared identifier '_CPU'
> printf("# %s\n", _CPU);
> ^
> 2 errors generated.
> 
> And here’s the output from my first attempt to use pil:
> 
> $ ../pil
> [../lib/net.l:3] !? (in (or "Alt" "@lib/sysdefs") (if (from (pack "^J[" "Sym" 
> "]^J")) (while (and
> (skip) (<> "[" @)) (def (read) (read))) (quit "No sysdefs" "Sym")))
> "@lib/sysdefs" -- Open error: No such file or directory
> ?
> : (version)
> 21.0.0
> -> (21 0 0)
> : (bye)
> 
> Is there some easy fix to get rid of these errors?
> 

I've updated and tested Macos compilation:
https://git.envs.net/mpech/pil21-tests/commit/fa7dee9050b736ecc9067433e3c0006b71a5e514

In general MacOs platform works except (native) interface.
It requires additional research in portability.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: pil21 on Mac, some errors

2020-10-26 Thread Mike
> I'm not sure, but after I sent Mike's link to another MacOS user, he answered:
> 
> By following his instruction for macOS 10.15, I was able to build/run on Mac.
> I just needed to upgrade homebrew tools, and use GCC-9 for opt assembler.
> 
> No idea what that means, but perhaps you know?
> 

"opt" tool is part of LLVM ecosystem and Pil21 depends only on LLVM.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-10-26 Thread Mike
> It boils down to: use current versions of your toolchain. On my mint19
> machine i had to manually update llvm from 6(?) to 10 :)
> 

Right, pil21 only works in LLVM7+ environment.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-10-26 Thread Mike
> Is there some easy fix to get rid of these errors?

Sure, I will try repeat steps from scratch this evening on Mac and will update 
the steps

p.s. BTW, homebrew switched to LLVM11. Lucky pil21 supports and tested on 
LLVM11 too.

(mike)

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: pil21 on Mac, some errors

2020-10-26 Thread Karl-Heinz Kreis
Am Mon, 26 Oct 2020 11:15:02 +0100
schrieb Alexander Burger :

> Hi Jon,
> 
> > Yesterday I tried installing pil21 on my Mac, following Mike
> > Pechkin's instructions here:
> > https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md
> > 
> > 
> > Here’s the output from the last line:
> > ...  
> 
> I'm not sure, but after I sent Mike's link to another MacOS user, he
> answered:
> 
>By following his instruction for macOS 10.15, I was able to
> build/run on Mac. I just needed to upgrade homebrew tools, and use
> GCC-9 for opt assembler.
> 
> No idea what that means, but perhaps you know?
> 
> ☺/ A!ex
> 

Hi,

It boils down to: use current versions of your toolchain. On my mint19
machine i had to manually update llvm from 6(?) to 10 :)

Karl-Heinz


pgpJ4yGMGcuFQ.pgp
Description: Digitale Signatur von OpenPGP


pil21 on Mac, some errors

2020-10-26 Thread Jon Kleiser
Hi,

Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
instructions here:
https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 


Here’s the output from the last line:

$ gcc sysdefs.c && ./a.out > ../lib/sysdefs
sysdefs.c:45:21: error: use of undeclared identifier '_OS'
   printf("# %s\n", _OS);
^
sysdefs.c:46:21: error: use of undeclared identifier '_CPU'
   printf("# %s\n", _CPU);
^
2 errors generated.

And here’s the output from my first attempt to use pil:

$ ../pil
[../lib/net.l:3] !? (in (or "Alt" "@lib/sysdefs") (if (from (pack "^J[" "Sym" 
"]^J")) (while (and (skip) (<> "[" @)) (def (read) (read))) (quit "No sysdefs" 
"Sym")))
"@lib/sysdefs" -- Open error: No such file or directory
? 
: (version)
21.0.0
-> (21 0 0)
: (bye)

Is there some easy fix to get rid of these errors?

/Jon

Re: pil21 on Mac, some errors

2020-10-26 Thread Alexander Burger
Hi Jon,

> Yesterday I tried installing pil21 on my Mac, following Mike Pechkin's 
> instructions here:
> https://git.envs.net/mpech/pil21-tests/src/branch/master/INSTALL-.md 
> 
> 
> Here’s the output from the last line:
> ...

I'm not sure, but after I sent Mike's link to another MacOS user, he answered:

   By following his instruction for macOS 10.15, I was able to build/run on Mac.
   I just needed to upgrade homebrew tools, and use GCC-9 for opt assembler.

No idea what that means, but perhaps you know?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe