ignacio / LuaNode

Asynchronous I/O for Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

install on osx

weepy opened this issue · comments

hi - I'm doing :

cd build/linux
make

make: *** No rule to make target Release/StackTracePlus/StackTracePlus.precomp', needed by/Users/weepy/devel/bin/luanode'. Stop.

is it possible to install on osx ?

Well, I guess so. I don't have access to a Mac, so I can't test it. Please follow the installation instructions and comment here if you were able to install it.

The issue you have now is that you've cloned the repo without its submodules. You can either delete it and clone it again with:

git clone git://github.com/ignacio/LuaNode.git --recursive
cd LuaNode
git fetch --all

Or try this (without deleting your repo):

git submodule init
git submodule update

ok -- great -- nearly there

Jonah-Foxs-MacBook-Air:build weepy$ cmake --build .
Scanning dependencies of target luanode
[ 5%] Building C object
CMakeFiles/luanode.dir/deps/http-parser/http_parser.c.o
[ 11%] Building CXX object CMakeFiles/luanode.dir/src/blogger.cpp.o
[ 17%] Building CXX object CMakeFiles/luanode.dir/src/LuaNode.cpp.o
/Users/weepy/src/LuaNode/src/LuaNode.cpp:33:3: error: #error "Unsupported
platform"
/Users/weepy/src/LuaNode/src/LuaNode.cpp:512:3: error: #error "unsupported
platform"
/Users/weepy/src/LuaNode/src/LuaNode.cpp: In function int
LuaNode::Load(int, char*):
/Users/weepy/src/LuaNode/src/LuaNode.cpp:492: error: environ was not
declared in this scope
/Users/weepy/src/LuaNode/src/LuaNode.cpp:566: error: Fs has not been
declared
make[2]: *
* [CMakeFiles/luanode.dir/src/LuaNode.cpp.o] Error 1


The issue here is that the platform is not WIN32 or linux --- what's the
best way to get round this ?

Cheers

Jonah

On Sun, Jun 12, 2011 at 10:32 PM, ignacio <
reply@reply.github.com>wrote:

Well, I guess so. I don't have access to a Mac, so I can't test it. Please
follow the installation instructions and comment here if you were able to
install it.

The issue you have now is that you've cloned the repo without its
submodules. You can either delete it and clone it again with:

git clone git://github.com/ignacio/LuaNode.git --recursive
cd LuaNode
git fetch --all

Or try this (without deleting your repo):

git submodule init
git submodule update

Reply to this email directly or view it on GitHub:
#3 (comment)

Please comment out lines 30, 32 and 33 of LuaNode.cpp.

Change line 512 of the same file for:
lua_pushinteger(L, 0);

That should fix it for now.

close but no cigar :-)

Jonah-Foxs-MacBook-Air:build weepy$ cmake --build .
[ 5%] Building CXX object CMakeFiles/luanode.dir/src/LuaNode.cpp.o
/Users/weepy/src/LuaNode/src/LuaNode.cpp: In function int
LuaNode::Load(int, char*):
/Users/weepy/src/LuaNode/src/LuaNode.cpp:492: error: environ was not
declared in this scope
/Users/weepy/src/LuaNode/src/LuaNode.cpp:566: error: Fs has not been
declared
make[2]: *
* [CMakeFiles/luanode.dir/src/LuaNode.cpp.o] Error 1
make[1]: *** [CMakeFiles/luanode.dir/all] Error 2
make: *** [all] Error 2

On Sun, Jun 12, 2011 at 11:25 PM, ignacio <
reply@reply.github.com>wrote:

Please comment out lines 30, 32 and 33 of LuaNode.cpp.

Change line 512 of the same file for:
lua_pushinteger(L, 0);

That should fix it for now.

Reply to this email directly or view it on GitHub:
#3 (comment)

Please add this:

# ifdef __APPLE__
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
# else
extern char **environ;
# endif

somewhere around line 27.

Also, make sure that this line:
#include "luanode_file_linux.h"

Is uncommented. If it is, and "error: Fs has not been declared" still shows up, comment line 566.

it wasn't commented but it wasn't going to be reached because it was inside a WIN32 ifdef. So I added

# ifdef __APPLE__
# include 
# define environ (*_NSGetEnviron())
#include "luanode_file_linux.h"
# else
extern char **environ;
# endif

which is working much better ... next error :

/Users/weepy/src/LuaNode/src/luanode_net.cpp: In member function ‘int LuaNode::Net::Socket::SetOption(lua_State*)’:
/Users/weepy/src/LuaNode/src/luanode_net.cpp:255: error: ‘fd’ was not declared in this scope

i changed the fd to m_socket->native() on line 255 (no idea if this is right -- but it now compiles)

now a shed load of linker issues :D hrm some lovely architecture ones too

ld: warning: in /System/Library/Frameworks//lua.framework/lua, missing required architecture x86_64 in file
Undefined symbols:
  "_luaL_unref", referenced from:
      LuaNode::Loop(lua_State*)      in LuaNode.cpp.o
      LuaNode::Crypto::Socket::HandleShutdown(int, boost::system::error_code const&)in luanode_crypto.cpp.o

You're right. My mistake. Told you to comment line 30. Should have changed it to "#else"

Your fix on line 255 of luanode_net.cpp is correct. Will update the source soon.

Regarding linker issues... I'll ask a colleague tomorrow at work if I can ssh to his mac and try a few things there. Could you paste the linker issues in a gist and post the link here?

Thanks in advance

hey - thanks that would be great --- fingers crossed this project is going to be really useful for me :-)

here's the gist :

https://raw.github.com/gist/1022075/47120c2075bf557a1b2298ce1c0caecf4f0f7a2b/gistfile1.txt

One last thing. Which os version do you have? Is it 32 or 64 bits? What do you use to compile? Etc. Any info about your system would help me.

I'm 64bit (Snow Leopard)

to compile i was using the cmake similar to your example.

i had boost, lua etc installed already. Although -- for some reason Lua
wasn't being picked up so I compiled another version at:
~/devel/packages/Lua5.1 --- which is where it was looking.

Let me know if I've missed anything - and I can fill you in.

On Mon, Jun 13, 2011 at 12:14 AM, ignacio <
reply@reply.github.com>wrote:

One last thing. Which os version do you have? Is it 32 or 64 bits? What do
you use to compile? Etc. Any info about your system would help me.

Reply to this email directly or view it on GitHub:
#3 (comment)

i think the problem is that my lua for some reason seems to be 32 bit - i
thought it was 64 - but i just check and it says 32

On Mon, Jun 13, 2011 at 8:38 AM, Jonah Fox jonahfox@gmail.com wrote:

I'm 64bit (Snow Leopard)

to compile i was using the cmake similar to your example.

i had boost, lua etc installed already. Although -- for some reason Lua
wasn't being picked up so I compiled another version at:
~/devel/packages/Lua5.1 --- which is where it was looking.

Let me know if I've missed anything - and I can fill you in.

On Mon, Jun 13, 2011 at 12:14 AM, ignacio <
reply@reply.github.com>wrote:

One last thing. Which os version do you have? Is it 32 or 64 bits? What do
you use to compile? Etc. Any info about your system would help me.

Reply to this email directly or view it on GitHub:
#3 (comment)

ok - sorted it out - i think there was some weirdness with the way my
System/Library/Frameworks was set up - there was some old version of
something there. I've symlinked it to my local liblua.a in /usr/local/lib/
instead and it builds ok.
Running luanode gives me LuaNode 0.0.1pre

cheers!

J

On Mon, Jun 13, 2011 at 8:49 AM, Jonah Fox jonahfox@gmail.com wrote:

i think the problem is that my lua for some reason seems to be 32 bit - i
thought it was 64 - but i just check and it says 32

On Mon, Jun 13, 2011 at 8:38 AM, Jonah Fox jonahfox@gmail.com wrote:

I'm 64bit (Snow Leopard)

to compile i was using the cmake similar to your example.

i had boost, lua etc installed already. Although -- for some reason Lua
wasn't being picked up so I compiled another version at:
~/devel/packages/Lua5.1 --- which is where it was looking.

Let me know if I've missed anything - and I can fill you in.

On Mon, Jun 13, 2011 at 12:14 AM, ignacio <
reply@reply.github.com

wrote:

One last thing. Which os version do you have? Is it 32 or 64 bits? What
do you use to compile? Etc. Any info about your system would help me.

Reply to this email directly or view it on GitHub:
#3 (comment)

Good to hear that!