Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting error while running ./build_linux.sh #11

Open
raviguru123 opened this issue Jun 21, 2018 · 7 comments
Open

getting error while running ./build_linux.sh #11

raviguru123 opened this issue Jun 21, 2018 · 7 comments

Comments

@raviguru123
Copy link

src/as_lua.c:2:73: fatal error: lua.h: No such file or directory
compilation terminated.
gcc: error: ./src/as_lua.o: No such file or directory

@aerospikerobertmarks
Copy link

Hi @raviguru123 , That error message means that the compiler is not finding a required Lua development header. That could be due to it not existing on the system, or it not being in the compiler's include path.

To install those headers if they are missing, it is usually possible to install a Lua development package with your package manager.

@shikhil-gupta
Copy link

iblmdvshikhilg:client-lua ******$ ./build_osx.sh
src/as_lua.c:343:2: warning: implicit declaration of function 'luaL_register' is invalid in C99 [-Wimplicit-function-declaration]
luaL_register(L, "as_lua", as_client);
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_FIPS_mode_set", referenced from:
_as_tls_cleanup in libaerospike.a(as_tls.o)
"_ev_async_send", referenced from:
_as_event_execute in libaerospike.a(as_event_ev.o)
"_ev_async_start", referenced from:
_as_event_create_loop in libaerospike.a(as_event_ev.o)
_as_event_register_external_loop in libaerospike.a(as_event_ev.o)
"_ev_async_stop", referenced from:
_as_ev_wakeup in libaerospike.a(as_event_ev.o)
"_ev_break", referenced from:
_as_ev_wakeup in libaerospike.a(as_event_ev.o)
"_ev_io_start", referenced from:
_as_event_command_write_start in libaerospike.a(as_event_ev.o)
_as_ev_write in libaerospike.a(as_event_ev.o)
_as_ev_tls_connect in libaerospike.a(as_event_ev.o)
_as_event_connect in libaerospike.a(as_event_ev.o)
_as_ev_callback_common in libaerospike.a(as_event_ev.o)
_as_ev_read in libaerospike.a(as_event_ev.o)
"_ev_io_stop", referenced from:
_as_event_socket_timeout in libaerospike.a(as_event.o)
_as_event_total_timeout in libaerospike.a(as_event.o)
_as_event_query_complete in libaerospike.a(as_event.o)
_as_event_batch_complete in libaerospike.a(as_event.o)
_as_event_parse_error in libaerospike.a(as_event.o)
_as_event_response_error in libaerospike.a(as_event.o)
_as_event_command_parse_header in libaerospike.a(as_event.o)
...
"_ev_loop_destroy", referenced from:
_as_ev_worker in libaerospike.a(as_event_ev.o)
"_ev_loop_new", referenced from:
_as_event_create_loop in libaerospike.a(as_event_ev.o)
"_ev_run", referenced from:
_as_ev_worker in libaerospike.a(as_event_ev.o)
"_ev_timer_again", referenced from:
_as_event_command_execute_in_loop in libaerospike.a(as_event.o)
_as_event_socket_timeout in libaerospike.a(as_event.o)
_as_event_command_retry in libaerospike.a(as_event.o)
_as_event_execute_from_delay_queue in libaerospike.a(as_event.o)
"_ev_timer_start", referenced from:
_as_event_command_execute_in_loop in libaerospike.a(as_event.o)
_as_event_socket_timeout in libaerospike.a(as_event.o)
_as_event_command_retry in libaerospike.a(as_event.o)
"_ev_timer_stop", referenced from:
_as_event_socket_timeout in libaerospike.a(as_event.o)
_as_event_command_retry in libaerospike.a(as_event.o)
_as_event_command_begin in libaerospike.a(as_event.o)
_as_event_query_complete in libaerospike.a(as_event.o)
_as_event_batch_complete in libaerospike.a(as_event.o)
_as_event_parse_error in libaerospike.a(as_event.o)
_as_event_socket_error in libaerospike.a(as_event.o)
...
"_lua_tointegerx", referenced from:
_connect in as_lua.o
_put in as_lua.o
_increment in as_lua.o
_add_bins_to_rec in as_lua.o
_add_bins_to_increment in as_lua.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@BrianNichols
Copy link
Contributor

client-lua is designed to link against the non-async libaerospike.a. First build and install libaerospike.a without EVENT_LIB environment variable being set. Then rerun "build_osx.sh".

@shikhil-gupta
Copy link

Thanks @BrianNichols for answering my question. So you mean i cant build async library at all with this client-lua? if yes then how can i build or load Aerospike library with async. what steps are needed?

Also I have again build Aerospike C client library with following ways:-

  1. make clean
  2. sudo make install

iblmdvshikhil:aerospike-client-c ****$ sudo make install
Password:
make[1]: Nothing to be done for `prepare'.
pkg/install target/Darwin-x86_64
cp -r target/Darwin-x86_64/include/aerospike target/Darwin-x86_64/include/citrusleaf /usr/local/include
cp target/Darwin-x86_64/lib/libaerospike.a target/Darwin-x86_64/lib/libaerospike.dylib /usr/local/lib

Now I have run the ./build_osx.sh with following change in build_osx.sh

-I/usr/local/include to -I/usr/local/include/lua. since it was not recognising lua headers. so i made this changes locally

But still i am facing this issues while building this client-lua

sudo ./build_osx.sh

src/as_lua.c:343:2: warning: implicit declaration of function 'luaL_register' is invalid in C99 [-Wimplicit-function-declaration]
luaL_register(L, "as_lua", as_client);
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_FIPS_mode_set", referenced from:
_as_tls_cleanup in libaerospike.a(as_tls.o)
"_lua_tointegerx", referenced from:
_connect in as_lua.o
_put in as_lua.o
_increment in as_lua.o
_add_bins_to_rec in as_lua.o
_add_bins_to_increment in as_lua.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@BrianNichols
Copy link
Contributor

BrianNichols commented Apr 2, 2019

Which version of lua did you install?

Aerospike requires lua 5.1.5.

Also, the async methods in async libaerospike library require an external event framework (like libev). If you add links for libev (-lev) in "build_osx.sh", then it should work as well.

@shikhil-gupta
Copy link

shikhil-gupta commented Apr 12, 2019

Hi Brian, I have been using lua development package 5.1.

$ lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio

To build Aeropsike C client, I have run following commands

  1. make USE_LUAJIT=1
  2. sudo make USE_LUAJIT=1 install

Even though i am facing this error while running build_osx.sh

SHIKHIL:client-lua shikhil.g$ ./build_osx.sh
Undefined symbols for architecture x86_64:
"_FIPS_mode_set", referenced from:
_as_tls_cleanup in libaerospike.a(as_tls.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

pasting logs using -v
shikhil.g$ ./build_osx.sh
Apple LLVM version 10.0.0 (clang-1000.10.44.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name as_lua.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fno-strict-return -masm-verbose -munwind-tables -target-cpu nocona -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -target-linker-version 409.12 -v -coverage-notes-file /Users/shikhil.g/dev/githome/release/client-lua/src/as_lua.gcno -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 -D MARCH_i386 -D _FILE_OFFSET_BITS=64 -D _REENTRANT -D _GNU_SOURCE -D _DARWIN_UNLIMITED_SELECT -I /usr/local/include -Wall -std=gnu99 -fdebug-compilation-dir /Users/shikhil.g/dev/githome/release/client-lua -ferror-limit 19 -fmessage-length 238 -stack-protector 1 -fblocks -fencode-extended-block-signature -fobjc-runtime=macosx-10.13.0 -fmax-type-align=16 -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o src/as_lua.o -x c src/as_lua.c
clang -cc1 version 10.0.0 (clang-1000.10.44.2) default target x86_64-apple-darwin17.7.0
ignoring duplicate directory "/usr/local/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include
/Library/Developer/CommandLineTools/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
Undefined symbols for architecture x86_64:
"_FIPS_mode_set", referenced from:
_as_tls_cleanup in libaerospike.a(as_tls.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@BrianNichols
Copy link
Contributor

FIPS_mode_set() is openssl function called from the aerospike client library. The linker is either not finding your openssl library (libssl.a or libssl.dylib in /usr/local/lib) or your openssl library version is less than 0.9.7.

Using openssl 1.0.2l, I ran the following on the lastest aerospike-client.

  1. make USE_LUAJIT=1 clean
  2. make USE_LUAJIT=1
  3. sudo make USE_LUAJIT=1 install

I then ran a modified client-lua build_osx.sh with -v flags on both compile and link.

$ ./build_osx.sh
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name as_lua.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu nocona -target-linker-version 274.2 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -coverage-file /Users/bnichols/client-lua/src/as_lua.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -D MARCH_i386 -D _FILE_OFFSET_BITS=64 -D _REENTRANT -D _GNU_SOURCE -D _DARWIN_UNLIMITED_SELECT -I /usr/local/include -Wall -std=gnu99 -fdebug-compilation-dir /Users/bnichols/client-lua -ferror-limit 19 -fmessage-length 138 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature -fmax-type-align=16 -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o src/as_lua.o -x c src/as_lua.c
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin16.0.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)
End of search list.
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -dylib -arch x86_64 -macosx_version_min 10.12.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -o as_lua.so -L/usr/local/lib src/as_lua.o /usr/local/lib/libaerospike.a -lssl -lcrypto -lpthread -lm -lz -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants