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

ERROR-Trying to compile on Raspberry Pi 2 #1

Open
ghost opened this issue Mar 5, 2015 · 10 comments
Open

ERROR-Trying to compile on Raspberry Pi 2 #1

ghost opened this issue Mar 5, 2015 · 10 comments

Comments

@ghost
Copy link

ghost commented Mar 5, 2015

I am using the very latest version of go

I had to compile 1.4 first to compile this version so I suppose I have 1.4 as well. I am completely new to Linux, C, GO, GitHub (sorry for posting to the wrong area first - why is this paragraph's text huge?) and compiling in general, so please bear with me.

~/lime $ go get github.com/limetext/lime/frontend/html

github.com/limetext/gopy/lib

/usr/local/lib/libpython3.4m.a(complexobject.o): In function _Py_c_pow': /home/pi/Python-3.4.2/Objects/complexobject.c:121: undefined reference tohypot'
/home/pi/Python-3.4.2/Objects/complexobject.c:122: undefined reference to pow' /home/pi/Python-3.4.2/Objects/complexobject.c:123: undefined reference toatan2'
/home/pi/Python-3.4.2/Objects/complexobject.c:127: undefined reference to sincos' /home/pi/Python-3.4.2/Objects/complexobject.c:126: undefined reference toexp'
/home/pi/Python-3.4.2/Objects/complexobject.c:127: undefined reference to log' /usr/local/lib/libpython3.4m.a(complexobject.o): In function_Py_c_abs':
/home/pi/Python-3.4.2/Objects/complexobject.c:192: undefined reference to hypot' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_is_integer':
/home/pi/Python-3.4.2/Objects/floatobject.c:790: undefined reference to floor' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_as_integer_ratio':
/home/pi/Python-3.4.2/Objects/floatobject.c:1460: undefined reference to floor' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_divmod':
/home/pi/Python-3.4.2/Objects/floatobject.c:582: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:605: undefined reference tofloor'
/usr/local/lib/libpython3.4m.a(floatobject.o): In function float_rem': /home/pi/Python-3.4.2/Objects/floatobject.c:553: undefined reference tofmod'
/usr/local/lib/libpython3.4m.a(floatobject.o): In function float_round': /home/pi/Python-3.4.2/Objects/floatobject.c:984: undefined reference toround'
/home/pi/Python-3.4.2/Objects/floatobject.c:987: undefined reference to round' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_pow':
/home/pi/Python-3.4.2/Objects/floatobject.c:681: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:706: undefined reference tofloor'
/home/pi/Python-3.4.2/Objects/floatobject.c:717: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:691: undefined reference tofmod'
/home/pi/Python-3.4.2/Objects/floatobject.c:741: undefined reference to pow' /usr/local/lib/libpython3.4m.a(longobject.o): In functionPyLong_FromString':
/home/pi/Python-3.4.2/Objects/longobject.c:2169: undefined reference to log' /usr/local/lib/libpython3.4m.a(pytime.o): In function_PyTime_ObjectToDenominator':
/home/pi/Python-3.4.2/Python/pytime.c:173: undefined reference to ceil' /home/pi/Python-3.4.2/Python/pytime.c:180: undefined reference tofloor'
/usr/local/lib/libpython3.4m.a(pytime.o): In function _PyTime_ObjectToTime_t': /home/pi/Python-3.4.2/Python/pytime.c:212: undefined reference toceil'
/home/pi/Python-3.4.2/Python/pytime.c:214: undefined reference to floor' /usr/local/lib/libpython3.4m.a(dynload_shlib.o): In function_PyImport_GetDynLoadFunc':
/home/pi/Python-3.4.2/./Python/dynload_shlib.c:82: undefined reference to dlsym' /home/pi/Python-3.4.2/./Python/dynload_shlib.c:95: undefined reference todlopen'
/home/pi/Python-3.4.2/./Python/dynload_shlib.c:126: undefined reference to dlsym' /home/pi/Python-3.4.2/./Python/dynload_shlib.c:101: undefined reference todlerror'
/usr/local/lib/libpython3.4m.a(signalmodule.o): In function timeval_from_double': /home/pi/Python-3.4.2/./Modules/signalmodule.c:117: undefined reference tofloor'
/home/pi/Python-3.4.2/./Modules/signalmodule.c:118: undefined reference to fmod' /home/pi/Python-3.4.2/./Modules/signalmodule.c:117: undefined reference tofloor'
/home/pi/Python-3.4.2/./Modules/signalmodule.c:118: undefined reference to fmod' /usr/local/lib/libpython3.4m.a(posixmodule.o): In functionposix_openpty':
/home/pi/Python-3.4.2/./Modules/posixmodule.c:6000: undefined reference to openpty' /usr/local/lib/libpython3.4m.a(posixmodule.o): In functionposix_forkpty':
/home/pi/Python-3.4.2/./Modules/posixmodule.c:6089: undefined reference to `forkpty'
collect2: ld returned 1 exit status


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@bwiggs
Copy link

bwiggs commented Mar 5, 2015

Hi @MrDogBot ,

First, off sorry for the confusion with your other post being closed out. We'll try and get you some help here.

The Raspberry Pi 2 runs an ARM processor. Unfortunately, there hasn't been a lot of sucess with ARM platforms yet for limetext. I would suggest following this post to watch for progress. Here's a link to the BountrySource page for that issue, if you decide you'd like to encourage others to take on that task :)

Hopefully someone else has some more insight into the specific errors you're seeing. Unfortunately, I don't have a RP2 to try and reproduce.

why is this paragraph's text huge

As you're new to Github, you should read up on markdown and even github flavored markdown. Here's a handy cheatsheet. Big text indicates the use of a header. Also, be sure to wrap your stack traces with triple ticks, which will help preserve formatting and make your stack traces easier to read. Like so:

/usr/local/lib/libpython3.4m.a(complexobject.o): In function _Py_c_pow': /home/pi/Python-3.4.2/Objects/complexobject.c:121: undefined reference tohypot'
/home/pi/Python-3.4.2/Objects/complexobject.c:122: undefined reference to pow' /home/pi/Python-3.4.2/Objects/complexobject.c:123: undefined reference toatan2'
/home/pi/Python-3.4.2/Objects/complexobject.c:127: undefined reference to sincos' /home/pi/Python-3.4.2/Objects/complexobject.c:126: undefined reference toexp'
/home/pi/Python-3.4.2/Objects/complexobject.c:127: undefined reference to log' /usr/local/lib/libpython3.4m.a(complexobject.o): In function_Py_c_abs':
/home/pi/Python-3.4.2/Objects/complexobject.c:192: undefined reference to hypot' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_is_integer':
/home/pi/Python-3.4.2/Objects/floatobject.c:790: undefined reference to floor' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_as_integer_ratio':
/home/pi/Python-3.4.2/Objects/floatobject.c:1460: undefined reference to floor' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_divmod':
/home/pi/Python-3.4.2/Objects/floatobject.c:582: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:605: undefined reference tofloor'
/usr/local/lib/libpython3.4m.a(floatobject.o): In function float_rem': /home/pi/Python-3.4.2/Objects/floatobject.c:553: undefined reference tofmod'
/usr/local/lib/libpython3.4m.a(floatobject.o): In function float_round': /home/pi/Python-3.4.2/Objects/floatobject.c:984: undefined reference toround'
/home/pi/Python-3.4.2/Objects/floatobject.c:987: undefined reference to round' /usr/local/lib/libpython3.4m.a(floatobject.o): In functionfloat_pow':
/home/pi/Python-3.4.2/Objects/floatobject.c:681: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:706: undefined reference tofloor'
/home/pi/Python-3.4.2/Objects/floatobject.c:717: undefined reference to fmod' /home/pi/Python-3.4.2/Objects/floatobject.c:691: undefined reference tofmod'
/home/pi/Python-3.4.2/Objects/floatobject.c:741: undefined reference to pow' /usr/local/lib/libpython3.4m.a(longobject.o): In functionPyLong_FromString':
/home/pi/Python-3.4.2/Objects/longobject.c:2169: undefined reference to log' /usr/local/lib/libpython3.4m.a(pytime.o): In function_PyTime_ObjectToDenominator':
/home/pi/Python-3.4.2/Python/pytime.c:173: undefined reference to ceil' /home/pi/Python-3.4.2/Python/pytime.c:180: undefined reference tofloor'
/usr/local/lib/libpython3.4m.a(pytime.o): In function _PyTime_ObjectToTime_t': /home/pi/Python-3.4.2/Python/pytime.c:212: undefined reference toceil'
/home/pi/Python-3.4.2/Python/pytime.c:214: undefined reference to floor' /usr/local/lib/libpython3.4m.a(dynload_shlib.o): In function_PyImport_GetDynLoadFunc':
/home/pi/Python-3.4.2/./Python/dynload_shlib.c:82: undefined reference to dlsym' /home/pi/Python-3.4.2/./Python/dynload_shlib.c:95: undefined reference todlopen'
/home/pi/Python-3.4.2/./Python/dynload_shlib.c:126: undefined reference to dlsym' /home/pi/Python-3.4.2/./Python/dynload_shlib.c:101: undefined reference todlerror'
/usr/local/lib/libpython3.4m.a(signalmodule.o): In function timeval_from_double': /home/pi/Python-3.4.2/./Modules/signalmodule.c:117: undefined reference tofloor'
/home/pi/Python-3.4.2/./Modules/signalmodule.c:118: undefined reference to fmod' /home/pi/Python-3.4.2/./Modules/signalmodule.c:117: undefined reference tofloor'
/home/pi/Python-3.4.2/./Modules/signalmodule.c:118: undefined reference to fmod' /usr/local/lib/libpython3.4m.a(posixmodule.o): In functionposix_openpty':
/home/pi/Python-3.4.2/./Modules/posixmodule.c:6000: undefined reference to openpty' /usr/local/lib/libpython3.4m.a(posixmodule.o): In functionposix_forkpty':
/home/pi/Python-3.4.2/./Modules/posixmodule.c:6089: undefined reference to `forkpty'
collect2: ld returned 1 exit status

@quarnster
Copy link
Member

@MrDogBot, It's not lime that's erroring, it's gopy, but really the cause from the errors you posted IMO looks like your Python 3's package config is not set up properly in your distro (lame) so you will have to specify additional libraries to link with. The proper way (?) would be to fix your python3.pc file so that it's actually providing a correct set of libraries it needs to link with, but I can't say I'm familiar with how that works.

Now instead of mucking about with your python3.pc file you can instead create a new file in $GOPATH/src/github.com/limetext/gopy/lib, named cgo_rpi.go with this content:

package py

// #cgo LDFLAGS: -lc -lm -ldl
import "C"

You might have to tweak the libs to link with further.

In short you'll need to get this working first before being able to continue:

cd $GOPATH/src/github.com/limetext/gopy/lib
go test

@ghost
Copy link
Author

ghost commented Mar 5, 2015

Thank you so much for the help, both of you. I will keep learning in hopes to help bring LIME to RP

@bwiggs
Copy link

bwiggs commented Mar 5, 2015

@MrDogBot If you manage to get this working, it would be really helpful to the community to document your experiences on the Building on Raspberry Pi 2 wiki page. I'm sure other users would really appreciate it!

@quarnster
Copy link
Member

If you'd like you can try and disable the python and Sublime Text plugin bits and see if that works. Save the following as $GOPATH/src/github.com/limetext/lime/frontend/termbox/diff.patch:

diff --git a/frontend/termbox/main.go b/frontend/termbox/main.go
index dd875f0..4068a0c 100644
--- a/frontend/termbox/main.go
+++ b/frontend/termbox/main.go
@@ -12,12 +12,10 @@ import (
        "sync"
        "time"

-       "github.com/limetext/gopy/lib"
        "github.com/limetext/lime/backend"
        _ "github.com/limetext/lime/backend/commands"
        "github.com/limetext/lime/backend/keys"
        "github.com/limetext/lime/backend/log"
-       "github.com/limetext/lime/backend/sublime"
        "github.com/limetext/lime/backend/textmate"
        "github.com/limetext/lime/backend/util"
        "github.com/limetext/termbox-go"
@@ -174,7 +172,6 @@ func createFrontend() *tbfe {

        // These might take a while
        t.editor.Init()
-       go sublime.Init()

        return &t
 }
@@ -802,10 +799,6 @@ func main() {
        flag.Parse()

        log.AddFilter("file", log.FINEST, log.NewFileLogWriter("debug.log", *rotateLog))
-       defer func() {
-               py.NewLock()
-               py.Finalize()
-       }()

        if err := termbox.Init(); err != nil {
                log.Close(err)

and run:

cd $GOPATH/src/github.com/limetext/lime/frontend/termbox
git apply diff.patch
go build

If you get no output it worked and you can now test it with ./termbox main.go. Press ctrl+q to quit.

Obviously this then will disable ST3 plugin support which makes use of python, but other than that it should be fully functional in the current state, presuming nothing else is broken for RPI.

@bwiggs
Copy link

bwiggs commented Mar 7, 2015

@MrDogBot Just wanted to say thanks for writing all the wiki docs for the Raspberry Pi page! Great work so far!

@kristofer
Copy link

so the diff above did not materially impact the building process. for whatever reason, the build still compIained about the missing python modules.
ended up looking at getting Qt and onig-5.9.5 along withe python 3.4 stuff and ran out of steam. it seemed like there were too many dependencies that led to "just one more" thing you had to fetch and compile etc.

@kristofer
Copy link

after applying the above diff, this was the result....

$ go test github.com/limetext/lime/backend/... github.com/limetext/lime/frontend/...
# pkg-config --cflags oniguruma
Package oniguruma was not found in the pkg-config search path.
Perhaps you should add the directory containing `oniguruma.pc'
to the PKG_CONFIG_PATH environment variable
No package 'oniguruma' found
pkg-config: exit status 1
FAIL    github.com/limetext/lime/backend [build failed]
FAIL    github.com/limetext/lime/backend/commands [build failed]
ok      github.com/limetext/lime/backend/keys   0.148s
ok      github.com/limetext/lime/backend/loaders    0.065s
ok      github.com/limetext/lime/backend/loaders/json   0.094s
ok      github.com/limetext/lime/backend/loaders/plist  0.110s
ok      github.com/limetext/lime/backend/log    0.058s
ok      github.com/limetext/lime/backend/packages   0.074s
# pkg-config --cflags python-3.4
Package python-3.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python-3.4' found
pkg-config: exit status 1
ok      github.com/limetext/lime/backend/parser 0.059s
# pkg-config --cflags Qt5Core Qt5Widgets Qt5Quick
Package Qt5Core was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Core.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Core' found
Package Qt5Widgets was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Widgets.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Widgets' found
Package Qt5Quick was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Quick.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Quick' found
pkg-config: exit status 1
ok      github.com/limetext/lime/backend/render 0.062s
ok      github.com/limetext/lime/backend/render/textmate    0.019s
FAIL    github.com/limetext/lime/backend/sublime [build failed]
FAIL    github.com/limetext/lime/backend/textmate [build failed]
ok      github.com/limetext/lime/backend/util   0.026s
ok      github.com/limetext/lime/backend/watch  1.631s
?       github.com/limetext/lime/frontend   [no test files]
FAIL    github.com/limetext/lime/frontend/html [build failed]
FAIL    github.com/limetext/lime/frontend/qml [build failed]
FAIL    github.com/limetext/lime/frontend/termbox [build failed]

and after install onig-5.9.5..

~/p/src/github.com/limetext/lime$ go test github.com/limetext/lime/backend/... github.com/limetext/lime/frontend/...
# pkg-config --cflags python-3.4
Package python-3.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `python-3.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python-3.4' found
pkg-config: exit status 1
# pkg-config --cflags Qt5Core Qt5Widgets Qt5Quick
Package Qt5Core was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Core.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Core' found
Package Qt5Widgets was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Widgets.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Widgets' found
Package Qt5Quick was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Quick.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Quick' found
pkg-config: exit status 1

@jimson-jimson
Copy link

I was previously trying to build Lime on an armhf chromebook (Acer 13, CB5-311 NYAN-BIG) running Xubuntu 14.04 with no luck myself. I wish you the best of luck, but I couldn't even get the html frontend working, much less the UXTerm version. I don't know the particulars of the Lime project, and absolutely nothing of GO which is proving to be a hindrance. I'm fairly used to compiling software for ARM, and in a lot of cases all you end up having to change is a few lines of code that check architecture, not the case here.

I'm willing to help get this working by attempting compilation on my hardware to the best of my ability. We really need something like this for ARM Chromebooks running linux, as while Eclipse, Netbeans, and Intellij can be made to run, they're exceptionally glitchy and slow on ARM. I don't mind using Emacs almost exclusively, but it makes it hard to recommend the platform as something cheap with crazy battery life to pound out code with when the tools most programmers I know use aren't available.

Getting the HTML version working somehow in ChromeOS itself would be fantastic too, there are good text editors like caret over there, but they're nowhere near the level of anything like sublime or emacs or even vim. I don't know how that'd work, maybe the backend could run on your home PC.

@nonnymoose
Copy link

@MrDogBot Maybe you could try installing an official armhf python package:
ports.ubuntu.com/pool/main/p/python3.4/python3.4_3.4.2-1_armhf.deb
ports.ubuntu.com/pool/main/p/python3.5/python3.5_3.5.0-3_armhf.deb

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

5 participants