Closed guidefreitas closed 10 years ago
It is related with the support for homebrew? The building script uses pkg-config to compile the April-ANN shared library with your system Lua installation. If needed, it could be customized for homebrew or MacPorts.
Yes, I'm trying to modify the build_release_macosx.lua script to work with Homebrew but I've got stuck in another error now.
How can I identify what lib is missing/broken? I think it is zlib but tryed to install it with several other ways without luck. Which zlib version are you using?
macbook:april-ann guilherme$ make release-macosx
lua build_release_macosx.lua
default target: build
[ 37/ 38 (97.4%) done]: main_package ./ Undefined symbols for architecture x86_64:
"_luaL_addlstring", referenced from:
BufferedMemory
make: *\ [release-macosx] Error 1
It seems like that the configure process has failed before. Please, execute
$ ls lua/lib
Probably it is void... If it is the case, re run configure script
There is a liblua.a file and a lua folder with a empty 5.2 subfolder.
run a make command in lua/lua-5.2.2 compiles without problem
Try out one thing. Copy the large clang++ command that is showed at the end of the error when you run make release-macosx, but add to the command lua/lib/liblua.a
I think that for a weird reason this file is missing in the clang compilation command.
I'm trying to install homebrew in another machine, in order to reproduce the problem. I found problems with Lua 5.2 pkg-config file, which is not deployed by homebrew, but it is possible to reproduce it manually. However, after solving that, the compilation works perfect :( After trying my previous advice, please, modify the build_release_macosx.lua, replacing the line which contains
verbosity_level = 0, -- 0 => NONE, 1 => ONLY TARGETS, 2 => ALL
by the following:
verbosity_level = 2, -- 0 => NONE, 1 => ONLY TARGETS, 2 => ALL
Therefore, do:
$ make clean
$ make release-macosx > output 2>&1
And attach the output as answer to this issue.
Here is the gist with de output file https://gist.github.com/guidefreitas/8409855
I tryed to add -L/Users/guilherme/projetos/open_source/deep_learning/april-ann-guilherme/april-ann/lua/lib/liblua.a and -L/Users/guilherme/projetos/open_source/deep_learning/april-ann-guilherme/april-ann/lua/lib/ to the huge clang++ command but I got the same error.
Ok, the binary executable seems to be compiled and linked without problems. In any case, you can use it copying the file build_release_macosx/bin/april-ann
to bin/april-ann
Your problem is with the compilation of the Lua shared library, which is failing to link some Lua 5.2 functions.
Which version has you installed?
Probably homebrew is installing Lua 5.1 instead of 5.2, and that seems to be the problem.
I found that for installation of Lua 5.2, it is necessary to do:
$ brew install homebrew-versionsLua52
$ brew link homebrew-versionsLua52
(Please, check the commands, I'm not in the MacOS X now...)
BUT, this will break the pkg-config, because this package comes without the corresponding lua.pc
file. So, until homebrew has Lua 5.2 installed by default, it will be necessary to change the build_release_macosx.lua
, replacing where is written:
assert(io.popen("pkg-config --libs 'lua >= 5.2'"):read("*l"))
by
assert(io.popen("pkg-config --libs 'lua'"):read("*l"))
:-)
Here the explanation of the problem in the homebrew Lua package:
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/lua.rb
require 'formula'
class Lua < Formula
# 5.2 is not fully backwards compatible, and breaks e.g. luarocks.
# It is available in Homebrew-versions for the time being.
How are you doing with this issue? Do you try my last sugestions? Thanks.
No, a lot of errors :(. I'm using lua 5.2.2
macbook:april-ann guilherme$ make release lua build_release.lua default target: build package ocr.off_line_text_preprocessing not found luapkg dependencies failed cp: build_release/bin/april-ann: No such file or directory Error 1 in packages/trainable when executing command cp -f build_release/bin/april-ann ./bin/april-ann
make: *\ [release] Error 1
Ops, that is a new issue in devel branch :'( I just created one to seek the problem. If you want, try with master branch ;-)
Fixed. Should work now.
Compilation with debug and homebrew is working in Travis CI (make debug-homebrew
). Release version stills not working because history library is not found. I can't test where it is located and which name has history library in homebrew. I'm closing this issue and opening a new one for the release problem.
macbook:april-ann guilherme$ . configure.sh cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make DetectOS /Applications/Xcode.app/Contents/Developer/usr/bin/make all SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-ldl -lreadline" make[3]: Nothing to be done for
all'. cd src && mkdir -p ../../bin ../../include ../../lib ../../man/man1 ../../share/lua/5.2 ../../lib/lua/5.2 cd src && install -p -m 0755 lua luac ../../bin cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp ../../include cd src && install -p -m 0644 liblua.a ../../lib cd doc && install -p -m 0644 lua.1 luac.1 ../../man/man1 make: Nothing to be done for
all'. macbook:april-ann guilherme$ make release-macosx lua build_release_macosx.lua Package lua was not found in the pkg-config search path. Perhaps you should add the directory containing `lua.pc' to the PKG_CONFIG_PATH environment variable No package 'lua' found lua: build_release_macosx.lua:41: assertion failed! stack traceback: [C]: in function 'assert' build_release_macosx.lua:41: in main chunk [C]: in ? make: *\ [release-macosx] Error 1