How to use the personal gcc when compiling the tvm

My computer is centos7 with gcc 4.8.5. So, I create a new gcc-5.4 to support the mininal requirement of tvm. But when compiling the tvm source code, the Makefile error message as following,

 /bin/c++ -DDMLC_USE_FOPEN64=0 -DDMLC_USE_LOGGING_LIBRARY="<tvm/runtime/logging.h>" -DNDEBUG -DNDEBUG=1 -DTVM_INDEX_DEFAULT_I64=1 -DTVM_LLVM_VERSION=140 -DTVM_THREADPOOL_USE_OPENMP=0 -DTVM_USE_LIBBACKTRACE=1 -DUSE_FALLBACK_STL_MAP=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/peter/code/tvm/include -I/home/peter/code/tvm/build/libbacktrace/include -I/home/peter/code/tvm/topi/include -I/home/peter/code/tvm/3rdparty/libcrc/include -isystem /home/peter/code/tvm/3rdparty/dlpack/include -isystem /home/peter/code/tvm/3rdparty/dmlc-core/include -isystem /home/peter/code/tvm/3rdparty/rang/include -isystem /home/peter/code/tvm/3rdparty/compiler-rt -isystem /home/peter/code/tvm/3rdparty/picojson -isystem /da1/home/chenguang/code/llvm/include -std=c++14 -O2 -Wall -fPIC  -MD -MT CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o -MF CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o.d -o CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o -c /home/peter/code/tvm/src/arith/analyzer.cc
c++: error: unrecognized command line option β€˜-std=c++14’
make[2]: *** [CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o] Error 1
make[2]: Leaving directory `/da1/home/chenguang/code/tvm/build'
make[1]: *** [CMakeFiles/tvm_objs.dir/all] Error 2
make[1]: Leaving directory `/da1/home/chenguang/code/tvm/build'
make: *** [all] Error 2

It can see that the default c++ compiler is on /bin/c++, but I wanna use my personal cpp env to compile tvm.

So, my question is where can I find the CMAKE properity to modify the default c++ option.

It’s seem to find the soultion, just set as follow set(CMAKE_C_COMPILER β€œ/usr/bin/mygcc”) set(CMAKE_CXX_COMPILER β€œ/usr/bin/myg++”)

2 Likes