MadHatter
MadHatter

Reputation: 351

cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast' error while compiling with mkl and GNU C/C++

After invoking C++ compiler the make failes with the following error.

 cc1plus: error: argument to '-O' should be a non-negative integer, 
'g', 's' or 'fast'

Here is the line from my make file I edited.

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"

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?

In /opt/intel/composer_xe_2013.5.192/mkl/lib/intel64 path I can see a lot of library files.

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

Upvotes: 0

Views: 6168

Answers (1)

Klas Lindbäck
Klas Lindbäck

Reputation: 33273

The error message is for for the -O-1 compile argument. -O controls the optimization level.

I don't know what optimization level you want, byt there is no level called -1. You could use -O1 or simply omit it altogether.

Upvotes: 1

Related Questions