Compilation errors when trying to do scons in util/tlm - gem5

I was trying to follow the README under util/tlm. Below are the steps completed:
scons build/ARM/gem5.opt - completed
scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 build/ARM/libgem5_opt.so - completed
cd util/tlm
scons - error
when I do scons from within util/tlm I see the following error:
scons: Reading SConscript files ...
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/tlm/sc_master_port.o -c -std=c++17 -DSC_INCLUDE_DYNAMIC_PROCESSES -DTRACING_ON -I/home/gem5/build/ARM -I/home/gem5/util/systemc/gem5_within_systemc -I/home/gem5/ext/systemc/src -Isrc -Iexamples/common build/tlm/sc_master_port.cc
build/tlm/sc_master_port.cc: In member function 'void Gem5SystemC::SCMasterPort::b_transport(tlm::tlm_generic_payload&, sc_core::sc_time&)':
build/tlm/sc_master_port.cc:278:32: error: 'gem5::sim_clock' has not been declared
(double)(ticks / gem5::sim_clock::as_int::ps), sc_core::SC_PS);
^~~~~~~~~
scons: *** [build/tlm/sc_master_port.o] Error 1
scons: building terminated because of errors.
Can you please help me out with how to resolve this?

For the above bug, I added #include "sim/core.hh" in the file "util/tlm/src/sc_master_port.cc"
Post that there are some namespace errors in few different files which I resolved by adding "using namespace gem5"

Related

Why is my MakeFile path setup getting a "No such file or directory" error?

I am trying to run a makefile. I think the makefile is trying to access this path:
/home/s/miniconda3/lib/python3.7/site-packages/tensorflow/include/unsupported/Eigen
But when I run it, I get a No such file or directory error:
(base) s#s-VirtualBox:~/Downloads/3d-psrnet-master$ make
make: Circular utils/tf_ops/cd/tf_nndistance_g.cu <- utils/tf_ops/cd/tf_nndistance_g.cu.o dependency dropped.
/usr/local/cuda-10.1/bin/nvcc -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o utils/tf_ops/cd/tf_nndistance_g.cu.o utils/tf_ops/cd/tf_nndistance_g.cu -I /home/s/miniconda3/lib/python3.7/site-packages -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2
utils/tf_ops/cd/tf_nndistance_g.cu:3:10: fatal error: include/unsupported/Eigen: No such file or directory
#include "include/unsupported/Eigen"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:12: utils/tf_ops/cd/tf_nndistance_g.cu.o] Error 1
I have it set like this at the top of makefile: tensorflow = /home/s/miniconda3/lib/python3.7/site-packages (which is the path that shows up if I type into Terminal pip show tensorflow)
And then in tf_nndistance_g.cu I have:
#include "include/unsupported/Eigen/"
What might be the reason that this makefile isn't working? I'm using Python 3.7 on a Virtual Machine (ubuntu Virtualbox). Thanks.

CMake project using ifort failed. "is not able to compile a simple test program."

I can compile the project using gfortran in both Linux and Windows with no error. But for some reason I have to use ifort.exe as compiler in Windows and it failed. Anyone can help?
The detailed information is as follows:
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: D:/Program Files/IVF/compilers_and_libraries_2018.3.210/windows/bin/intel64/ifort.exe
-- Check for working Fortran compiler: D:/Program Files/IVF/compilers_and_libraries_2018.3.210/windows/bin/intel64/ifort.exe- broken CMake Error at D:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestFortranCompiler.cmake:51 (message): The Fortran compiler
"D:/Program Files/IVF/compilers_and_libraries_2018.3.210/windows/bin/intel64/ifort.exe"
is not able to compile a simple test program. It fails with the following output:
Change Dir: C:/Users/xxx/build/CMakeFiles/CMakeTmp
Run Build Command(s):D:/PROGRA~2/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe cmTC_809ef/fast && mingw32-make.exe[1]: Entering directory 'C:/Users/xxx/build/CMakeFiles/CMakeTmp'
D:/PROGRA~2/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_809ef.dir\build.make CMakeFiles/cmTC_809ef.dir/build
mingw32-make.exe[2]: Entering directory 'C:/Users/xxx/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_809ef.dir/testFortranCompiler.f.obj
D:\PROGRA~2\IVF\COMPIL~1.210\windows\bin\intel64\ifort.exe /nologo /fpp /W1 /nologo /fpp /libs:dll /threads /Od /debug:full /dbglibs /FoCMakeFiles\cmTC_809ef.dir\testFortranCompiler.f.obj /FdCMakeFiles\cmTC_809ef.dir/ -c C:\Users xxx\build\CMakeFiles\CMakeTmp\testFortranCompiler.f
warning #31001: The dll for reading and writing the pdb (for example, mspdb110.dll) could not be found on your path. This is usually a configuration error. Compilation will continue using /Z7 instead of /Zi, but expect a similar err r when you link your program.
Linking Fortran executable cmTC_809ef.exe
"D:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_809ef.dir\link.txt --verbose=1
"D:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_809ef.dir --rc=rc --mt="" --manifests -- xilink /nologo #CMakeFiles\cmTC_809ef.dir\objects1.rsp /out:cmTC_809ef.exe /implib:cmTC_809ef.lib /pdb:C:\Users\xxx\build\CMakeFiles\CMakeTmp\cmTC_809ef.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL:YES /subsystem:console user32.lib
RC Pass 1: command "rc /fo CMakeFiles\cmTC_809ef.dir/manifest.res CMakeFiles\cmTC_809ef.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specified.mingw32-make.exe[2]: *** [CMakeFiles\cmTC_809ef.dir\build.make:107: cmTC_809ef.exe] Error -1 mingw32-
make.exe[2]: Leaving directory 'C:/Users/xxx/build/CMakeFiles/CMakeTmp'
mingw32-make.exe[1]: *** [Makefile:140: cmTC_809ef/fast] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/Users/xxx/build/CMakeFiles/CMakeTmp'
The error is because that the rc.exe cannot be found. I solved the problem by adding the file path to the PATH variable.

TensorFlow 1.1 “bazel build tensorflow/tools/graph_transforms:transform_graph"

When I build quantization tool use the command
"bazel build tensorflow/tools/graph_transforms:transform_graph"
The complie result as below:
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
ERROR: /root/tensorflow-master/tensorflow/core/BUILD:1287:1: C++ compilation of rule '//tensorflow/core:framework_internal' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 106 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
tensorflow/core/framework/reader_op_kernel.cc:20:61: error: definition of implicitly-declared 'tensorflow::ReaderOpKernel::ReaderOpKernel(tensorflow::OpKernelConstruction*)'
ReaderOpKernel::ReaderOpKernel(OpKernelConstruction* context)
^
tensorflow/core/framework/reader_op_kernel.cc:27:33: error: definition of implicitly-declared 'virtual tensorflow::ReaderOpKernel::~ReaderOpKernel()'
ReaderOpKernel::~ReaderOpKernel() {
^
tensorflow/core/framework/reader_op_kernel.cc:34:50: error: no 'void tensorflow::ReaderOpKernel::Compute(tensorflow::OpKernelContext*)' member function declared in class 'tensorflow::ReaderOpKernel'
void ReaderOpKernel::Compute(OpKernelContext* ctx) {
^
Target //tensorflow/tools/graph_transforms:transform_graph failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.989s, Critical Path: 5.02s
What's the problem?
Thanks!
Please try two things:
(1) configure the compile environment first and then compile, like
./configure
bazel build tensorflow/tools/graph_transforms:transform_graph
(2) You can also try:
sudo bazel build tensorflow/tools/graph_transforms:transform_graph
Point (2) worked for me sometimes to remove dependencies of including header files.
please download the latest tensorflow and bazel, if needed.

Scons "Dir" command doesn't work?

I've got a sub directory called "myc" containing 2 ".c" files:
$ ls myc
1.c f.c
And my current directory has a SConstruct:
$ cat SConstruct
myc=Dir('myc')
print myc
Program('test2',myc)
Run scons, it prints a bunch of errors:
$ scons
scons: Reading SConscript files ...
myc
scons: done reading SConscript files.
scons: Building targets ...
gcc -o test2 myc
/usr/bin/ld: cannot find myc: File format not recognized
collect2: error: ld returned 1 exit status
scons: *** [test2] Error 1
scons: building terminated because of errors.
What is weird: I expect the "print myc" will list "1.c" and "f.c", to my disappointment it prints "myc", not the varible value, and the compiling also fails.
How to correct it?
Not sure why you believe that specifying a directory as the source(s) for a directory would work?
Is there something in the docs which makes you believe this should work?
If so, please point it out so it can be improved.
If you did:
gcc -o blah some_dir_name
That wouldn't work right?
This should do what you're asking for.
myc=Glob('myc/*.c')
print myc
Program('test2',myc)

ALIZE platform installation

Could you, please, help me with this error. I'm trying to install alize-1.4 on Ubuntu from this site http://mistral.univ-avignon.fr/download_en.html. But I get such error at the end
make[1]: Leaving directory `/home/admin-pc/alize/src'
make: *** [all-recursive] Error 1 cp: cannot stat `src/libalize.a': No
such file or directory
Maybe someone of you used ALIZE code?
Thanks
So, according to the log the real error is
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libalize\" -DVERSION=\"0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -O3 -ffast-math -Wall -march=pentium4 -MT SegServerFileWriter.o -MD -MP -MF .deps/SegServerFileWriter.Tpo -c -o SegServerFileWriter.o SegServerFileWriter.cpp
SegServerFileWriter.cpp: In member function void alize::SegServerFileWriter::writeSegServerTrs(const alize::SegServer&):
SegServerFileWriter.cpp:299: error: 'qsort' was not declared in this scope
make[1]: *** [SegServerFileWriter.o] Error 1
This type of error is quite common when you compile old style C++ projects with newer gcc due to the restrictions of the new compiler
The easy way would be just to checkout the latest code with subversion, it has all such issues fixed:
svn checkout http://alize.univ-avignon.fr/svn/ALIZE/trunk/
Or to add #include <cstdlib> into the file header to import the qsort declaration.