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

Apothecary: OpenCv 2.4.9 #3137

Closed
wants to merge 14 commits into from
Closed

Apothecary: OpenCv 2.4.9 #3137

wants to merge 14 commits into from

Conversation

ofTheo
Copy link
Member

@ofTheo ofTheo commented Aug 11, 2014

Static libs, headers and apothecary formulas for architectures included:

  • OSX FAT (32 bit w/ libstdc++ and 64 bit w/ libc++)
  • iOS FAT (armv7, armv7s, arm64, i386, x86_64 all with libc++)
  • Linux (32 bit)
  • Linux (64 bit)
  • Linux Armv6l
  • Linux Armv7l
  • Android - armeabi (@arturoc ?)
  • Android - armeabi-v7a (@arturoc ?)
  • Android - x86 (@arturoc ?)
  • VS (?)
  • win_cb (?)

Creates a single FAT opencv.a lib with O3 optimization and 64bit libc++ and 32bit libstdc++

don't merge yet.
still to do.

  • don't use build root - use build folder.
  • find a better way to keep _buildroot folder clean ( right now lipo will suck up any lib in _buildroot/lib/)
  • remove libtiff lib

ping @pizthewiz

changes

  • removed OpenCL as it was causing errors
  • removed some other libs not needed ( CUDA etc )
  • lipo for loop wasn't working - fixed.
  • error suppression for lipo incase lib is already FAT
  • libtool into a single opencv.a

formula based off of @pizthewiz gist - addresses #3039

@pizthewiz
Copy link
Member

Glad that mostly worked out. Is the libtooling into a single static lib a something that should be done with other libs and platforms? Would the result be better named libopencv.a?

@ofTheo
Copy link
Member Author

ofTheo commented Aug 11, 2014

thanks for all your hard work on it!

for OS X its unfortunately necessary to remove the lib prefix see: #2252 (comment)

the libtool into a single .a just makes it a bit easier for manually adding opencv to an existing project.

@bakercp
Copy link
Member

bakercp commented Aug 11, 2014

Hey @ofTheo I know we've talked about this before (your comment on #2252 being the location) but I'm still not sure why having the lib prefix would cause linking problems if a given project is set up correctly.

The main motivation for tracking this down is that it makes the apothecary formulas much cleaner if we don't deviate from the default settings / names produced by each library's makefiles.

Can you provide a quick reproducible example of where this fails for you? I'd like to try to track this down and figure out the exact cause (again, because it will make apothecary formulas for osx about 25% smaller).

@ofTheo
Copy link
Member Author

ofTheo commented Aug 11, 2014

this last commit builds the 32bit and 64bit libs seperately in a subdirectory of _buildroot ac8bb9f

the structure create looks like this:

screen shot 2014-08-11 at 3 44 54 pm

the lipo phase merges the libs from 32bit and 64bit into FAT and then the copy phase copies the includes and lib from FAT into the ofxOpenCv addon lib location.

curious what you think of this approach @bakercp as a good practice for all libs. ( Windows wouldn't have the FAT folder just 32bit and 64bit )

@bakercp bakercp changed the title Initial OpenCv formula based off of @pizthewiz gist - addresses #3039 Apothecary: OpenCv formula based off of @pizthewiz gist - addresses #3039 Aug 11, 2014
@bakercp bakercp changed the title Apothecary: OpenCv formula based off of @pizthewiz gist - addresses #3039 Apothecary: OpenCv 2.4.9 Aug 11, 2014
@bakercp
Copy link
Member

bakercp commented Aug 11, 2014

@ofTheo I'm renaming and organizing the apothecary-related PRs. I moved parts of the title to the description.

@bakercp
Copy link
Member

bakercp commented Aug 11, 2014

@ofTheo Let's make this PR the central PR for all platforms. I'd suggest that collaborators should PR against your branch so we can keep the formula, headers, and related build-settings in sync across platforms.

@ofTheo
Copy link
Member Author

ofTheo commented Aug 11, 2014

perfect - sounds like a good plan!

@ofTheo
Copy link
Member Author

ofTheo commented Aug 11, 2014

got iOS working. it might need some tweaks to do all the different arch we want. but it is doing the simulator + device now.

@bakercp
Copy link
Member

bakercp commented Aug 11, 2014

Hey @ofTheo and @julapy Are we building iOS fat libs for:

(armv6?) armv7 armv7s arm64 and for the simulator i386 x86_64

If so, which of those should be using libc++ and which of them should be using libstdc++?

On desktop, all 32 bit osx platforms are staying with libstdc++ for now, so should all 32 bit ios related archs also use build using libstdc++?

@ofTheo
Copy link
Member Author

ofTheo commented Aug 11, 2014

That's a great question!
I don't know the answer. I think we dont need two archs for simulator.

We should just do one I think.

On Aug 11, 2014, at 7:14 PM, Christopher Baker notifications@github.com wrote:

Hey @ofTheo and @julapy Are we building iOS fat libs for:

(armv6?) armv7 armv7s arm64 (simulator) i386 x86_64

If so, which of those should be using libc++ and which of them should be using libstdc++?

On desktop, all 32 bit osx platforms are staying with libstdc++ for now, so should all ios related libs also use libstdc++?


Reply to this email directly or view it on GitHub.

@julapy
Copy link
Member

julapy commented Aug 11, 2014

@danoli3 has a much better handle on iOS libs compilation.
Dan, can you advise?

@pizthewiz
Copy link
Member

I think we dont need two archs for simulator.

Without an x86_64 slice, users will not be able to simulate 64-bit iOS hardware, currently:

  • iPad Air
  • iPhone 5 / iPhone 5s

and likely any to-be-releaed hardware updates. I'm not sure what the iOS plans are for OF-0.9.0, but if dependencies are built via Apothecary, why not build armv7, armv7s, arm64, i386 and x86_64?

@bakercp
Copy link
Member

bakercp commented Aug 12, 2014

All of those archs (and @pizthewiz's reasoning) sound good to me. I'm going to proceed with all for Poco and FreeImage. They will be very FAT. :)

@ofTheo
Copy link
Member Author

ofTheo commented Aug 12, 2014

Haha yeah!
Okay sounds good to me.

I'll work in getting those in for opencv

On Aug 11, 2014, at 8:23 PM, Christopher Baker notifications@github.com wrote:

All of those archs (and @pizthewiz's reasoning) sound good to me. I'm going to proceed with all for Poco and FreeImage. They will be very FAT. :)


Reply to this email directly or view it on GitHub.

@pizthewiz
Copy link
Member

On a related note, could the iOS and iOS Simulator libs be united? Universal Binaries can of course technically handle this but I wasn't sure if we had a reason too. The Xcode build process will strip out the unused architectures (I believe the default setting). It might simplify the targets/linking too, just like libtooling all the OpenCV libs together.

@bakercp
Copy link
Member

bakercp commented Aug 12, 2014

Yeah, that's my plan lipo them all together in one giant fat lib. Should work no?

@pizthewiz
Copy link
Member

Yup that'll work, for some reason I thought we had separate iOS and iOS Simulator libs - nothing to see here…

@arturoc
Copy link
Member

arturoc commented Aug 12, 2014

i think i'm going to remove opencv binaries from linux and just add it to the install_dependencies script. the packages are usually up to date, ubuntu 14.04 has 2.4.8 and the next version to be released in october already has 2.4.9. only problem is if someone is on an older linux version but i think nothing should break unless you are on a really old version

@bilderbuchi
Copy link
Member

what about header changes in opencv, won't that be a problem, if we have the headers in OF, but the binaries from the OS?

@arturoc
Copy link
Member

arturoc commented Aug 12, 2014

we can just ignore the headers through addons_config.mk and use the ones in the system

@bilderbuchi
Copy link
Member

but the the ofxCv* files would see different headers than they expect, right? Sounds like great potential for bugs.

@arturoc
Copy link
Member

arturoc commented Aug 12, 2014

no, those files won't never be used with the right exclusion rule in addons_config

@arturoc
Copy link
Member

arturoc commented Aug 12, 2014

oh, you mean that it might be different versions? yes but it's the same with every library in the core, from time to time we need to do some change specific to a different version in linux but it's ok cause at some point that same version is updated in every other platform

@julapy
Copy link
Member

julapy commented Aug 14, 2014

the plan is to make iOS5 the minimum version in OF as per #2568
so dropping armv6 goes in hand with that.

@ofTheo
Copy link
Member Author

ofTheo commented Aug 15, 2014

okay iOS is done.
I cleaned up the script a fair amount as well - its at a fairly good point for someone to build off of for other platforms.

here is how it looks once I build for iOS and OS X - folders are created for each arch and then lipoed into the FAT folder.

the only significant thing was that I can't create one mega lib.
when I do that the boundaries between libstdc++ and libc++ get totally messed up. so now we have opencv_core.a opencv_calib.a etc.

screen shot 2014-08-15 at 5 07 30 pm

@danoli3
Copy link
Member

danoli3 commented Aug 27, 2014

hey @ofTheo

iOS all working? I tried to build, seemed to infinite loop in the build.
Is this right how to target it?

./apothecary -t ios update ofxOpenCV

Edit: Hmm no I think it just takes a long time to compile! haha XD

1 thing you may need to add for arm64 is
-miphoneos-version-min=7.0 instead of 5.0 (only for arm64)

@ofTheo
Copy link
Member Author

ofTheo commented Aug 27, 2014

ahh okay.
will add that now and will add the libs to this PR too.

@ofTheo
Copy link
Member Author

ofTheo commented Aug 27, 2014

okay OS X and iOS libs are in there now.
let me know if anyone notices any issues.

ofTheo and others added 3 commits September 15, 2014 16:43
…o feature-new-opencv

Conflicts:
	addons/ofxOpenCv/libs/opencv/include/opencv2/gpu/devmem2d.hpp
	addons/ofxOpenCv/libs/opencv/include/opencv2/gpu/gpu.hpp
	addons/ofxOpenCv/libs/opencv/include/opencv2/gpu/gpumat.hpp
	addons/ofxOpenCv/libs/opencv/include/opencv2/gpu/stream_accessor.hpp
@arturoc
Copy link
Member

arturoc commented Oct 13, 2014

ok android is ready too.

one thing in the copy rule, it should delete the old folders sometimes some files are not there any more so it's not enough with overwriting them cause the old ones remain

@arturoc arturoc added this to the 0.9.0 milestone Oct 13, 2014
@bakercp
Copy link
Member

bakercp commented Nov 25, 2014

Ready to merge @arturoc @ofTheo ? What's the status of win?

@kylemcdonald
Copy link
Contributor

hey @elliotwoods could you take a look here, maybe help with checking vs/cb? you're the person who i think would be most frustrated if opencv broke on windows ;)

@elliotwoods
Copy link
Contributor

heya!
i think you mean i'd be the one who'd act the most on my annoyance, right? :)
I've been generally making my own libs recently for ocv, but i can have a check

I'm upside-down busy between now and the end of the year. So I can check libs if they work, but setting up repos/apothecary isn't something I have the attention for right now sorry.

If somebody could send me a zip of their repo with apothecary then I could try to run build on that here with apothecary and check some common opencv functions in a test app.

Elliot

@ofTheo
Copy link
Member Author

ofTheo commented Feb 10, 2015

closed for #3635

@ofTheo ofTheo closed this Feb 10, 2015
@arturoc arturoc reopened this Feb 12, 2015
@arturoc
Copy link
Member

arturoc commented Feb 12, 2015

i'm reopening this since it seems the changes for android weren't included in the new PR. @ofTheo can you take a look and merge this with your version?

@ofTheo
Copy link
Member Author

ofTheo commented Feb 12, 2015

Thats fine - sorry I missed those commits.
The other PR I merged was just for the apothecary formula - I was going to wait before bringing in the libs. But happy if you think we should just get all the libs in now!!

@bilderbuchi
Copy link
Member

just leaving a note, this probably solves #2081

@kylemcdonald
Copy link
Contributor

with everything but windows solved, should we close this in favor of a windows-specific checklist issue?

@ofTheo
Copy link
Member Author

ofTheo commented May 15, 2015

yup def should close. thanks!

@ofTheo ofTheo closed this May 15, 2015
@arturoc arturoc deleted the feature-new-opencv branch July 8, 2015 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants