Re: [NTG-context] osx-64-binaries/minimals

2009-11-19 Thread Mojca Miklavec
On Thu, Nov 19, 2009 at 07:59, Taco Hoekwater wrote:

 Mojca Miklavec wrote:

 Hans, Taco - does LuaTeX itself know if it's 64-bit or not?

 Only internally at the moment, but I could add a variable
 in the os library (after I figure out which of the sizeof()'s
 is the best one to use).

When outside the binary one can run file for example:

 file osx-intel/current/luatex/beta-0.45.0/luatex
osx-intel/current/luatex/beta-0.45.0/luatex: Mach-O executable i386

 file osx-ppc/current/luatex/beta-0.45.0/luatex
osx-ppc/current/luatex/beta-0.45.0/luatex: Mach-O executable ppc

 file osx-64/current/luatex/beta-0.45.0/luatex
osx-64/current/luatex/beta-0.45.0/luatex: Mach-O 64-bit executable x86_64

 file linux/current/luatex/beta-0.44.0/luatex
linux/current/luatex/beta-0.44.0/luatex: ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked
(uses shared libs), stripped

 file linux-64/current/luatex/beta-0.44.0/luatex
linux-64/current/luatex/beta-0.44.0/luatex: ELF 64-bit LSB executable,
x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked
(uses shared libs), stripped

But I have no idea if there is some simple way to hardcode the target
architecture into LuaTeX itself. (Apart from compiling hello world,
running file on it, doing a platform-dependent regular expression
and passing that value to luatex at compile time. But that would be
really really ugly.)

gcc could be as kind as returning the architecture on request.

Yes, I know, I should be dreaming at night, not in the middle of day.
Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-19 Thread Arthur Reutenauer
 But I have no idea if there is some simple way to hardcode the target
 architecture into LuaTeX itself.

  You could check the first few bytes of the LuaTeX binary itself, it has to
tell you something about the architecture it was compiled for.  That's what
file uses in most cases anyway (the magic numbers).  By compiling a stupid C
program on both 10.5 and 10.6, I see that the first 16 bytes of the executable
are, respectively:

  10.5: cefa edfe 0700  0300  0200 

  10.6: cffa edfe 0700 0001 0300 0080 0200 

Arthur
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-19 Thread Martin Schröder
2009/11/19 Taco Hoekwater t...@elvenkind.com:
 Hans, Taco - does LuaTeX itself know if it's 64-bit or not?

 Only internally at the moment, but I could add a variable
 in the os library (after I figure out which of the sizeof()'s
 is the best one to use).

How about exposing uname(2)? Or is that too much information?

Best
Martin
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-19 Thread Taco Hoekwater


Martin Schröder wrote:
 2009/11/19 Taco Hoekwater t...@elvenkind.com:
 Hans, Taco - does LuaTeX itself know if it's 64-bit or not?
 Only internally at the moment, but I could add a variable
 in the os library (after I figure out which of the sizeof()'s
 is the best one to use).
 
 How about exposing uname(2)? Or is that too much information?

It is exposed already, but (if I understand correctly) Snow Leopard
returns the same uname information for both 32bit and 64bit modes.

Best wishes,
Taco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-18 Thread Mojca Miklavec
 If I update the minimals via first-setup.sh I get the 32bit-binaries (luatex) 
 although I'm on Snow Leopard. If I change the binaries myself it works fine 
 and the compilation is notable faster!

Andreas,

Can you please try one thing?

In first-setup.sh you can try to add the following lines (around line
56, after the platforms are being recognized):

if test $platform = osx-intel; then
  # running Snow Leopard or later
  if test `uname -r|cut -f1 -d.`  -ge 10 ; then
# working on 64-bit hardware
if test `sysctl -n hw.cpu64bit_capable` = 1; then
  platform=osx-64
fi
  fi
fi

And then update the minimals. After that try to paste the same lines
to setuptex around line 59, try to run setuptex and try if you get
the 64-bit binaries and if they work fine (I can try to do that
myself, but I try to avoid rebooting my machine too often). You need
to fix setuptex after you update the distribution since updating will
change setuptex.

If that works for you, I'll fix it.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-18 Thread Mojca Miklavec
OK, I did a nasty thing. I have patched setuptex to run 64-bit
binaries on Snow Leopard.

There is only one problem: mtxrun doesn't know that one is running on
a 64-bit platform and consequently fetches just 32-bit binaries.

Consequently one needs to call mtx-update with --platform=osx-64. I
fixed first-setup.sh, but existing Snow Leopard users with 32-bit
kernels will have to add that to first-setup.sh themselves ... or we
need to revert the change.

Hans, Taco - does LuaTeX itself know if it's 64-bit or not?

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-18 Thread Taco Hoekwater


Mojca Miklavec wrote:
 
 Hans, Taco - does LuaTeX itself know if it's 64-bit or not?

Only internally at the moment, but I could add a variable
in the os library (after I figure out which of the sizeof()'s
is the best one to use).

Best wishes,
Taco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-17 Thread Mojca Miklavec
On Mon, Nov 16, 2009 at 11:33, Andreas Harder wrote:
 Hi all!

 If I update the minimals via first-setup.sh I get the 32bit-binaries (luatex) 
 although I'm on Snow Leopard. If I change the binaries myself it works fine 
 and the compilation is notable faster!

We had a lengthy discussion about Snow Leopard. The last message was
Yue Wang's proposal to check for 64-bit compatibility:

 The hardware test:
 Yue:context yue$  if test `sysctl -n hw.cpu64bit_capable | grep -c 1` = 1 ; 
 then  echo yes; else echo no; fi
 yes

 The software test:
 Yue:context yue$  if test `uname -r|cut -f1 -d.`  -ge 10 ; then echo yes; 
 else echo no; fi
 yes

This test needs to be fixed in:
- first-setup.sh
- setuptex
- mtxrun.lua

The biggest problem is the latest one. I'm not sure if Hans is willing
to implement that in MKIV and I'm still not decided if I want to mess
with that ugly code or not.

The reason for the change:
- a bit faster and a bit more puristic

The reason against the change:
- a bit ugly
- the 32-bit binaries work
- one can always boot in 64-bit mode

There's always a third option to provide fat binaries, but as others
would probably confirm: they are a bit fat indeed. Three times the
original size since we now support 3 platforms.

Any other votes?

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-17 Thread Hans Hagen

Mojca Miklavec wrote:

On Mon, Nov 16, 2009 at 11:33, Andreas Harder wrote:

Hi all!

If I update the minimals via first-setup.sh I get the 32bit-binaries (luatex) 
although I'm on Snow Leopard. If I change the binaries myself it works fine and 
the compilation is notable faster!


We had a lengthy discussion about Snow Leopard. The last message was
Yue Wang's proposal to check for 64-bit compatibility:


The hardware test:
Yue:context yue$  if test `sysctl -n hw.cpu64bit_capable | grep -c 1` = 1 ; 
then  echo yes; else echo no; fi
yes

The software test:
Yue:context yue$  if test `uname -r|cut -f1 -d.`  -ge 10 ; then echo yes; 
else echo no; fi
yes


hm, we need to use the methods built in luatex

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-17 Thread Taco Hoekwater


Hans Hagen wrote:
 Mojca Miklavec wrote:
 On Mon, Nov 16, 2009 at 11:33, Andreas Harder wrote:
 Hi all!

 If I update the minimals via first-setup.sh I get the 32bit-binaries
 (luatex) although I'm on Snow Leopard. If I change the binaries
 myself it works fine and the compilation is notable faster!

 We had a lengthy discussion about Snow Leopard. The last message was
 Yue Wang's proposal to check for 64-bit compatibility:

 The hardware test:
 Yue:context yue$  if test `sysctl -n hw.cpu64bit_capable | grep -c 1`
 = 1 ; then  echo yes; else echo no; fi
 yes

 The software test:
 Yue:context yue$  if test `uname -r|cut -f1 -d.`  -ge 10 ; then
 echo yes; else echo no; fi
 yes
 
 hm, we need to use the methods built in luatex

Someone should check what is returned in the os.uname() return table.

Best wishes,
Taco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-17 Thread Mojca Miklavec
On Tue, Nov 17, 2009 at 17:16, Taco Hoekwater wrote:
 Hans Hagen wrote:
 Mojca Miklavec wrote:
 On Mon, Nov 16, 2009 at 11:33, Andreas Harder wrote:
 Hi all!

 If I update the minimals via first-setup.sh I get the 32bit-binaries
 (luatex) although I'm on Snow Leopard. If I change the binaries
 myself it works fine and the compilation is notable faster!

 We had a lengthy discussion about Snow Leopard. The last message was
 Yue Wang's proposal to check for 64-bit compatibility:

 The hardware test:
 Yue:context yue$  if test `sysctl -n hw.cpu64bit_capable | grep -c 1`
 = 1 ; then  echo yes; else echo no; fi
 yes

 The software test:
 Yue:context yue$  if test `uname -r|cut -f1 -d.`  -ge 10 ; then
 echo yes; else echo no; fi
 yes

 hm, we need to use the methods built in luatex

 Someone should check what is returned in the os.uname() return table.

Mine returns

t={
 [machine]=x86_64,
 [nodename]=...[my ip]...,
 [release]=10.0.0,
 [sysname]=Darwin,
 [version]=Darwin Kernel Version 10.0.0: Fri Jul 31 22:46:25 PDT
2009; root:xnu-1456.1.25~1/RELEASE_X86_64,
}

but I'm booting in 64-bit mode (I need to reboot first to check for
return value in 32-bit mode).

On one hand uname doesn't return anything usable when booting with
32-bit kernel, but on the other hand one probably already runs the
64-bit luatex at the time when mtxrun needs to determine the
architecture.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] osx-64-binaries/minimals

2009-11-17 Thread Taco Hoekwater

Mojca Miklavec wrote:

The software test:
Yue:context yue$  if test `uname -r|cut -f1 -d.`  -ge 10 ; then
echo yes; else echo no; fi
yes

hm, we need to use the methods built in luatex

Someone should check what is returned in the os.uname() return table.


Mine returns

t={
 [machine]=x86_64,
 [nodename]=...[my ip]...,
 [release]=10.0.0,
 [sysname]=Darwin,
 [version]=Darwin Kernel Version 10.0.0: Fri Jul 31 22:46:25 PDT
2009; root:xnu-1456.1.25~1/RELEASE_X86_64,
}

but I'm booting in 64-bit mode (I need to reboot first to check for
return value in 32-bit mode).

On one hand uname doesn't return anything usable when booting with
32-bit kernel, but on the other hand one probably already runs the
64-bit luatex at the time when mtxrun needs to determine the
architecture.


Well, I doubt you can discover whether you have a totally 32bit software
environment with a 64bit kernel without lots of trickery (but I could
be wrong about that). In any case, os.uname() will give the same results
as the shell command uname.

64bit osx runs 32bit executables (I assume) so you could make the
initial luatex (the one used during install) be a 32bit one, then make
that one decide on which one to use for normal typesetting?

Best wishes,
Taco


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] osx-64-binaries/minimals

2009-11-16 Thread Andreas Harder
Hi all!

If I update the minimals via first-setup.sh I get the 32bit-binaries (luatex) 
although I'm on Snow Leopard. If I change the binaries myself it works fine and 
the compilation is notable faster!

Greetings
Andreas
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___