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

Unable to compile for Odroid C2 #4714

Closed
Helvethor opened this issue May 6, 2016 · 16 comments
Closed

Unable to compile for Odroid C2 #4714

Helvethor opened this issue May 6, 2016 · 16 comments
Labels
build building and installing Neovim using the provided scripts

Comments

@Helvethor
Copy link

Helvethor commented May 6, 2016

Hi,
I started deploying neovim on my machines, all went well except for one. It's a Odroid-C2. Here is what appens when I execute make :
$ make
....
==== Building LuaJIT 2.0.4 ====
make[5]: Entering directory '/root/src/neovim/.deps/build/src/luajit/src'
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
lj_arch.h:55:2: error: #error "No support for this architecture (yet)"
#error "No support for this architecture (yet)"
^
lj_arch.h:287:2: error: #error "No target architecture defined"
#error "No target architecture defined"
^
Makefile:233: *** Unsupported target architecture. Stop.
...

Is there any way I could tell make about the target/architecture. And how do I find these infos?

Regards,
Vincent Pasquier

@equalsraf
Copy link
Contributor

The errors are from luajit. Which I assume does not support 64bit ARM - there seems to be ongoing work to support it LuaJIT/LuaJIT#25 but I'm not sure if its ready for the upcoming luajit release (it would seem so from luvit/luv#112).

@Helvethor
Copy link
Author

Thanks for the infos! So once it'll be supported, I will be able to compile it normally ?
How do I get notified about such things?

@equalsraf
Copy link
Contributor

You can also try building luajit yourself or maybe someone already packaged it for you (not sure what distro you are running).

If you try this, see the wiki entry on Controlling the build for third-party dependencies , you can override the luajit library that is being used with -DUSE_BUNDLED_LUAJIT=OFF.

How do I get notified about such things?

You can subscribe to events in the luajit github project.

@Helvethor
Copy link
Author

I'm running Debian 8
There is one package availiable: libluajit-5.1-common. I installed it and used the flag you proposed, but it didn't change anything. I'm not sure this is the right package for this task anyway.
I tried to build it from this : https://github.com/zenkj/luajit-arm64.git
But it gave me the same error.

I think I'll subscribe to the project and wait for arm64 to be supported.
Thanks a lot!

@fwalch
Copy link
Member

fwalch commented May 7, 2016

There's an experimental ARM64 LuaJIT package available: https://packages.debian.org/experimental/libluajit-5.1-2

There's also an experimental Neovim package, btw (including ARM64 support): https://packages.debian.org/experimental/neovim

@Helvethor
Copy link
Author

I tried the experimental package for neovim first. I could not install it because of some dependencies issues.
I could install libluajit-5.1-2 and libluajit-5.1-dev, but again compilation fails at Luajit.
I use this command to compile :
make CMAKE_EXTRA_FLAGS="-DUSE_BUNDLED_LUAJIT=OFF -DCMAKE_INSTALL_PREFIX:PATH=/opt/neovim"
It still fails at the same point. Is my command line wrong? Is it normal that I still see entries about luajit even though it is supposed to use the package?

Thanks for you support

@fwalch
Copy link
Member

fwalch commented May 7, 2016

You need to use DEPS_CMAKE_FLAGS or something like that for the Luajit part, see the Makefile. Also you might need to clean the CMake cache (make distclean)

@Helvethor
Copy link
Author

Helvethor commented May 7, 2016

I moved DUSE_BUNDLED_LUAJIT to DEPS_CMAKE_FLAGS and now it seems to be looking for Luajit in /usr/include/.
It failed again but the errors told me to specify --with-lua-include=... so I looked for this lua.h file and found one located here : /usr/include/luajit-2.1
However I am obviously setting the parameter the wrong way because it still ouputs the same errors with the "--with-lua-include" flag set.

make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=/opt/neovim" DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUAJIT=OFF --with-lua-include=/usr/include/luajit-2.1"
make  -C .deps
make[1]: Entering directory '/root/src/neovim/.deps'
make[2]: Entering directory '/root/src/neovim/.deps'
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
[ 11%] Built target jemalloc
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
[ 22%] Built target unibilium
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
[ 34%] Built target libtermkey
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
[ 45%] Built target libuv
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
[ 57%] Built target libvterm
make[3]: Entering directory '/root/src/neovim/.deps'
make[3]: Leaving directory '/root/src/neovim/.deps'
make[3]: Entering directory '/root/src/neovim/.deps'
[ 58%] Performing configure step for 'luarocks'
Looking for Lua... luajit found in $PATH: /usr/bin
Checking Lua interpreter... luajit found in /usr/bin
Checking Lua includes... **lua.h** not found (looked in **/usr/include, /usr/include/lua/5.1, /usr/include/lua5.1**)
You may want to use the flag **--with-lua or --with-lua-include**. See --help.

configure failed.

CMakeFiles/luarocks.dir/build.make:100: recipe for target 'build/src/luarocks-stamp/luarocks-configure' failed
make[3]: *** [build/src/luarocks-stamp/luarocks-configure] Error 1
make[3]: Leaving directory '/root/src/neovim/.deps'
CMakeFiles/Makefile2:336: recipe for target 'CMakeFiles/luarocks.dir/all' failed
make[2]: *** [CMakeFiles/luarocks.dir/all] Error 2
make[2]: Leaving directory '/root/src/neovim/.deps'
Makefile:76: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/src/neovim/.deps'
Makefile:75: recipe for target 'deps' failed
make: *** [deps] Error 2

Thanks for your help!

@equalsraf
Copy link
Contributor

@Helvethor no this one is slightly different and is probably a consequence of our luarocks recipe not expecting luajit 2.1 - the with-lua-include flag is not ours it can only be passed to luarocks.

If you look inside third-party/cmake/BuildLuarocks.cmake there are at least a couple places where luajit-2.0 needs to be replaced with luajit-2.1 here is an example
equalsraf@e700fb9#diff-4827d9465b6d6428c1ce9ca4b814cb69L62

@Helvethor
Copy link
Author

Helvethor commented May 7, 2016

I went one step further, this error no longer shows up since I installed liblua5.1-0-dev. It still doesn't compile, see the error, something linked to "luv" and lua.h again.

[ 77%] Performing build step for 'luv-static'
make[4]: Entering directory '/root/src/neovim/.deps/build/src/luv-static-build'
make[5]: Entering directory '/root/src/neovim/.deps/build/src/luv-static-build'
make[6]: Entering directory '/root/src/neovim/.deps/build/src/luv-static-build'
Scanning dependencies of target luv
make[6]: Leaving directory '/root/src/neovim/.deps/build/src/luv-static-build'
make[6]: Entering directory '/root/src/neovim/.deps/build/src/luv-static-build'
[100%] Building C object CMakeFiles/luv.dir/src/luv.c.o
In file included from /root/src/neovim/.deps/build/src/luv/src/luv.c:18:0:
/root/src/neovim/.deps/build/src/luv/src/luv.h:19:17: fatal error: lua.h: No such file or directory
 #include <lua.h>
                 ^
compilation terminated.
CMakeFiles/luv.dir/build.make:54: recipe for target 'CMakeFiles/luv.dir/src/luv.c.o' failed
make[6]: *** [CMakeFiles/luv.dir/src/luv.c.o] Error 1
make[6]: Leaving directory '/root/src/neovim/.deps/build/src/luv-static-build'
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/luv.dir/all' failed
make[5]: *** [CMakeFiles/luv.dir/all] Error 2
make[5]: Leaving directory '/root/src/neovim/.deps/build/src/luv-static-build'
Makefile:117: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/root/src/neovim/.deps/build/src/luv-static-build'
CMakeFiles/luv-static.dir/build.make:107: recipe for target 'build/src/luv-static-stamp/luv-static-build' failed
make[3]: *** [build/src/luv-static-stamp/luv-static-build] Error 2
make[3]: Leaving directory '/root/src/neovim/.deps'
CMakeFiles/Makefile2:403: recipe for target 'CMakeFiles/luv-static.dir/all' failed
make[2]: *** [CMakeFiles/luv-static.dir/all] Error 2
make[2]: Leaving directory '/root/src/neovim/.deps'
Makefile:76: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/src/neovim/.deps'
Makefile:75: recipe for target 'deps' failed
make: *** [deps] Error 2

I tried changing every occurence of "luajit-2.0" with "luajit-2.1" in the files found in thirdparty/cmake. It gave the above result.

I will try with a fresh clone and liblua-5.1-0-dev installed soon.
Any other idea?
You've been of a great help!

Edit :
Reverting back to a fresh clone didn't change the error...

@ZyX-I
Copy link
Contributor

ZyX-I commented May 7, 2016

I would suggest to:

  1. Ignore top-level Makefile.
  2. Install lua 5.1. Not luajit.
  3. Install luarocks and use it to install lpeg and mpack. Maybe something else as well if build fails.
  4. Install libuv.
  5. Create directory build and execute in it cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local && make && make install.

The main points:

  1. You do not need luv. I have no idea why it is used at all, I still do not have it and Neovim still builds fine.
  2. luajit is needed for unit tests. If you want to run them you will have to get luajit, otherwise lua 5.1 should be fine.
  3. Top-level makefile does lots of unneeded crap. I never use it, luarocks or emerge (portage) cope with dependencies far better.

@Helvethor
Copy link
Author

Interesting, I'll try to do what you said soon.
This is a premiere for me to build on an unsupported platform + I know nothing about the workings of nvim ^^. But you give me so much help, I won't give up soon.
Thanks

@ZyX-I
Copy link
Contributor

ZyX-I commented May 7, 2016

Forgot a thing: you need to install msgpack (https://github.com/msgpack/msgpack-c/) as well (version 1.0 minimum AFAIR, I have 1.1.0). This, libuv, lua and luarocks should be installable by the system package manager.

@equalsraf
Copy link
Contributor

equalsraf commented May 7, 2016

I went one step further, this error no longer shows up since I installed liblua5.1-0-dev. It still doesn't compile, see the error, something linked to "luv" and lua.h again.

@Helvethor try this. In DEPS_CMAKE_FLAGS add -DUSE_BUNDLED_BUSTED=OFF to disable luv/busted in third-party (you don't really need them unless you want unit tests).

@ZyX-I your suggestion "should" work but I think LuaJit is marked as required in the main project CMakeLists.txt. this could be fixed to only enable unit tests if luajit is available

@justinmk justinmk added the build building and installing Neovim using the provided scripts label May 9, 2016
@creationix
Copy link

I got a new odroid C2 and just built luvit!

A small patch was required to luv to allow luajit to configure properly. luvit/luv@e4f2a80

There is still some issue in luvi's openssl asm code, but if you build with with the regular instead of the regular-asm mode, it works great on the odroid ubuntu image.

tim@odroid64:~/lit$ luvi -v
luvi v2.7.5
rex: 8.37 2015-04-28
libuv: 1.9.1
ssl: OpenSSL 1.0.2g  1 Mar 2016, lua-openssl 0.5.1
tim@odroid64:~/lit$ lit -v
lit version: 3.4.3
luvi version: v2.7.5
tim@odroid64:~/lit$ luvit -v
luvit version: 2.11.5
luvi version: v2.7.5
rex version: 8.37 2015-04-28
libuv version: 1.9.1
ssl version: OpenSSL 1.0.2g  1 Mar 2016, lua-openssl 0.5.1
tim@odroid64:~/lit$ uname -a
Linux odroid64 3.14.65-73 #1 SMP PREEMPT Tue Aug 2 08:21:02 BRT 2016 aarch64 aarch64 aarch64 GNU/Linux
tim@odroid64:~/lit$ file `which luvi`
/usr/local/bin/luvi: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=b503f3aacc86539b1f21f68fa1d4f3d6cf57a643, not stripped
tim@odroid64:~/lit$ ls -lh `which luvi`
-rwxr-xr-x 1 tim tim 3.4M Aug  4 23:07 /usr/local/bin/luvi

@justinmk
Copy link
Member

It still doesn't compile, see the error, something linked to "luv" and lua.h again.

luv builds on odroid c2 per the last comment here (note to avoid confusion: we use "luv", not "luvi", nor "luvit"). So I think we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts
Projects
None yet
Development

No branches or pull requests

6 participants