<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog blog("Baptiste Wicht"); (Posts about opencv)</title><link>https://baptiste-wicht.com/</link><description></description><atom:link href="https://baptiste-wicht.com/categories/opencv.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sun, 15 Feb 2026 06:57:41 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Build OpenCV with libc++ on Gentoo and static-libs</title><link>https://baptiste-wicht.com/posts/2014/06/build-opencv-with-libcxx-on-gentoo-and-static-libs.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;When you build C++ projects with CLang, you have the choice between using the
stdlibc++ that is provided along G++ and the new libc++ that is provided by
CLang.&lt;/p&gt;
&lt;p&gt;libc++ is another implementation of the C++ Standard Library. This
implementation is dual-licensed under the MIT license and UIUC license. It is
especially targeting C++11 and has already 100% support for C++14. This
last point is the reason that I use libc++ on several of my projects. Moreover,
it is also the default on Mac OS X.&lt;/p&gt;
&lt;p&gt;The problem with linking with another library is that you can only works with
libraries that have been compiled with libc++ support. For instance, if you want
to use Boost dynamic libraries, you'll have to compile Boost from sources with
libc++.&lt;/p&gt;
&lt;p&gt;For one of my project, I'm using OpenCV and libc++. To simplify the installation
of OpenCV, I created a new ebuild with a &lt;em&gt;libcxx&lt;/em&gt; use flag to selectively build the
library with libc++. This requires LLVM/CLang on the build machine. Moreover, by
default, the Gentoo ebuild does not have support for building the static
libraries. The reason for that is that OpenCV build is not able to build dynamic
and static libraries. I added a &lt;em&gt;static-libs&lt;/em&gt; use flag that build the static
libraries by building OpenCV a second time after the first. That will likely
double the compile time (unless ccache is used). Anyhow, it is simple easier
than to build that by hand on several machine.&lt;/p&gt;
&lt;p&gt;The ebuild is available on &lt;a class="reference external" href="https://github.com/wichtounet/wichtounet-overlay"&gt;my overlay&lt;/a&gt;. You can add the overlay to
your machine by modifying &lt;em&gt;/etc/layman/layman.cfg&lt;/em&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;overlays: http://www.gentoo.org/proj/en/overlays/repositories.xml
          http://github.com/wichtounet/wichtounet-overlay/raw/master/repository.xml&lt;/pre&gt;
&lt;p&gt;Then, you can add it to layman:&lt;/p&gt;
&lt;pre class="literal-block"&gt;layman -S
layman -a wichtounet&lt;/pre&gt;
&lt;p&gt;For now, I have created an ebuild for &lt;em&gt;opencv-2.4.8-r1&lt;/em&gt;. If someone is
interested in other versions, I'd be glad to create new ebuilds.&lt;/p&gt;
&lt;p&gt;I hope that this ebuild will be helpful.&lt;/p&gt;</description><category>clang</category><category>Gentoo</category><category>libc++</category><category>opencv</category><guid>https://baptiste-wicht.com/posts/2014/06/build-opencv-with-libcxx-on-gentoo-and-static-libs.html</guid><pubDate>Tue, 10 Jun 2014 12:09:29 GMT</pubDate></item></channel></rss>