error: ‘int pow(double, int)’ conflicts with a previous declaration int pow(double a, int n) {

151 views
Skip to first unread message

ahmad sedigh

unread,
Oct 24, 2019, 12:51:43 PM10/24/19
to Sniper simulator
Hi
My linux version is 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
My gcc version is 8.3.0
i want to compile and run Sniper 7.2 with Pin 3.5.
i am trying to compile benchmarks according to this post:
but i get this error: 
/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx:121:24: error: ‘int pow(double, int)’ conflicts with a previous declaration int pow(double a, int n) {
                        ^
In file included from /usr/include/c++/8/math.h:36,
                 from /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/common/RTInclude.hxx:18,
                 from /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/common/RTVec.hxx:4,
                 from /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/common/RTBox.hxx:4,
                 from /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx:3:
/usr/include/c++/8/cmath:399:3: note: previous declaration ‘double std::pow(double, int)’   pow(double __x, int __i)
                                                                                                                                                   ^~~

/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx:143:39: error: call of overloaded ‘pow(double, int)’ is ambiguous
     if (v.minIndex() != 1 || dv != pow(convert<DataType>(11), N)) {
                                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:424,
                 from /usr/include/time.h:25,
                 from /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:140:1: note: candidate: ‘double pow(double, double)’
 __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
 ^~~~~~~~~~~~~~


I tried the recommendations from stackflow and others even the note in the report file but nothing changes.
I find out pow() function should be like int pow(int a, int n) or double pow(double a, double n) but in TestRVec.cxx the deceleration is completely wrong.
TestRTVec.cc seems to be built by makefile and then get compiled afterwards because it is not in the sniper_benchmark.tar file so i cannot do anything with that. 
is my observation true and what should i do??

i post a few prior lines in make report below:

cd /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL && /usr/bin/g++  -std=gnu++98  -DTHIS_IS_CMAKE -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/libs/mesa/inst/amd64-linux.gcc-sniper/include -O3 -funroll-loops -fprefetch-loop-arrays -fpermissive -fno-exceptions -static-libgcc -Wl,--hash-style=both,--as-needed -DPARSEC_VERSION=2.1 -DENABLE_PARSEC_HOOKS -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/libs/hooks/inst/amd64-linux.gcc-sniper/include -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/tools/hooks -I/home/ahmad/sniper-latest/sniper-7.2/include -fexceptions -fno-strict-aliasing -fno-align-labels -DNDEBUG -D_MM_NO_ALIGN_CHECK  -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/libs/mesa/inst/amd64-linux.gcc-sniper/include -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/common -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/BVH -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/SG -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/LRT/include -I/home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/LRT   -D__ahmad__ -o CMakeFiles/test_rtvec.dir/test/TestRTVec/TestRTVec.o -c /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx



ahmad sedigh

unread,
Oct 24, 2019, 8:13:06 PM10/24/19
to Sniper simulator
Hi
I resolved this issue by changing the -std=gnu++98 in step 3 of the instruction to -std=gnu++17.
this was a recommendation on my question on stackoverflow.com here:
Reply all
Reply to author
Forward
0 new messages