Reputation: 81
I am running a program called verilator.
I run the following command
verilator --build -Wall --trace -cc alu.sv
The above command needs a c++ compiler to work with. So the above command in turn tries to compile/generate c++ object files which makes it call the g++ compiler.
I get the following error
/homes/tinebp/tools/gnu/bin/g++-10 -I. -MMD -I/home/verilator/include -I/home/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow -std=gnu++14 -Os -c -o Valu__ALL.o Valu__ALL.cpp
make: /homes/tinebp/tools/gnu/bin/g++-10: Command not found
make: *** [Valu__ALL.o] Error 127
The path /homes/tinebp/tools/gnu/bin/g++-10
does NOT exist. I do not understand why it is using that path??
I do not have a Makefile so the make cmd is using implicit rules. Idk where is it taking the compiler path from. Below are compiler paths
I manually checked and set the paths but I still the error. Here are c++ compiler paths.
$ echo $CXX
/package/gcc/11.2.0/bin/g++
$ which gcc
/package/gcc/11.2.0/bin/gcc
$ which g++
/package/gcc/11.2.0/bin/g++
$ echo $CC
g++
Upvotes: 2
Views: 413
Reputation: 30830
These paths are copied from the settings present at compile time:
AR = @AR@
CXX = @CXX@
LINK = @CXX@
OBJCACHE ?= @OBJCACHE@
PERL = @PERL@
PYTHON3 = @PYTHON3@
You will need to edit the installed include/verilated.mk
file and revert the hard-coded paths to generic ones (eg CXX=g++
so you can use PATH-based lookups) OR change them to use ?=
instead, which allows overriding them from environment variables.
EDIT: You should contact whoever compiled this program for you and tell them to compile without setting CXX
and other environment variables.
Upvotes: 1