grpc-lua
grpc-lua copied to clipboard
can not build success
follow your build step can not build success!
error log:
Unable to load conanfile in /Users//.conan/data/Protobuf/3.4.1/jinq0123/testing/export/conanfile.py
File "/Users//.conan/data/Protobuf/3.4.1/jinq0123/testing/export/conanfile.py", line 1, in
Thanks. Fixed in Protobuf/3.4.1@jinq0123/testing for Conan >= 0.29
@jinq0123 build error again!
ERROR: lua-cpp/5.3.4@jinq0123/testing: Error in build() method, line 31 cmake.configure(source_dir=self.__name) ConanException: Error 32512 while executing cd '/Users//.conan/data/lua-cpp/5.3.4/jinq0123/testing/build/3cfade032d90e40671f831047a4b021865f8396f' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="ON" -DCMAKE_INSTALL_PREFIX="/Users//.conan/data/lua-cpp/5.3.4/jinq0123/testing/package/3cfade032d90e40671f831047a4b021865f8396f" -Wno-dev 'lua-5.3.4'
Try
cd '/Users//.conan/data/lua-cpp/5.3.4/jinq0123/testing/build/3cfade032d90e40671f831047a4b021865f8396f'
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="ON" -DCMAKE_INSTALL_PREFIX="/Users//.conan/data/lua-cpp/5.3.4/jinq0123/testing/package/3cfade032d90e40671f831047a4b021865f8396f" -Wno-dev 'lua-5.3.4'
to find out why error.
@jinq0123 the reason of this error is cmake not installed but have other error
ERROR: gRPC/1.6.6@jinq0123/testing: Error in build() method, line 91 cmake = CMake(self.settings) ConanException: First argument of CMake() has to be ConanFile. Use CMake(self)
after i change conanfile.py 91 cmake = CMake(self.settings) to cmake = CMake(self), the error is
ERROR: gRPC/1.6.6@jinq0123/testing: Error in build() method, line 93 self.run("cmake --build . --target install {}".format(cmake.build_config)) ConanException: Error 512 while executing cmake --build . --target install
also my Computer is mac book high sierra 10.13.2,Conan version 0.30.3
can you provide a WeChat NO? or pls add my WeChat (linking12), thanks
gRPC/1.6.6@jinq0123/testing is fixed for Conan >= 0.29. Please check why executing cmake failed.
@jinq0123 ok grpc is pass!
but there is many error to build grpc_cb_core
1.grpc_cb_core/0.1/jinq0123/testing/build/baaa3ee8850a76d054ef451cbcf8cd6dcf1d48c3/src/common/impl/noncopyable.h:22:7: error: unknown type name 'constexpr' constexpr noncopyable() = default;
2.grpc_cb_core/0.1/jinq0123/testing/build/baaa3ee8850a76d054ef451cbcf8cd6dcf1d48c3/src/common/impl/noncopyable.h:22:17: error: constructor cannot have a return type constexpr noncopyable() = default; 3.grpc_cb_core/0.1/jinq0123/testing/build/baaa3ee8850a76d054ef451cbcf8cd6dcf1d48c3/src/common/impl/call_op_data.h:73:3: error: constructor for 'grpc_cb_core::CodRecvInitMd' must explicitly initialize the base class 'grpc_cb_core::noncopyable' which does not have a default constructor CodRecvInitMd() { 4.grpc_cb_core/0.1/jinq0123/testing/build/baaa3ee8850a76d054ef451cbcf8cd6dcf1d48c3/src/common/impl/call_op_data.h:109:3: error: constructor for 'grpc_cb_core::CodClientRecvStatus' must explicitly initialize the base class 'grpc_cb_core::noncopyable' which does not have a default constructor
Added "-std=c++11" in CMakeList. Hope that will work.

@jinq0123 what happen?
Fixed "TimePoint" error and "GRPC_MUST_USE_RESULT" warning in grpc_cb_core.
@jinq0123 again?
Fixed another TimePoint error in grpc_cb_core. Please try again.
@jinq0123 Is mac os can not build?
Only tested with VS2015.
@jinq0123 Grpc-lua is a good idea, I think it can support https://github.com/Kong/kong/issues/413, Can you provide a linux version?
Fixed more including in grpc_cb_core.

@jinq0123
Fixed "non-const lvalue reference cannot bind to a temporary" in grpc_cb_core.
Sorry,I give up! There is too many error in Linux.
Thanks
Need more error details.
Hello, I tried building with conan 0.30.3 (you should add the conan version to your README, your build steps do not work with conan latest release) , everything was going smooth until.... :(
/home/vagrant/.conan/data/gRPC/1.6.6/jinq0123/testing/build/ad701420a6b69fc7eb4ccfb0abc99cbd8bdb80fa/grpc-1.6.6/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c:22:18: fatal error: ares.h: No such file or directory
compilation terminated.
CMakeFiles/grpc.dir/build.make:5606: recipe for target 'CMakeFiles/grpc.dir/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c.o' failed
make[2]: *** [CMakeFiles/grpc.dir/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c.o] Error 1
CMakeFiles/Makefile2:307: recipe for target 'CMakeFiles/grpc.dir/all' failed
make[1]: *** [CMakeFiles/grpc.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
gRPC/1.6.6@jinq0123/testing:
gRPC/1.6.6@jinq0123/testing: ERROR: Package 'ad701420a6b69fc7eb4ccfb0abc99cbd8bdb80fa' build failed
gRPC/1.6.6@jinq0123/testing: WARN: Build folder /home/vagrant/.conan/data/gRPC/1.6.6/jinq0123/testing/build/ad701420a6b69fc7eb4ccfb0abc99cbd8bdb80fa
ERROR: gRPC/1.6.6@jinq0123/testing: Error in build() method, line 93
self.run("cmake --build . --target install {}".format(cmake.build_config))
ConanException: Error 512 while executing cmake --build . --target install
Upgraded to conan 1.2.1.
Please update conan and try again.
After cleaning .conan/data from previous grpc-lua builds it was able to create the libgrpc_lua.so. It only failed to run the tests
grpc-lua/0.1@user/channel: os=Linux compiler=gcc build_type=Release arch=x86_64
grpc-lua/0.1@user/channel: Package 'f9e48d5cccf5230cab6b0cb3e3dab2df3707083a' built
grpc-lua/0.1@user/channel: Build folder /home/vagrant/.conan/data/grpc-lua/0.1/user/channel/build/f9e48d5cccf5230cab6b0cb3e3dab2df3707083a
grpc-lua/0.1@user/channel: Generated conaninfo.txt
grpc-lua/0.1@user/channel: Generated conanbuildinfo.txt
grpc-lua/0.1@user/channel: Generating the package
grpc-lua/0.1@user/channel: Package folder /home/vagrant/.conan/data/grpc-lua/0.1/user/channel/package/f9e48d5cccf5230cab6b0cb3e3dab2df3707083a
grpc-lua/0.1@user/channel: Calling package()
grpc-lua/0.1@user/channel package(): Copied 1 '.so' files: libgrpc_lua.so
grpc-lua/0.1@user/channel: Package 'f9e48d5cccf5230cab6b0cb3e3dab2df3707083a' created
grpc-lua/0.1@user/channel (test package): Generator cmake created conanbuildinfo.cmake
grpc-lua/0.1@user/channel (test package): Generator txt created conanbuildinfo.txt
grpc-lua/0.1@user/channel (test package): Generated conaninfo.txt
grpc-lua/0.1@user/channel (test package): Running build()
ERROR: PROJECT: Error in build() method, line 11
cmake.configure(source_dir=self.conanfile_directory, build_dir="./")
AttributeError: 'GrpcluaTestConan' object has no attribute 'conanfile_directory'
When trying to execute the built .so file I got the following error.
./grpc_lua.so: undefined symbol: ares_free_data
vagrant@host:~/e/grpc$ lua main.lua
lua: error loading module 'grpc_lua.grpc_lua' from file './grpc_lua.so':
./grpc_lua.so: undefined symbol: ares_free_data
stack traceback:
[C]: in ?
[C]: in function 'require'
main.lua:2: in main chunk
[C]: in ?
vagrant@host:~/e/grpc$
It seems that you are using the old codes. Please git pull.
Ok, so with the latest version, running the conan_install.sh result in this:
Scanning dependencies of target luapbintf
[ 20%] Building CXX object CMakeFiles/luapbintf.dir/LuaPbIntf.cpp.o
[ 40%] Building CXX object CMakeFiles/luapbintf.dir/detail/MsgToTbl.cpp.o
[ 60%] Building CXX object CMakeFiles/luapbintf.dir/detail/MessageSetter.cpp.o
[ 80%] Building CXX object CMakeFiles/luapbintf.dir/detail/LuaPbIntfImpl.cpp.o
[100%] Linking CXX shared library lib/libluapbintf.so
/usr/bin/ld: /home/vagrant/.conan/data/Protobuf/3.5.1/inexorgame/stable/package/4b16d2e2d109c174ac2d807e702789931afd259e/lib/libprotobufd.a(message_lite.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/vagrant/.conan/data/Protobuf/3.5.1/inexorgame/stable/package/4b16d2e2d109c174ac2d807e702789931afd259e/lib/libprotobufd.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/luapbintf.dir/build.make:172: recipe for target 'lib/libluapbintf.so' failed
make[2]: *** [lib/libluapbintf.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/luapbintf.dir/all' failed
make[1]: *** [CMakeFiles/luapbintf.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
luapbintf/0.1@jinq0123/testing:
luapbintf/0.1@jinq0123/testing: ERROR: Package 'e4199d21f6655720dfecf85700690432fab84eaf' build failed
luapbintf/0.1@jinq0123/testing: WARN: Build folder /home/vagrant/.conan/data/luapbintf/0.1/jinq0123/testing/build/e4199d21f6655720dfecf85700690432fab84eaf
ERROR: luapbintf/0.1@jinq0123/testing: Error in build() method, line 21
self.run("cmake --build . %s" % cmake.build_config)
ConanException: Error 512 while executing cmake --build .
I have reported this to: https://github.com/bincrafters/community/issues/226#issuecomment-380566501
You can fix libprotobufd.a locally.
- git clone https://github.com/bincrafters/conan-protobuf.git
- cd conan-protobuf/
- patch conan-protobuf/conanfile.py, then create local
protobuf/3.5.1@bincrafters/stable
def build(self):
cmake = CMake(self)
cmake.definitions["protobuf_BUILD_TESTS"] = self.options.build_tests
cmake.definitions["protobuf_BUILD_PROTOC_BINARIES"] = self.options.build_binaries
cmake.definitions["protobuf_MSVC_STATIC_RUNTIME"] = self.options.static_rt
cmake.definitions["protobuf_WITH_ZLIB"] = self.options.with_zlib
+ cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = "ON"
conan create . bincrafters/stable
Please git pull grpc-lua. Then run grpc-lua/example/connan_install.sh, ignoring
protobuf/3.5.1@bincrafters/stable: ERROR: Current conanfile is newer than bincrafters's one. Run 'conan remove protobuf/3.5.1@bincrafters/stable' and run install again to replace it.
protobuf/3.5.1@bincrafters/stable is fixed. Please reinstall.
Ok, so after cleaning the ~/.conan/data folder I had the following error:
Attch:
CMakeOutput.log CMakeError.log
Logs
gRPC/1.8.3@inexorgame/stable: Calling build()
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: Compiler GCC>=5, checking major version 5
-- Conan: Checking correct version: 5
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: C++ stdlib: libstdc++
-- Found ZLIB: /home/vagrant/.conan/data/zlib/1.2.11/conan/stable/package/15c6f8a55cbf8b39b86ca055629a91be1b2d3cf5/lib/libz.a (found version "1.2.11")
-- Looking for res_servicename in resolv
-- Looking for res_servicename in resolv - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for gethostbyname in socket
-- Looking for gethostbyname in socket - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - found
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - found
-- Looking for include file arpa/nameser_compat.h
-- Looking for include file arpa/nameser_compat.h - found
-- Looking for include file arpa/nameser.h
-- Looking for include file arpa/nameser.h - found
-- Looking for include file assert.h
-- Looking for include file assert.h - found
-- Looking for include file errno.h
-- Looking for include file errno.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file netdb.h
-- Looking for include file netdb.h - found
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - found
-- Looking for include file netinet/tcp.h
-- Looking for include file netinet/tcp.h - found
-- Looking for include file net/if.h
-- Looking for include file net/if.h - found
-- Looking for include file signal.h
-- Looking for include file signal.h - found
-- Looking for include file socket.h
-- Looking for include file socket.h - not found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file stropts.h
-- Looking for include file stropts.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/select.h
-- Looking for include file sys/select.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/uio.h
-- Looking for include file sys/uio.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include files winsock2.h, windows.h
-- Looking for include files winsock2.h, windows.h - not found
-- Looking for 3 include files winsock2.h, ..., windows.h
-- Looking for 3 include files winsock2.h, ..., windows.h - not found
-- Looking for include files winsock.h, windows.h
-- Looking for include files winsock.h, windows.h - not found
-- Looking for include file windows.h
-- Looking for include file windows.h - not found
-- Performing Test HAVE_SOCKLEN_T
-- Performing Test HAVE_SOCKLEN_T - Success
-- Performing Test HAVE_TYPE_SOCKET
-- Performing Test HAVE_TYPE_SOCKET - Failed
-- Performing Test HAVE_BOOL_T
-- Performing Test HAVE_BOOL_T - Success
-- Performing Test HAVE_SSIZE_T
-- Performing Test HAVE_SSIZE_T - Success
-- Performing Test HAVE_LONGLONG
-- Performing Test HAVE_LONGLONG - Success
-- Performing Test HAVE_SIG_ATOMIC_T
-- Performing Test HAVE_SIG_ATOMIC_T - Success
-- Performing Test HAVE_STRUCT_ADDRINFO
-- Performing Test HAVE_STRUCT_ADDRINFO - Success
-- Performing Test HAVE_STRUCT_IN6_ADDR
-- Performing Test HAVE_STRUCT_IN6_ADDR - Success
-- Performing Test HAVE_STRUCT_SOCKADDR_IN6
-- Performing Test HAVE_STRUCT_SOCKADDR_IN6 - Success
-- Performing Test HAVE_STRUCT_SOCKADDR_STORAGE
-- Performing Test HAVE_STRUCT_SOCKADDR_STORAGE - Success
-- Performing Test HAVE_STRUCT_TIMEVAL
-- Performing Test HAVE_STRUCT_TIMEVAL - Success
-- Looking for AF_INET6
-- Looking for AF_INET6 - found
-- Looking for O_NONBLOCK
-- Looking for O_NONBLOCK - found
-- Looking for FIONBIO
-- Looking for FIONBIO - found
-- Looking for SIOCGIFADDR
-- Looking for SIOCGIFADDR - found
-- Looking for MSG_NOSIGNAL
-- Looking for MSG_NOSIGNAL - found
-- Looking for PF_INET6
-- Looking for PF_INET6 - found
-- Looking for SO_NONBLOCK
-- Looking for SO_NONBLOCK - not found
-- Looking for CLOCK_MONOTONIC
-- Looking for CLOCK_MONOTONIC - found
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - Success
-- Performing Test HAVE_LL
-- Performing Test HAVE_LL - Success
-- Looking for bitncmp
-- Looking for bitncmp - not found
-- Looking for closesocket
-- Looking for closesocket - not found
-- Looking for CloseSocket
-- Looking for CloseSocket - not found
-- Looking for connect
-- Looking for connect - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for freeaddrinfo
-- Looking for freeaddrinfo - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for getenv
-- Looking for getenv - found
-- Looking for gethostbyaddr
-- Looking for gethostbyaddr - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for getservbyport_r
-- Looking for getservbyport_r - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for if_indextoname
-- Looking for if_indextoname - found
-- Looking for inet_net_pton
-- Looking for inet_net_pton - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Looking for ioctl
-- Looking for ioctl - found
-- Looking for ioctlsocket
-- Looking for ioctlsocket - not found
-- Looking for IoctlSocket
-- Looking for IoctlSocket - not found
-- Looking for recv
-- Looking for recv - found
-- Looking for recvfrom
-- Looking for recvfrom - found
-- Looking for send
-- Looking for send - found
-- Looking for setsockopt
-- Looking for setsockopt - found
-- Looking for socket
-- Looking for socket - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strcmpi
-- Looking for strcmpi - not found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for stricmp
-- Looking for stricmp - not found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strncmpi
-- Looking for strncmpi - not found
-- Looking for strnicmp
-- Looking for strnicmp - not found
-- Looking for writev
-- Looking for writev - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find Protobuf (missing: PROTOBUF_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.5/Modules/FindProtobuf.cmake:308 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:190 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/build/af7a47f3daba91dcbceb58fb2a56af82899fb373/CMakeFiles/CMakeOutput.log".
See also "/home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/build/af7a47f3daba91dcbceb58fb2a56af82899fb373/CMakeFiles/CMakeError.log".
gRPC/1.8.3@inexorgame/stable:
gRPC/1.8.3@inexorgame/stable: ERROR: Package 'af7a47f3daba91dcbceb58fb2a56af82899fb373' build failed
gRPC/1.8.3@inexorgame/stable: WARN: Build folder /home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/build/af7a47f3daba91dcbceb58fb2a56af82899fb373
ERROR: gRPC/1.8.3@inexorgame/stable: Error in build() method, line 81
self.run('cmake {0}/{1} {2} {3}'.format(self.source_folder, self.folder, cmake.command_line, ' '.join(args)))
ConanException: Error 256 while executing cmake /home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/build/af7a47f3daba91dcbceb58fb2a56af82899fb373/grpc-1.8.3 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="5" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/package/af7a47f3daba91dcbceb58fb2a56af82899fb373" -Wno-dev -DgRPC_INSTALL=ON -DgRPC_CARES_PROVIDER="module" -DCMAKE_INSTALL_PREFIX="/home/vagrant/.conan/data/gRPC/1.8.3/inexorgame/stable/build/af7a47f3daba91dcbceb58fb2a56af82899fb373/install"
Please upgrade CMake.
I'm using CMake 3.5.1-1ubuntu2 it says it's the latest version
Fixed in CMake 3.8.0:
SHA-1: d9190f3308fb67f01f061038a06006af73a77da1
* FindProtobuf: Search for debug library named with `d` suffix
You can fix Modules/FindProtobuf.cmake:
find_library(${name}_LIBRARY_DEBUG
- NAMES ${filename}
+ NAMES ${filename}d ${filename}
PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
mark_as_advanced(${name}_LIBRARY_DEBUG)
CMake Latest Release (3.11.1)
Ok, so I managed to build it (yay) but lua-cpp does not run the file I'm importing it:
-- main.lua
print("requiring lib")
local grpc = require("grpc_lua.grpc_lua")
print("loaded lib")
I copied both libs grpc_lua.so lua-cpp.so to /usr/local/lib/lua/5.3/ but I keep getting this error
vagrant@gcd-devenv:~/e/elsd$ ./lua-cpp main.lua
requiring lib
./lua-cpp: main.lua:3: module 'grpc_lua.grpc_lua' not found:
no field package.preload['grpc_lua.grpc_lua']
no file '/usr/local/share/lua/5.3/grpc_lua/grpc_lua.lua'
no file '/usr/local/share/lua/5.3/grpc_lua/grpc_lua/init.lua'
no file '/usr/local/lib/lua/5.3/grpc_lua/grpc_lua.lua'
no file '/usr/local/lib/lua/5.3/grpc_lua/grpc_lua/init.lua'
no file './grpc_lua/grpc_lua.lua'
no file './grpc_lua/grpc_lua/init.lua'
no file '/usr/local/lib/lua/5.3/grpc_lua/grpc_lua.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './grpc_lua/grpc_lua.so'
no module 'grpc_lua.grpc_lua' in file '/usr/local/lib/lua/5.3/grpc_lua.so'
stack traceback:
[C]: in function 'require'
main.lua:3: in main chunk
[C]: in ?
when I require only grpc_lua
-- main.lua
print("requiring lib")
local grpc = require("grpc_lua")
print("loaded lib")
I get this error:
vagrant@gcd-devenv:~/e/elsd$ ./lua-cpp main.lua
requiring lib
./lua-cpp: error loading module 'grpc_lua' from file '/usr/local/lib/lua/5.3/grpc_lua.so':
/usr/local/lib/lua/5.3/grpc_lua.so: undefined symbol: luaopen_grpc_lua
stack traceback:
[C]: in ?
[C]: in function 'require'
main.lua:3: in main chunk
[C]: in ?
I tried rebuild everything from scratch and I just noticed this error while building luapbintf
Scanning dependencies of target luapbintf
[ 20%] Building CXX object CMakeFiles/luapbintf.dir/LuaPbIntf.cpp.o
[ 40%] Building CXX object CMakeFiles/luapbintf.dir/detail/LuaPbIntfImpl.cpp.o
[ 60%] Building CXX object CMakeFiles/luapbintf.dir/detail/MessageSetter.cpp.o
[ 80%] Building CXX object CMakeFiles/luapbintf.dir/detail/MsgToTbl.cpp.o
[100%] Linking CXX shared library lib/libluapbintf.so
/usr/bin/ld: /home/vagrant/.conan/data/protobuf/3.5.1/bincrafters/stable/package/fefa24a9a9aee1f944752b7efab2a76efacc33f3/lib/libprotobufd.a(message_lite.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/vagrant/.conan/data/protobuf/3.5.1/bincrafters/stable/package/fefa24a9a9aee1f944752b7efab2a76efacc33f3/lib/libprotobufd.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/luapbintf.dir/build.make:128: recipe for target 'lib/libluapbintf.so' failed
make[2]: *** [lib/libluapbintf.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/luapbintf.dir/all' failed
make[1]: *** [CMakeFiles/luapbintf.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
luapbintf/0.1@jinq0123/testing:
luapbintf/0.1@jinq0123/testing: ERROR: Package '6b39cfddef39c444d49b0db7d780badbd27a8f2c' build failed
luapbintf/0.1@jinq0123/testing: WARN: Build folder /home/vagrant/.conan/data/luapbintf/0.1/jinq0123/testing/build/6b39cfddef39c444d49b0db7d780badbd27a8f2c
ERROR: luapbintf/0.1@jinq0123/testing: Error in build() method, line 21
self.run("cmake --build . %s" % cmake.build_config)
ConanException: Error 512 while executing cmake --build .
This has been fixed: https://github.com/bincrafters/community/issues/226
Please reinstall protobuf/3.5.1@bincrafters/stable:
conan remove protobuf/3.5.1@bincrafters/stable
require("grpc_lua.grpc_lua")
will load grpc-lua\src\lua\grpc_lua\grpc_lua.lua, which will load grpc_lua.so.
Please see examples:
--- Hello world greeter example client.
-- greeter_client.lua
-- Current work dir: grpc-lua/examples/helloworld
package.path = "../../src/lua/?.lua;" .. package.path
local grpc = require("grpc_lua.grpc_lua")
IT WORKED!!! Thank you for your patience and all the explanations