Skip to content

Instantly share code, notes, and snippets.

View hnakamur's full-sized avatar

Hiroaki Nakamura hnakamur

View GitHub Profile
@hnakamur
hnakamur / gist:3556557
Created August 31, 2012 17:57
Could NOT find HTTP_PARSER on Scientific Linux 6.3
[hnakamur@naruh lev]$ cmake -DUSE_SYSTEM_LUAJIT=0 -DUSE_SYSTEM_OPENSSL=0 -D USE_SYSTEM_UV=0 -DUSE_SYSTEM_YAJL=0 -DUSE_SYSTEM_ZLIB=0 -DUSE_YAJL=1 -DUSE_ZLIB=1 -DUSE_OPENSSL=1 -DUSE_HTTP_PARSER=1 ~/xming/lev
-- The C compiler identification is GNU 4.4.6
-- The CXX compiler identification is GNU 4.4.6
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
@hnakamur
hnakamur / gist:3556576
Created August 31, 2012 17:59
Error: pointer size mismatch in cross-build. on OSX
sunshine5:lev hnakamur$ cmake -DUSE_SYSTEM_LUAJIT=0 -DUSE_SYSTEM_OPENSSL=0 -D USE_SYSTEM_UV=0 -DUSE_SYSTEM_YAJL=0 -DUSE_SYSTEM_ZLIB=0 -DUSE_YAJL=1 -DUSE_ZLIB=1 -DUSE_OPENSSL=1 -DUSE_HTTP_PARSER=1 ~/xming/lev
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 4.0.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
@hnakamur
hnakamur / gist:3556847
Created August 31, 2012 18:17
two tests failed with lev with http_parser on Scientific Linux 6.3
$ cmake -DUSE_SYSTEM_LUAJIT=0 -DUSE_SYSTEM_OPENSSL=0 -D USE_SYSTEM_UV=0 -DUSE_SYSTEM_YAJL=0 -DUSE_SYSTEM_ZLIB=0 -DUSE_YAJL=1 -DUSE_ZLIB=1 -DUSE_OPENSSL=1 -DUSE_SYSTEM_HTTP_PARSER=0 -DUSE_HTTP_PARSER=1 ~/xming/lev
$ make
$ cd ~/xming/lev/tests
$ /tmp/lev/lev runner.lua
FAIL (test-dgram.lua)
WARNING: forgot to close luv_pipe lhandle=0x41801ce0 handle=0x16d8490
FAIL (test-dgram-multicast.lua)
@hnakamur
hnakamur / gist:3556974
Created August 31, 2012 18:29
"make -C out test" does not run tests on OSX
sunshine5:lev hnakamur$ make -C out test
CC(target) /Users/hnakamur/mysrc/lev/out/Debug/obj.target/http_parser/deps/http-parser/http_parser.o
LIBTOOL-STATIC /Users/hnakamur/mysrc/lev/out/Debug/libhttp_parser.a
CC(target) /Users/hnakamur/mysrc/lev/out/Debug/obj.target/test/deps/http-parser/test.o
LINK(target) /Users/hnakamur/mysrc/lev/out/Debug/test
LINK(target) /Users/hnakamur/mysrc/lev/out/Debug/test: Finished
@hnakamur
hnakamur / gist:3559695
Created August 31, 2012 21:55
test-dgram failed to find module 'dgram' on Scientific Linux 6.3
[hnakamur@naruh lev]$ /tmp/lev/lev tests/test-dgram.lua
/home/hnakamur/xming/lev/src/core/lib/lev.lua:221: /home/hnakamur/xming/lev/src/core/lib/module.lua:190: Failed to find module 'dgram'
no field package.preload['dgram']
Cannot find module /tmp/lib/lev/dgram
Cannot find module /home/hnakamur/xming/lev/tests//modules/dgram
Cannot find module /home/hnakamur/xming/lev/modules/dgram
Cannot find module /home/hnakamur/xming/modules/dgram
Cannot find module /home/hnakamur/modules/dgram
Cannot find module /home/modules/dgram
Cannot find module //modules/dgram
@hnakamur
hnakamur / gist:3560299
Created August 31, 2012 22:40
failed with CC='gcc -m32' on osx
sunshine5:lev hnakamur$ rm -rf *
sunshine5:lev hnakamur$ CC='gcc -m32' cmake -DUSE_SYSTEM_LUAJIT=0 -DUSE_SYSTEM_OPENSSL=0 -D USE_SYSTEM_UV=0 -DUSE_SYSTEM_YAJL=0 -DUSE_SYSTEM_ZLIB=0 -DUSE_YAJL=1 -DUSE_ZLIB=1 -DUSE_OPENSSL=1 -DUSE_SYSTEM_HTTP_PARSER=0 -DUSE_HTTP_PARSER=1 ~/xming/lev
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 4.0.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
@hnakamur
hnakamur / gist:3560381
Created August 31, 2012 22:45
make failed with CMAKE_HOST_SYSTEM_PROCESSOR hack on osx
sunshine5:lev hnakamur$ git diff
diff --git a/src/external/luajit/CMakeLists-LUAJIT.txt b/src/external/luajit/CMa
index 9b0ffb0..84f446c 100644
--- a/src/external/luajit/CMakeLists-LUAJIT.txt
+++ b/src/external/luajit/CMakeLists-LUAJIT.txt
@@ -22,6 +22,9 @@ endif()
# CPU detection
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL x86_64)
add_definitions(-DLUAJIT_TARGET=LUAJIT_ARCH_X64)
+# hack because on OSX CMAKE_HOST_SYSTEM_PROCESSOR is always i386
@hnakamur
hnakamur / gist:3562009
Created September 1, 2012 00:47
unrecognized option `-malign-double' on MinGW
$ make
[ 1%] Performing download step (verify and extract) for 'LUAJIT'
-- verifying file...
file='C:/MinGW/msys/1.0/home/hnakamur/xming/lev/tarballs/LuaJIT-2.0.0-beta10.tar.gz'
-- verifying file... done
-- extracting...
src='C:/MinGW/msys/1.0/home/hnakamur/xming/lev/tarballs/LuaJIT-2.0.0-beta10.tar.gz'
dst='C:/Users/hnakamur/AppData/Local/Temp/lev/LUAJIT-prefix/src/LUAJIT'
-- extracting... [tar xfz]
-- extracting... [analysis]
@hnakamur
hnakamur / gist:3566616
Created September 1, 2012 07:42
lev build failed with Visual Studio C++ 2010 Express and cmake
------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
Checking Build System
CMake does not need to re-run because C:/tmp/lev/CMakeFiles/generate.stamp is up-to-date.
------ Build started: Project: LUAJIT, Configuration: Debug Win32 ------
Building Custom Rule C:/MinGW/msys/1.0/home/hnakamur/xming/lev/CMakeLists.txt
CMake does not need to re-run because C:\tmp\lev\CMakeFiles\generate.stamp is up-to-date.
Creating directories for 'LUAJIT'
Performing download step (verify and extract) for 'LUAJIT'
-- verifying file...
file='C:/MinGW/msys/1.0/home/hnakamur/xming/lev/tarballs/LuaJIT-2.0.0-beta10.tar.gz'
@hnakamur
hnakamur / gist:3567008
Created September 1, 2012 08:12
luvit build failed with Makefile on MinGW Windows 7 Home 32bit
hnakamur@sunshine4pc /c/src/luvit
$ make
touch -c deps/luajit/src/*.h
make -C deps/luajit
make[1]: Entering directory `/c/src/luvit/deps/luajit'
==== Building LuaJIT 2.0.0-beta10 ====
make -C src
make[2]: Entering directory `/c/src/luvit/deps/luajit/src'
HOSTCC host/minilua.o
gcc -O2 -fomit-frame-pointer -Wall -DLUAJIT_ENABLE_LUA52COMPAT -I. -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -c -o host/minilua.o host/minilua.c