hpsresearchgroup / scarab

Joint HPS and ETH Repository to work towards open sourcing Scarab and Ramulator
MIT License
67 stars 36 forks source link

[Question] Running make in src/ fails #144

Open pwintz opened 1 year ago

pwintz commented 1 year ago

I've been trying to setup Sacrab on a Windows Linux Subsystem (Ubuntu). I've installed g++, gcc, Clang, and Python 3 using sudo apt install clang g++ gcc python3.

The versions that apt installed are

I was hoping that having newer versions of the dependencies would be OK, but when I run make in the src directory, I get an error that says, ‘setprecision’ was not declared in this scope. Is this a dependency problem or something else?

pwintz-2-in-1:~/code/scarab/src
$ make
make SCARAB_DIR=/home/pwintz/code/scarab/src pin_exec --directory pin/pin_exec   --no-print-directory
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
mkdir -p build/opt/
echo gcc
gcc
echo g++
g++
cd build/opt/; \
  CC=gcc      \
  CXX=g++     \
   ../.. -DCMAKE_BUILD_TYPE=ScarabOpt
/bin/sh: 2: ../..: Permission denied
make: *** [Makefile:89: build/opt/Makefile] Error 126
make: *** Waiting for unfinished jobs....
g++ -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -D__PIN__=1 -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2  -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin/gen -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/stlport/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/libstdc++/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/arch-x86_64 -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi/asm-x86 -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/components/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/xed-intel64/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/tools/InstLib -O3 -fomit-frame-pointer -fno-strict-aliasing  -std=c++14 -g3 -static -I/home/pwintz/code/scarab/src -Wno-error=deprecated-declarations  -c -o obj-intel64/analysis_functions.o analysis_functions.cc -DPIN_COMPILE
analysis_functions.cc: In function ‘void docount(UINT32)’:
analysis_functions.cc:39:13: error: ‘setprecision’ was not declared in this scope
   39 |          << setprecision(2)
      |             ^~~~~~~~~~~~
make[1]: *** [makefile.rules:97: obj-intel64/analysis_functions.o] Error 1
make: *** [Makefile:38: pin_exec] Error 2
kofyou commented 1 year ago

Hi, could you double check if you have cmake installed?

pwintz commented 1 year ago

Thanks, that looks like it was part of the problem; I did not have cmake installed. I've now installed it, and make gets further, but it still ends with error: ‘setprecision’ was not declared in this scope.

pwintz-2-in-1:~/code/scarab/src
$ make
make SCARAB_DIR=/home/pwintz/code/scarab/src pin_exec --directory pin/pin_exec   --no-print-directory
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
mkdir -p build/opt/
echo gcc
gcc
echo g++
g++
cd build/opt/; \
  CC=gcc      \
  CXX=g++     \
  /usr/bin/cmake ../.. -DCMAKE_BUILD_TYPE=ScarabOpt
mkdir -p obj-intel64/
invoking compile
g++ -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -D__PIN__=1 -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2  -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin/gen -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/stlport/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/libstdc++/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/arch-x86_64 -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi/asm-x86 -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/components/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/xed-intel64/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/tools/InstLib -O3 -fomit-frame-pointer -fno-strict-aliasing  -std=c++14 -g3 -static -I/home/pwintz/code/scarab/src -Wno-error=deprecated-declarations  -c -o obj-intel64/pin_exec.o pin_exec.cpp -MD -DPIN_COMPILE
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
'/usr/bin/python3.8' '/home/pwintz/code/scarab/src/deps/xed/mfile.py'
g++ -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -D__PIN__=1 -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2  -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/include/pin/gen -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/stlport/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/libstdc++/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/arch-x86_64 -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi -isystem /home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/crt/include/kernel/uapi/asm-x86 -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/components/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/extras/xed-intel64/include -I/home/pwintz/code/scarab/pins/PIN-Play_3.5/source/tools/InstLib -O3 -fomit-frame-pointer -fno-strict-aliasing  -std=c++14 -g3 -static -I/home/pwintz/code/scarab/src -Wno-error=deprecated-declarations  -c -o obj-intel64/analysis_functions.o analysis_functions.cc -DPIN_COMPILE
[PYTHON VERSION] 3.8.10
[GIT VERSION] 12.0.1-72-gd57a3bd
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/files-xregs.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/via/files-via-padlock.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/amd/files-amd.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/amd/amdxop/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/mpx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/cet/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/rdrand/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/glm/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/sha/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/xsaveopt/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/xsaves/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/xsavec/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/clflushopt/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/rdseed/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/fsgsbase/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/smap/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/sgx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/rdpid/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/pt/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/tremont/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/movdir/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/waitpkg/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/cldemote/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/sgx-enclv/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx/files.cfg
[Clearing file list for type dec-spine: [ /home/pwintz/code/scarab/src/deps/xed/datafiles/xed-spine.txt ]]
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/ivbavx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/hswavx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/hswbmi/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/hsw/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/bdw/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/skl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/skx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/pku/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/clwb/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/clx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/vnni/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/cpx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512-bf16/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/knl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/knm/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/4fmaps-512/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/4vnniw-512/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/vpopcntdq-512/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512f/shared-files.cfg
[Clearing file list for type dec-spine: [ /home/pwintz/code/scarab/src/deps/xed/datafiles/avx/avx-spine.txt ]]
[CONSIDERING SOURCE] /home/pwintz/code/scarab/src/deps/xed/datafiles/knc/xed-operand-values-interface-uisa.c source 1
[ADDING SOURCE] /home/pwintz/code/scarab/src/deps/xed/datafiles/knc/xed-operand-values-interface-uisa.c source 1
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512f/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512cd/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512-skx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/cnl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512ifma/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512vbmi/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/icl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/wbnoinvd/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/pconfig/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/bitalg/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/vbmi2/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/gfni-vaes-vpcl/files-sse.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/gfni-vaes-vpcl/files-avx-avx512.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/vpopcntdq-vl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/tgl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/vp2intersect/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/keylocker/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/adl/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/hreset/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx-vnni/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/spr/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/uintr/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/amx-spr/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/enqcmd/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/tsx-ldtrk/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/serialize/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/tdx/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/avx512-fp16/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/evex-map5-6/files.cfg
[EXTF PROCESSING] /home/pwintz/code/scarab/src/deps/xed/datafiles/future/files.cfg
[REUSING BUILD DEFINES HEADER FILE]
R: 0 P: 0 C: 0 E: 0 / 21 msecs
R: 0 P: 0 C: 0 E: 0 / 7 msecs
[XED KIT BUILD COMPLETE]
[ELAPSED TIME] 1 secs
[RETVAL=0]
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pwintz/code/scarab/src/build/opt
analysis_functions.cc: In function ‘void docount(UINT32)’:
analysis_functions.cc:39:13: error: ‘setprecision’ was not declared in this scope
   39 |          << setprecision(2)
      |             ^~~~~~~~~~~~
make[1]: *** [makefile.rules:97: obj-intel64/analysis_functions.o] Error 1
make: *** [Makefile:38: pin_exec] Error 2
petervbraun commented 1 year ago

I was able to compile on WSL with pinplay 3.5. Since I'm not sure where that is hosted online anymore, here is the copy I am using: https://drive.google.com/drive/folders/1KqUUOHzuKc8Hsw-vj3lZ_9UK2qJyWcM1?usp=share_link

pwintz commented 1 year ago

Thanks, @petervbraun. Using the version of pinplay 3.5 you provided allowed me to compile successfully.

pwintz commented 1 year ago

Actually, it looks like linking the scarab executable fails. Any ideas why?

pwintz-2-in-1:~/code/scarab/src
$ make
make SCARAB_DIR=/home/pwintz/code/scarab/src pin_exec --directory pin/pin_exec   --no-print-directory
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
invoking link
g++ -shared -Wl,--hash-style=sysv /home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/intel64/runtime/pincrt/crtbeginS.o -Wl,-Bsymbolic -Wl,--version-script=/home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/source/include/pin/pintool.ver -fabi-version=2   -std=c++14  -o obj-intel64/pin_exec.so obj-intel64/pin_exec.o obj-intel64/analysis_functions.o obj-intel64/globals.o obj-intel64/main_loop.o obj-intel64/exception_handling.o obj-intel64/scarab_interface.o obj-intel64/x87_stack_delta.o obj-intel64/pin_scarab_common_lib.o obj-intel64/gather_scatter_addresses.o obj-intel64/message_queue_interface_lib.o obj-intel64/decoder.o obj-intel64/x86_decoder.o  -L/home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/intel64/runtime/pincrt -L/home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/intel64/lib -L/home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/intel64/lib-ext -L/home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/extras/xed-intel64/lib -lpin -lxed /home/pwintz/code/scarab/pins/pinplay-drdebug-3.5-pin-3.5-97503-gac534ca30-gcc-linux/intel64/runtime/pincrt/crtendS.o -lpin3dwarf  -ldl-dynamic -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic
make[1]: warning: -j0 forced in submake: resetting jobserver mode.
[  0%] Built target generate_syslog
[  5%] Built target ramulator
...
[ 87%] Built target drmemtrace
[ 87%] Linking CXX executable scarab
/usr/bin/ld: cannot find -lsnappy
/usr/bin/ld: cannot find -lconfig++
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/scarab.dir/build.make:1183: scarab] Error 1
make[2]: *** [CMakeFiles/Makefile2:819: CMakeFiles/scarab.dir/all] Error 2
make[1]: *** [Makefile:152: all] Error 2
make: *** [Makefile:79: build/opt/scarab_phony] Error 2
kofyou commented 1 year ago

Could you try sudo apt-get install libsnappy-dev libconfig++-dev

pwintz commented 1 year ago

Yeah, that fixed the problem. Thanks!

pwintz commented 1 year ago

Maybe those should be added to the software requirements?