title: error in installing opencv 3.3.0
body: <p>I'm trying to install OpenCV 3.3.0 based on these instructions:<br>
  <a href="http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/" rel="nofollow noreferrer">http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/</a><br>
  But I faced errors while running : </p>
  
  <pre><code>sudo cmake -D CMAKE_BUILD_TYPE=RELEASE 
             -D CMAKE_INSTALL_PREFIX=/usr/local     
             -D INSTALL_PYTHON_EXAMPLES=ON   
             -D INSTALL_C_EXAMPLES=OFF      
             -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules 
             -D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python     
             -D BUILD_EXAMPLES=ON ..
  </code></pre>
  
  <p>Here's my output in CLI:
  <a href="https://i.stack.imgur.com/Vjkxn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vjkxn.png" alt="CLI Output"></a></p>
  
  <p>A few minutes ago my cmake command was working properly but I had errors in <code>make -j4</code> command which was:</p>
  
  <pre><code>/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `ff_aac_demuxer' can not be used when making a shared object; recompile with -fPIC
  /usr/local/lib/libavformat.a: error adding symbols: Bad value
  collect2: error: ld returned 1 exit status
  modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:312: recipe for target 'lib/libopencv_videoio.so.3.3.0' failed
  make[2]: *** [lib/libopencv_videoio.so.3.3.0] Error 1
  CMakeFiles/Makefile2:4918: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
  make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....
  </code></pre>
  
  <p>But After I ran my cmake command with <code>fPIC</code> It started to show errors on cmake.The command I executed for <code>fPIC</code> option:</p>
  
  <pre><code>sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
   -D CMAKE_INSTALL_PREFIX=/usr/local \
   -D INSTALL_PYTHON_EXAMPLES=ON \
   -D INSTALL_C_EXAMPLES=OFF \
   -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
   -D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
   -D BUILD_EXAMPLES=ON \
   -D COMPILE_FLAGS+=-fPIC ..
  </code></pre>
  
  <p>My OS is Ubuntu 16.04 and I want to install openCV with python3 as interface.<br>
  Thanks in advance.</p>