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

Please add Linux support #1

Closed
rizerphe opened this issue Sep 29, 2019 · 18 comments
Closed

Please add Linux support #1

rizerphe opened this issue Sep 29, 2019 · 18 comments

Comments

@rizerphe
Copy link

No description provided.

@thegoodhen
Copy link
Owner

I'm on it.

@ronsn
Copy link

ronsn commented Sep 29, 2019

I'm on it.

Awesome! =)

@thegoodhen
Copy link
Owner

I have succesfully managed to compile and run the software under Linux now. I will update the repository tomorrow.

@thegoodhen
Copy link
Owner

Uh... I managed to get it work on my new Linux machine, but not on my old one... So now I am downloading a virtualbox image of a Linux version which is old, but not insanely old to see if it will compile and work there. Then hopefully I can add the binaries here.

@oppedal
Copy link

oppedal commented Sep 30, 2019

Great work on this! Will there be support for the macs in the future? :)

@thegoodhen
Copy link
Owner

Ehm ehm.
Now it's not the right time to ask that.
I've just spent around 5 hours unsuccessfully trying to port it to Linux. :D
But hopefully I am close now. I am still really new to this.

But in all seriousness, thanks, and I hope there will be! But I don't really have a mac, so it will be a bit difficult.

@oppedal
Copy link

oppedal commented Sep 30, 2019

Yeah dont sweat it, just be proud of what you already have accomplished! Ill fire up the old pc and use that for the tracking part :)

@thegoodhen
Copy link
Owner

Thanks! It should be trivial to port it, since it's pretty much a Linux code. I am having trouble with libc versions, opencv versions and more fun stuff.

@thegoodhen
Copy link
Owner

thegoodhen commented Sep 30, 2019

I managed to compile it, but it seems like the Linux repositories for different Linux versions have vastly different versions of opencv with vastly different APIs. So I will need to bundle openCV with it somehow. Tried linking it statically, but that failed, tried including the libraries, but they were dependant on a very new version of libc... Now I am trying to compile opencv from source to get the libraries dependent on an older versions of libc for better compatibility... Then I'll try to either link it statically or somehow dynamically while still including the libraries in the .zip .

@f0x52
Copy link
Contributor

f0x52 commented Oct 1, 2019

I got it working on Arch by installing the opencv package, installing apriltag from source and then running
gcc AprilTools.cc -o AprilTools $(pkg-config --cflags --libs opencv4) -I/usr/local/include/apriltag -L/usr/local/lib -lapriltag -lstdc++ -lm -Wl,-rpath /usr/local/lib

@thegoodhen
Copy link
Owner

thegoodhen commented Oct 1, 2019

@f0x52 Thank you! Me too. I got this working on Kali and Ubuntu using (more or less) the approach you describe. But I CAN'T for the love of God manage to compile in a way that would allow me to distribute the whole thing without forcing the user to install opencv.

I can't manage to link opencv statically. Do you have any idea how to do it?

@typerat
Copy link

typerat commented Oct 1, 2019

Maybe an install script/makefile is the way to go? At least that's what gocv uses and it works very well every time and on different systems. I'm not sure how difficult it is to implement.
Personally, I don't mind dynamic libraries as long as I don't have to find and install everything manually.

@thegoodhen
Copy link
Owner

@christoph1703 The thing is that the code is dependant on a newer version of OpenCV than the one that can be obtained by apt-get on some relatively new-ish Linux distros, such as Ubuntu 16.04 .

This would force the users to compile openCV from source, which I tried on a virtual machine I literally had to leave it overnight to even complete.

I guess I could use an install script, which would copy the dynamic libraries to where they belong. I will take a look at gocv. Thank you for the comment!

@thegoodhen
Copy link
Owner

Hmmm actually I can take the opencv compilation/installation makefile I found somewhere and then just edit it to install the prebuilt libraries. Yea, probably the best way. I'll try it soon.

@rizerphe
Copy link
Author

rizerphe commented Oct 2, 2019

Good luck, I hope everything will work! Makefile is in my opinion the best way to go!

@HansH
Copy link

HansH commented Oct 2, 2019

I've opened pullrequest #9, which adds a cmake file, and instructions on how to build on Ubuntu and MacOS. This will not solve your problems with older linux versions, though

@thegoodhen
Copy link
Owner

thegoodhen commented Oct 2, 2019

I've opened pullrequest #9, which adds a cmake file, and instructions on how to build on Ubuntu and MacOS. This will not solve your problems with older linux versions, though

@HansH Wait, so it is now working under MacOS? AMAZING!

I just got it working on Ubuntu 16-19 without the need for installation. Updating everything shortly. I had to compile everything under an old version on Ubuntu and then set RPATH in CMAKE to be relative. Then I collected the necessary libraries using LDD and some bash scripting.

@thegoodhen
Copy link
Owner

@HansH Thank you for your amazing work. I've merged your pull request. I have added a Linux binary release now. I have successfully tested this release on Ubuntu 16.04, 18.04 and 19.04. Closing the issue as solved.

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

7 participants