Installing Lua on macOS in order to update Lua.

classic Classic list List threaded Threaded
59 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Installing Lua on macOS in order to update Lua.

Glenn Travis
I think that lua came as part of the macOS, however I noticed that it was version 5.1.  I decided to update it and downloaded the current version of lua. 
I spent several hours messing with the instillation.  I followed the html instructions closely and did indeed get a lua 5.3.4 directory etc installed on my iMac (OS 10.13.3). I could get lua to “open in the interactive mode ” in terminal if I went to the lua src directory and used the   ./lua    line command. Simply entering lua as a command, which worked before, resulted in a file not found error message. 
I modified the PATH in my .profile to include the lua to source path and this worked fine, but it just felt wrong, and I did not see doing this in the html docs. 
So I looked at the makefile file and looked at where things were supposed to go.  In this instance, the INSTALL_TOP=  path started out as /usr/local/. . .   This path line will not work unless one uses sudo make install which will then put things in the right place (these directories are ‘owned” root / wheel. 
After doing that and deleting the PATH line from .profile, entering lua on the command line works just fine.  I think that this needs to be noted into the instructions. 

Thank you,
Trav
Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
Glenn:

On Fri, Feb 23, 2018 at 6:01 PM, Glenn Travis <[hidden email]> wrote:

> So I looked at the makefile file and looked at where things were supposed to
> go.  In this instance, the INSTALL_TOP=  path started out as /usr/local/. .
> .   This path line will not work unless one uses sudo make install which
> will then put things in the right place (these directories are ‘owned” root
> / wheel.

Didn't the "make install" spit any errors?

I mean, the sudo, su or login as root steps are well known in the unix
world for installing system software. Forgetting su is usual when you
use the "safer" way of building from source ( make/make test as a
normal user, root just for install ) and I've ran into it many times,
but normally I just get a pile of errors and then su & repeat.

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Luiz Henrique de Figueiredo
In reply to this post by Glenn Travis
The README in the tarball and in says:

http://www.lua.org/manual/5.3/readme.html#install

Installing Lua

Once you have built Lua, you may want to install it in an official
place in your system. In this case, do "make install". The official
place and the way to install files are defined in the Makefile. You'll
probably need the right permissions to install files.

Perhaps this should mention sudo?

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
Actually, I feel that it should be right up there in the initial instructions or else it will not be installed properly given the root and wheel system properties of /usr/ . . .. I searched around on the internet, and most bash > lua won’t work command concern were fairly old, and most replies were of the fix the PATH sort of things.
I used the sudo make install combined command, so I do not know if Sudo make or sudo install will do it or if one needs the combined command, but I DO know that it will install and get folks up and running; the admin password is necessary and get the right permissions going.
Thank you

> On Feb 23, 2018, at 11:16 AM, Luiz Henrique de Figueiredo <[hidden email]> wrote:
>
> The README in the tarball and in says:
>
> http://www.lua.org/manual/5.3/readme.html#install
>
> Installing Lua
>
> Once you have built Lua, you may want to install it in an official
> place in your system. In this case, do "make install". The official
> place and the way to install files are defined in the Makefile. You'll
> probably need the right permissions to install files.
>
> Perhaps this should mention sudo?
>


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
In reply to this post by Francisco Olarte
You bring up an interesting point.  I have no idea as to why there were no error messages given.  
Actually, no errors were created.  It just defaulted???? to whatever directory the makefile was in and it looked fine until I went to the terminal command lua line.

> On Feb 23, 2018, at 11:11 AM, Francisco Olarte <[hidden email]> wrote:
>
> Glenn:
>
> On Fri, Feb 23, 2018 at 6:01 PM, Glenn Travis <[hidden email]> wrote:
>
>> So I looked at the makefile file and looked at where things were supposed to
>> go.  In this instance, the INSTALL_TOP=  path started out as /usr/local/. .
>> .   This path line will not work unless one uses sudo make install which
>> will then put things in the right place (these directories are ‘owned” root
>> / wheel.
>
> Didn't the "make install" spit any errors?
>
> I mean, the sudo, su or login as root steps are well known in the unix
> world for installing system software. Forgetting su is usual when you
> use the "safer" way of building from source ( make/make test as a
> normal user, root just for install ) and I've ran into it many times,
> but normally I just get a pile of errors and then su & repeat.
>
> Francisco Olarte.
>


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
In reply to this post by Luiz Henrique de Figueiredo
On Fri, Feb 23, 2018 at 6:16 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

> The README in the tarball and in says:
>
> http://www.lua.org/manual/5.3/readme.html#install
>
> Installing Lua
>
> Once you have built Lua, you may want to install it in an official
> place in your system. In this case, do "make install". The official
> place and the way to install files are defined in the Makefile. You'll
> probably need the right permissions to install files.
>
> Perhaps this should mention sudo?

Given the previous section mentions unix-like and linux it may be
useful, and maybe a mentioning mac os-x is unix like too ( I do not
think linux users compiling will have problems, but mac users seem to
be more like windows one, they do not know they OS/toolset too well ).

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
In reply to this post by Glenn Travis
On Fri, Feb 23, 2018 at 6:47 PM, Glenn Travis <[hidden email]> wrote:
> You bring up an interesting point.  I have no idea as to why there were no error messages given.
> Actually, no errors were created.  It just defaulted???? to whatever directory the makefile was in and it looked fine until I went to the terminal command lua line.

Are you sure no error was given by make install?  I do not have a max,
but certainly in my machine, using bash, it gives:

folarte@p:~/tmp/lua-5.3.4$ make install
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib
/usr/local/man/man1 /usr/local/share/lua/5.3 /usr/local/lib/lua/5.3
mkdir: cannot create directory ‘/usr/local/man/man1’: Permission denied
mkdir: cannot create directory ‘/usr/local/share/lua’: Permission denied
mkdir: cannot create directory ‘/usr/local/lib/lua’: Permission denied
Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1

quite some errors.

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
No Sir, nothing like that.  I have run afoul of the permissions error before so I understand what you are saying.  They were just not there, and when I do see them, I know that I have to go the sudo route.

> On Feb 23, 2018, at 11:52 AM, Francisco Olarte <[hidden email]> wrote:
>
> On Fri, Feb 23, 2018 at 6:47 PM, Glenn Travis <[hidden email]> wrote:
>> You bring up an interesting point.  I have no idea as to why there were no error messages given.
>> Actually, no errors were created.  It just defaulted???? to whatever directory the makefile was in and it looked fine until I went to the terminal command lua line.
>
> Are you sure no error was given by make install?  I do not have a max,
> but certainly in my machine, using bash, it gives:
>
> folarte@p:~/tmp/lua-5.3.4$ make install
> cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib
> /usr/local/man/man1 /usr/local/share/lua/5.3 /usr/local/lib/lua/5.3
> mkdir: cannot create directory ‘/usr/local/man/man1’: Permission denied
> mkdir: cannot create directory ‘/usr/local/share/lua’: Permission denied
> mkdir: cannot create directory ‘/usr/local/lib/lua’: Permission denied
> Makefile:61: recipe for target 'install' failed
> make: *** [install] Error 1
>
> quite some errors.
>
> Francisco Olarte.
>


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
In reply to this post by Glenn Travis
Glenn:

On Fri, Feb 23, 2018 at 6:43 PM, Glenn Travis <[hidden email]> wrote:
> Actually, I feel that it should be right up there in the initial instructions or else it will not be installed properly given the root and wheel system properties of /usr/ . . .. I searched around on the internet, and most bash > lua won’t work command concern were fairly old, and most replies were of the fix the PATH sort of things.

That may be because most people making a global install on a unix-like
system read teh manual and insured they had the right permissions.

Note "sudo make install" is not the only way, you may have logged in
as root, or used sudo -i, or plain su, or have some permissions in
your user over the system dirs ( I do not use the staff group, but
I've noticed this in my Debian install:

folarte@p:~/tmp/lua-5.3.4$ ls -ld /usr/local/{,share,man,lib,bin}
drwxrwsr-x 10 root staff 4096 Apr 24  2014 /usr/local/
drwxrwsr-x  2 root staff 4096 Apr 24  2014 /usr/local/bin
drwxrwsr-x  4 root staff 4096 Jul 24  2017 /usr/local/lib
lrwxrwxrwx  1 root staff    9 Apr 24  2014 /usr/local/man -> share/man
drwxrwsr-x  9 root staff 4096 Jul 24  2017 /usr/local/share

)

> I used the sudo make install combined command, so I do not know if Sudo make or sudo install will do it or if one needs the combined command, but I DO know that it will install and get folks up and running; the admin password is necessary and get the right permissions going.

mmm, you seem to have some misunderstanding of how it works. Command
lines are case sensitive, I do not know about your FS, it may be not,
but is is sudo, not Sudo.
Also, "make install" is a single command, it calls make, the building
program, and tells it to process the install target. Casually the
install target uses the install command a lot if available, but that's
a single command.

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
In reply to this post by Glenn Travis
Glenn.

On Fri, Feb 23, 2018 at 6:55 PM, Glenn Travis <[hidden email]> wrote:
> No Sir, nothing like that.  I have run afoul of the permissions error before so I understand what you are saying.  They were just not there, and when I do see them, I know that I have to go the sudo route.

That's a bit strange. I assume the mac uses  the BSD versions of
install / cp / mkdir, maybe those are not "verbose by default" like
the gnu ones debian uses. Or may be you've tuned tha Makefile. And my
make also detects the last command error and errors out in turn. I
cannot tell much more without seeing it, but if this is normal in Macs
it would certainly be nice to have something for it.

One other thing, is /usr/local/bin in the default $PATH for MacOs?
Because I think I've read it uses a peculiar way of installing things,
but that maight be for graphics programs, or installers.

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
In reply to this post by Luiz Henrique de Figueiredo
I see what you are saying, however, please note that on that page it reads

Once you have built Lua, you may want to install it in an official place in your system. 
 
Now that is  passive voice (may) and folks might skip or ignore that portion.
Given that, I may I suggest that it be rewritten in active voice ; you will need to install….  You must install . . . Etc.
And then perhaps include a macOS html header about bout using sudo.
Thank you
Trav


On Feb 23, 2018, at 11:16 AM, Luiz Henrique de Figueiredo <[hidden email]> wrote:

The README in the tarball and in says:

http://www.lua.org/manual/5.3/readme.html#install

Installing Lua

Once you have built Lua, you may want to install it in an official
place in your system. In this case, do "make install". The official
place and the way to install files are defined in the Makefile. You'll
probably need the right permissions to install files.

Perhaps this should mention sudo?


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Francisco Olarte
On Fri, Feb 23, 2018 at 7:07 PM, Glenn Travis <[hidden email]> wrote:
> I see what you are saying, however, please note that on that page it reads
>
> Once you have built Lua, you may want to install it in an official place in
> your system.
>
> Now that is  passive voice (may) and folks might skip or ignore that
> portion.

Is "passive voice" the correct term for these? English is not my
native language, but I  think I was taught "User installs lua", active
voice, "Lua is installed by the user", passive voice ( similar to how
it is in spanish, just asking, I really do not know ).

> Given that, I may I suggest that it be rewritten in active voice ; you will
> need to install….  You must install . . . Etc.

I STRONGLY disagree with that. Many users DO NOT install lua from
sources in an "official" place, and in fact I've NEVER done it (
always installed it locally from sources, for "official" installs i go
the easy way and use package managers, I do not consider myself smart
enough to install global packages from sources ).

> And then perhaps include a macOS html header about bout using sudo.

And I disagree with including a chunk of macOS docs for it. IMO
someone installing an interpreter from sources should be able to
understand teh permission stuff. Maybe putting some os ( os+toolchain?
) specific install guides elsewhere, but including this could lead to
a chunk for Mac, other for solaris, other for ( each ) bsd, one for
each of the toolchains of windows, one for each linux
distro/toolchain, and end with a horrendous big chunk of text which
most users would not be able to understand.

Francisco Olarte.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Dirk Laurie-2
2018-02-23 20:31 GMT+02:00 Francisco Olarte <[hidden email]>:

> On Fri, Feb 23, 2018 at 7:07 PM, Glenn Travis <[hidden email]> wrote:
>> I see what you are saying, however, please note that on that page it reads
>>
>> Once you have built Lua, you may want to install it in an official place in
>> your system.
>>
>> Now that is  passive voice (may) and folks might skip or ignore that
>> portion.
>
> Is "passive voice" the correct term for these? English is not my
> native language, but I  think I was taught "User installs lua", active
> voice, "Lua is installed by the user", passive voice ( similar to how
> it is in spanish, just asking, I really do not know ).

It's the subjunctive mode. Perfectly correct in this situation.

>> Given that, I may I suggest that it be rewritten in active voice ; you will
>> need to install….  You must install . . . Etc.
>
> I STRONGLY disagree with that. Many users DO NOT install lua from
> sources in an "official" place, and in fact I've NEVER done it (
> always installed it locally from sources, for "official" installs i go
> the easy way and use package managers, I do not consider myself smart
> enough to install global packages from sources ).

And anyway, nothing in Lua is ever "must". Lua supplies tols, not policies.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Luiz Henrique de Figueiredo
Anyway, we welcome suggestions for improving the instructions in

http://www.lua.org/start.html
http://www.lua.org/manual/5.3/readme.html

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Sean Conner
In reply to this post by Glenn Travis
It was thus said that the Great Glenn Travis once stated:
> No Sir, nothing like that.  I have run afoul of the permissions error
> before so I understand what you are saying.  They were just not there, and
> when I do see them, I know that I have to go the sudo route.

  Interesting.  I have two Macs I use (one personal, one for work).  On my
personal one, "/usr/local" is owned by root, so I would get an error trying
to install Lua.  On the work Mac, however, "/usr/local" is owned by me
(except for "/usr/local/man" for some reason).  The only thing I can think
of is that I have used homebrew on the work Mac, but not on my personal Mac
(I really don't do development on the home Mac).

  But I suspect that "/usr/local" is owned by you (the non-root account you
use).

  -spc

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Coda Highland
On Fri, Feb 23, 2018 at 3:23 PM, Sean Conner <[hidden email]> wrote:

> It was thus said that the Great Glenn Travis once stated:
>> No Sir, nothing like that.  I have run afoul of the permissions error
>> before so I understand what you are saying.  They were just not there, and
>> when I do see them, I know that I have to go the sudo route.
>
>   Interesting.  I have two Macs I use (one personal, one for work).  On my
> personal one, "/usr/local" is owned by root, so I would get an error trying
> to install Lua.  On the work Mac, however, "/usr/local" is owned by me
> (except for "/usr/local/man" for some reason).  The only thing I can think
> of is that I have used homebrew on the work Mac, but not on my personal Mac
> (I really don't do development on the home Mac).
>
>   But I suspect that "/usr/local" is owned by you (the non-root account you
> use).
>
>   -spc

It should be noted that npm (at least used to) include advice to chown
/usr/local to yourself, and a design flaw in the current prerelease
version will actually forcefully perform the chowning. So if you've
ever worked with that ecosystem, this might explain some of the
difference.

Homebrew makes similar advice.

Both packages really ought to advise changing the destination and
adding it to your PATH...

/s/ Adam

Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
In reply to this post by Sean Conner
Howdy,
Here is a long listing of my computer

Glenns-iMac:usr trav$ ll
total 0
drwxr-xr-x  976 root  wheel  31232 Feb 20 05:37 bin
drwxr-xr-x  291 root  wheel   9312 Jan 30 14:33 lib
drwxr-xr-x  247 root  wheel   7904 Feb 20 05:37 sbin
drwxr-xr-x  234 root  wheel   7488 Jan 30 14:33 libexec
drwxr-xr-x   45 root  wheel   1440 Dec  7 09:31 share
drwxr-xr-x    8 root  wheel    256 Jan 19 09:40 local
drwxr-xr-x    5 root  wheel    160 Oct  3 00:48 standalone
Glenns-iMac:usr trav$ 


Seeing as how /usr will be installed there, I have to use sudo, else nothing gets put in there by the Install command. 


On Feb 23, 2018, at 3:23 PM, Sean Conner <[hidden email]> wrote:

It was thus said that the Great Glenn Travis once stated:
No Sir, nothing like that.  I have run afoul of the permissions error
before so I understand what you are saying.  They were just not there, and
when I do see them, I know that I have to go the sudo route.

 Interesting.  I have two Macs I use (one personal, one for work).  On my
personal one, "/usr/local" is owned by root, so I would get an error trying
to install Lua.  On the work Mac, however, "/usr/local" is owned by me
(except for "/usr/local/man" for some reason).  The only thing I can think
of is that I have used homebrew on the work Mac, but not on my personal Mac
(I really don't do development on the home Mac).

 But I suspect that "/usr/local" is owned by you (the non-root account you
use).

 -spc


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Sean Conner
It was thus said that the Great Glenn Travis once stated:

> Howdy,
> Here is a long listing of my computer
>
> Glenns-iMac:usr trav$ ll
> total 0
> drwxr-xr-x  976 root  wheel  31232 Feb 20 05:37 bin
> drwxr-xr-x  291 root  wheel   9312 Jan 30 14:33 lib
> drwxr-xr-x  247 root  wheel   7904 Feb 20 05:37 sbin
> drwxr-xr-x  234 root  wheel   7488 Jan 30 14:33 libexec
> drwxr-xr-x   45 root  wheel   1440 Dec  7 09:31 share
> drwxr-xr-x    8 root  wheel    256 Jan 19 09:40 local
> drwxr-xr-x    5 root  wheel    160 Oct  3 00:48 standalone
> Glenns-iMac:usr trav$

  Interesting ... what about the directories in /usr/local?

  -spc


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
In reply to this post by Francisco Olarte
Howdy,
I’m sorry, but I avoid logging in as root at all costs.  I just use my admin account, as I suspect most Mac users do.

> On Feb 23, 2018, at 11:58 AM, Francisco Olarte <[hidden email]> wrote:
>
> Glenn:
>
> On Fri, Feb 23, 2018 at 6:43 PM, Glenn Travis <[hidden email]> wrote:
>> Actually, I feel that it should be right up there in the initial instructions or else it will not be installed properly given the root and wheel system properties of /usr/ . . .. I searched around on the internet, and most bash > lua won’t work command concern were fairly old, and most replies were of the fix the PATH sort of things.
>
> That may be because most people making a global install on a unix-like
> system read teh manual and insured they had the right permissions.
>
> Note "sudo make install" is not the only way, you may have logged in
> as root, or used sudo -i, or plain su, or have some permissions in
> your user over the system dirs ( I do not use the staff group, but
> I've noticed this in my Debian install:
>
> folarte@p:~/tmp/lua-5.3.4$ ls -ld /usr/local/{,share,man,lib,bin}
> drwxrwsr-x 10 root staff 4096 Apr 24  2014 /usr/local/
> drwxrwsr-x  2 root staff 4096 Apr 24  2014 /usr/local/bin
> drwxrwsr-x  4 root staff 4096 Jul 24  2017 /usr/local/lib
> lrwxrwxrwx  1 root staff    9 Apr 24  2014 /usr/local/man -> share/man
> drwxrwsr-x  9 root staff 4096 Jul 24  2017 /usr/local/share
>
> )
>
 
The Sudo was a typo. I understand that "make install' is a single command, but to get it on macOS correctly, one must use sudo make install.   Interestingly enough until recently Mac Terminal commands, file names etc were not case sensitive
I just messed around with the make and the install commands. For instance, I could do make and then install (sudo install later).

>> I used the sudo make install combined command, so I do not know if Sudo make or sudo install will do it or if one needs the combined command, but I DO know that it will install and get folks up and running; the admin password is necessary and get the right permissions going.
>
> mmm, you seem to have some misunderstanding of how it works. Command
> lines are case sensitive, I do not know about your FS, it may be not,
> but is is sudo, not Sudo.
> Also, "make install" is a single command, it calls make, the building
> program, and tells it to process the install target. Casually the
> install target uses the install command a lot if available, but that's
> a single command.
>
> Francisco Olarte.
>


Reply | Threaded
Open this post in threaded view
|

Re: Installing Lua on macOS in order to update Lua.

Glenn Travis
In reply to this post by Sean Conner
Howdy,

It’s the same thing:
Last login: Fri Feb 23 17:57:32 on ttys000
Glenns-iMac:~ trav$ cd /usr/local
Glenns-iMac:local trav$ pwd
/usr/local
Glenns-iMac:local trav$ ll
total 0
drwxr-xr-x  6 root  wheel  192 Feb 23 16:44 bin
drwxr-xr-x  4 root  wheel  128 Jan 19 09:40 share
drwxr-xr-x  3 root  wheel   96 Feb 23 10:07 man
drwxr-xr-x  2 root  wheel   64 Feb 23 16:44 include
drwxr-xr-x  2 root  wheel   64 Feb 23 16:57 lib
Glenns-iMac:local trav$ 




On Feb 23, 2018, at 5:30 PM, Sean Conner <[hidden email]> wrote:

It was thus said that the Great Glenn Travis once stated:
Howdy,
Here is a long listing of my computer

Glenns-iMac:usr trav$ ll
total 0
drwxr-xr-x  976 root  wheel  31232 Feb 20 05:37 bin
drwxr-xr-x  291 root  wheel   9312 Jan 30 14:33 lib
drwxr-xr-x  247 root  wheel   7904 Feb 20 05:37 sbin
drwxr-xr-x  234 root  wheel   7488 Jan 30 14:33 libexec
drwxr-xr-x   45 root  wheel   1440 Dec  7 09:31 share
drwxr-xr-x    8 root  wheel    256 Jan 19 09:40 local
drwxr-xr-x    5 root  wheel    160 Oct  3 00:48 standalone
Glenns-iMac:usr trav$

 Interesting ... what about the directories in /usr/local?

 -spc



123