(Do you have a github fork of https://github.com/jsoftware/jsource
that we can look at?)

Probably, since you're doing this quick and dirty, I imagine the thing
to do is edit your copy of stdlib.ijs with a quick fix that gets you
running.

From your error message, it looks like your copy dies at the line
corresponding to:

https://github.com/jsoftware/jsource/blob/master/jlibrary/system/main/stdlib.ijs#L49

Which is, basically:

if. notdef 'IFRASPI' do.
  if. UNAME -: 'Linux' do.
    cpu=. 2!:0 'cat /proc/cpuinfo'
    IFRASPI=: (1 e. 'BCM2708' E. cpu) +. (1 e. 'BCM2709' E. cpu) +. 1
e. 'BCM2710' E. cpu
  else.
    IFRASPI=: 0
  end.
end.

Since you're probably not using a raspberry pi here, I'd just change that to:

if. notdef 'IFRASPI' do.
  IFRASPI=: 0
end.

(At some point, though, I imagine it would be nice to do an official
openbsd port of J source.)

Thanks,

-- 
Raul

On Mon, Apr 22, 2019 at 3:19 PM Alexander Shendi
<alexander.she...@web.de> wrote:
>
> Hello J community,
>
> I am currently trying to learn J using the 'J for C Programmers'
> book. As there is no binary distribution for OpenBSD, I have decided
> to attempt to compile the J901-beta-d source under OpenBSD.
>
> I have so far succeded in adapting and compiling the C source files and have
> working jconsole and libj.so binaries.
>
> However it seems that I also need to port the J library files
> (e.g. `stdlib.ijs'), but that seems to be harder, because I am still a
> J newbie.
>
> Here is a sample jconsole session:
>
> ========================================================================
>
> Script started on Mon Apr 22 21:00:38 2019
> alex-x200t$ ./jconsole
> cat: /proc/cpuinfo: No such file or directory
> |interface error
> |   cpu=.    2!:0'cat /proc/cpuinfo'
> |[-75] 
> /home/alexshendi/sources/packages/jsource-j901-beta-d.p1/jlibrary/system/main/stdlib.ijs
>    UNAME
> Linux
>    1 2 3 + 4 5 6
> 5 7 9
>    i.10
> 0 1 2 3 4 5 6 7 8 9
>    +/i.11+1
> 66
>
> Script done on Mon Apr 22 21:05:41 2019
>
> =======================================================================
>
> J seems to think it is still running under Linux and tries to
> open /proc/cpuinfo, which doesn't exist under BSD systems.
> But basic stuff seems to work :)
>
> I would be grateful for some advice on how to proceed.
> I will be glad to provide more information, if needed.
>
> Many thanks in advance,
>
> Alexander
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to