title: cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast' error while compiling with mkl and GNU C/C++
body: <p>After invoking C++ compiler the make failes with the following error.</p>
  
  <pre><code> cc1plus: error: argument to '-O' should be a non-negative integer, 
  'g', 's' or 'fast'
  </code></pre>
  
  <p>Here is the line from my make file I edited.</p>
  
  <pre><code>g++ -g -O-1 -std=gnu++11 -L/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64 -
  lmkl_gnu_thread -I/home/.../include  -DDEBUG -DMKL_ILP64 -MMD -MP -
  MF"simgms_init.d" -MT"simgms_init.d" -c -o "simgms_init.o" 
  "../simgms_init.cpp"
  </code></pre>
  
  <p>I think I've got the lib file wrong. I already tried several combinations of files since I'm not sure if I need to use dynamic libs or static libs. When do we chose dynamic libraries and when do we chose static libraries?</p>
  
  <p>In /opt/intel/composer_xe_2013.5.192/mkl/lib/intel64 path I can see a lot of library files.</p>
  
  <pre><code>libmkl_avx.so
  libmkl_avx2.so
  libmkl_blacs_ilp64.a
  libmkl_blacs_intelmpi_ilp64.a
  libmkl_blacs_intelmpi_ilp64.so
  libmkl_blacs_intelmpi_lp64.a
  libmkl_blacs_intelmpi_lp64.so
  libmkl_blacs_lp64.a
  libmkl_blacs_openmpi_ilp64.a
  libmkl_blacs_openmpi_lp64.a
  libmkl_blacs_sgimpt_ilp64.a
  libmkl_blacs_sgimpt_lp64.a
  libmkl_blas95_ilp64.a
  libmkl_blas95_lp64.a
  libmkl_cdft_core.a
  libmkl_cdft_core.so
  libmkl_core.a
  libmkl_core.so
  libmkl_def.so
  libmkl_gf_ilp64.a
  libmkl_gf_ilp64.so
  libmkl_gf_lp64.a
  libmkl_gf_lp64.so
  libmkl_gnu_thread.a
  libmkl_gnu_thread.so
  libmkl_intel_ilp64.a
  libmkl_intel_ilp64.so
  libmkl_intel_lp64.a
  libmkl_intel_lp64.so
  libmkl_intel_sp2dp.a
  libmkl_intel_sp2dp.so
  libmkl_intel_thread.a
  libmkl_intel_thread.so
  libmkl_lapack95_ilp64.a
  libmkl_lapack95_lp64.a
  libmkl_mc.so
  libmkl_mc3.so
  libmkl_p4n.so
  libmkl_pgi_thread.a
  libmkl_pgi_thread.so
  libmkl_rt.so
  libmkl_scalapack_ilp64.a
  libmkl_scalapack_ilp64.so
  .
  .
  .
  libmkl_vml_p4n.so
  </code></pre>