Document how to get started using LibuvSharp #3

Open
robertmircea opened this Issue Dec 31, 2013 · 17 comments

Comments

Projects
None yet
3 participants
@robertmircea

Please write a short documentation/readme on how to get started using LibuvSharp including:

  • cloning from Github (considering libuv is linked as a git submodule - git clone --recursive
  • compiling the project from source code (including how to obtain libuv.so). Are there any differences between Mac/Linux and Windows compilation?
@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner

Should I create a tutorial for git in a separate subdirectory or a file?

Owner

txdv commented Jan 1, 2014

Should I create a tutorial for git in a separate subdirectory or a file?

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner

Truth to be told, I compiled uv on windows only once a year ago. When I come home I will look into it again.

Now there is a makefile I use to generate 3 enums containing types of uv. So yeah, that won't work on windows.

Owner

txdv commented Jan 1, 2014

Truth to be told, I compiled uv on windows only once a year ago. When I come home I will look into it again.

Now there is a makefile I use to generate 3 enums containing types of uv. So yeah, that won't work on windows.

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 1, 2014

I've tried compiling on mac using make but it says cannot make target libuv.so and stops.

Libuv compiled separately successfully.

I've tried compiling on mac using make but it says cannot make target libuv.so and stops.

Libuv compiled separately successfully.

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner

Pasting some kind of output would be helpful

Owner

txdv commented Jan 1, 2014

Pasting some kind of output would be helpful

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 1, 2014

Cloned the project with the following command:

git clone --recursive https://github.com/txdv/LibuvSharp.git

tried to make it with:

rm@mimac:~/Dev/LibuvSharp(master⚡) » make
make -C libuv libuv.so
make[1]: *** No rule to make target `libuv.so'. Stop.
make: *** [libuv.so] Error 2

Cloned the project with the following command:

git clone --recursive https://github.com/txdv/LibuvSharp.git

tried to make it with:

rm@mimac:~/Dev/LibuvSharp(master⚡) » make
make -C libuv libuv.so
make[1]: *** No rule to make target `libuv.so'. Stop.
make: *** [libuv.so] Error 2

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner

I think it clones into master while you want to have a specific version.
try
git submodule update --init

Owner

txdv commented Jan 1, 2014

I think it clones into master while you want to have a specific version.
try
git submodule update --init

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 1, 2014

--recursive does the same as git submodule update in newer git versions.
Anyway, I've erased the repo and cloned it without --recursive and then I ran git submodule update --init. Running make and the result is the same.

If you clone it fresh from Github on your computer compilation succeeds?

--recursive does the same as git submodule update in newer git versions.
Anyway, I've erased the repo and cloned it without --recursive and then I ran git submodule update --init. Running make and the result is the same.

If you clone it fresh from Github on your computer compilation succeeds?

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner
git clone https://github.com/txdv/LibuvSharp.git
cd LibuvSharp
git submodule update --init

compiles like a charm.

Ubuntu LTS 12.0.4

Owner

txdv commented Jan 1, 2014

git clone https://github.com/txdv/LibuvSharp.git
cd LibuvSharp
git submodule update --init

compiles like a charm.

Ubuntu LTS 12.0.4

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 1, 2014

I fired up a VM on my mac with Ubuntu and indeed it works on Linux. So only on Mac does not compile.

I fired up a VM on my mac with Ubuntu and indeed it works on Linux. So only on Mac does not compile.

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 1, 2014

Owner

I use GNU Make 3.81. What version does macosx return?
I don't think the makefile will work on windows either... unless you use a cygwin environment.

Owner

txdv commented Jan 1, 2014

I use GNU Make 3.81. What version does macosx return?
I don't think the makefile will work on windows either... unless you use a cygwin environment.

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 2, 2014

make -v                                                                                                
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0
make -v                                                                                                
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0
@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 2, 2014

Owner

O yes...

libuv.so is the wrong lib name on macosx, right?

it is libuv.dylib, so make -C libuv.so won't work at all!

I don't have a mac so i can't really test/adjust the build script...

Owner

txdv commented Jan 2, 2014

O yes...

libuv.so is the wrong lib name on macosx, right?

it is libuv.dylib, so make -C libuv.so won't work at all!

I don't have a mac so i can't really test/adjust the build script...

@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 2, 2014

Owner

If it makes any easier: compile LibuvSharp.dll on Ubuntu, compile libuv.dylib on macosx and use them together.

Owner

txdv commented Jan 2, 2014

If it makes any easier: compile LibuvSharp.dll on Ubuntu, compile libuv.dylib on macosx and use them together.

@robertmircea

This comment has been minimized.

Show comment Hide comment
@robertmircea

robertmircea Jan 3, 2014

I've compiled the Examples on linux and now I am trying to run them from bin/Debug but I receive the following message. Any idea on how to approach this?

➜  Debug git:(master) ✗ ./TcpAsync.exe 

Unhandled Exception:
System.DllNotFoundException: uv
  at (wrapper managed-to-native) LibuvSharp.Loop:uv_default_loop ()
  at LibuvSharp.Loop.get_Default () [0x00000] in <filename unknown>:0 
  at Test.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: uv
  at (wrapper managed-to-native) LibuvSharp.Loop:uv_default_loop ()
  at LibuvSharp.Loop.get_Default () [0x00000] in <filename unknown>:0 
  at Test.MainClass.Main (System.String[] args) [0x00000] in <filename unknown

I've compiled the Examples on linux and now I am trying to run them from bin/Debug but I receive the following message. Any idea on how to approach this?

➜  Debug git:(master) ✗ ./TcpAsync.exe 

Unhandled Exception:
System.DllNotFoundException: uv
  at (wrapper managed-to-native) LibuvSharp.Loop:uv_default_loop ()
  at LibuvSharp.Loop.get_Default () [0x00000] in <filename unknown>:0 
  at Test.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: uv
  at (wrapper managed-to-native) LibuvSharp.Loop:uv_default_loop ()
  at LibuvSharp.Loop.get_Default () [0x00000] in <filename unknown>:0 
  at Test.MainClass.Main (System.String[] args) [0x00000] in <filename unknown
@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Jan 3, 2014

Owner

yeah, you need the libuv library in the same directory. This error message is quite obvious. Compile libuv.dylib on macosx(I assume you try to run it on macosx)

Owner

txdv commented Jan 3, 2014

yeah, you need the libuv library in the same directory. This error message is quite obvious. Compile libuv.dylib on macosx(I assume you try to run it on macosx)

@panesofglass

This comment has been minimized.

Show comment Hide comment
@panesofglass

panesofglass Feb 25, 2014

I'm having the same problem trying to make on Windows using either MSysGit or Powershell:

C:\Users\Ryan\Code\LibuvSharp [master]> make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32
C:\Users\Ryan\Code\LibuvSharp [master]> make
make -C libuv libuv.so
make[1]: Entering directory `C:/Users/Ryan/Code/LibuvSharp/libuv'
make[1]: *** No rule to make target `libuv.so'.  Stop.
make[1]: Leaving directory `C:/Users/Ryan/Code/LibuvSharp/libuv'
make: *** [libuv.so] Error 2

I'm having the same problem trying to make on Windows using either MSysGit or Powershell:

C:\Users\Ryan\Code\LibuvSharp [master]> make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32
C:\Users\Ryan\Code\LibuvSharp [master]> make
make -C libuv libuv.so
make[1]: Entering directory `C:/Users/Ryan/Code/LibuvSharp/libuv'
make[1]: *** No rule to make target `libuv.so'.  Stop.
make[1]: Leaving directory `C:/Users/Ryan/Code/LibuvSharp/libuv'
make: *** [libuv.so] Error 2
@txdv

This comment has been minimized.

Show comment Hide comment
@txdv

txdv Apr 28, 2014

Owner

@panesofglass I will commit the generated code into the so you don't have to run the makefile. I went by the rule to never commit generated code, because everyone can generate it for himself but now I see that it is a stupid idea because my makefile runs only on linux.

The makefile currently creates a linux binary anyway so I don't think it will be useful at all. You have to build uv.dll yourself using the official libuv instructions.

Owner

txdv commented Apr 28, 2014

@panesofglass I will commit the generated code into the so you don't have to run the makefile. I went by the rule to never commit generated code, because everyone can generate it for himself but now I see that it is a stupid idea because my makefile runs only on linux.

The makefile currently creates a linux binary anyway so I don't think it will be useful at all. You have to build uv.dll yourself using the official libuv instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment