lli -force-interpreter Error - llvm

When I try to run this command
lli -force-interpreter file.ll
I have this error
LLVM ERROR: Tried to execute an unknown external function: posix_memalign
Also, when I search for this error I found this link
How could I solve this problem?

Related

g++: fatal error: cannot execute 'as': CreateProcess: No such file or directory compilation terminated

Hello, I'm trying to learn c++, having installed VStudio Code and MinGW, I was ready to get started but when I try to run the code it says this error:
g++: fatal error: cannot execute 'as': CreateProcess: No such file or directory
compilation terminated.
I tried searching for answers to this error but I so far no luck. What can I do to fix this error? what is causing this error?
You have to install MinGW's binutils before you use any compiler of GCC, try to find out it in the MinGW get program.

Bazel Build Permission denied

Recently, I'm trying to learn the NVidia Isaac which is built by Bazel.
While I was following the document here:
https://docs.nvidia.com/isaac/isaac/doc/getting_started.html#running-an-application
I encountered an error kept saying the cpp files Bazel need to build is "Permission denied".
The error message looks like below:
Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: engine/alice/components/Subprocess.cpp: Permission denied
gcc: fatal error: no input files
compilation terminated.
ERROR: /home/acas/HDD/CatDog/Isaak/engine/alice/BUILD:23:1: Couldn't build file engine/alice/_objs/impl/ReplayBridge.o: C++ compilation of rule '//engine/alice:impl' faed (Exit 1) crosstool_wrapper_driver_is_not_gcc_host.py failed: error executing command external/toolchain/crosstool/scripts/crosstool_wrapper_driver_is_not_gcc_host.pyD_DEFAULT_SOURCE -U_FORTIFY_SOURCE -fstack-protector -Wall -Werror -B/usr/bin -Wunused-but-set-parameter ... (remaining 183 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: engine/alice/components/ReplayBridge.cpp: Permission denied
gcc: fatal error: no input files
compilation terminated.
ERROR: /home/acas/HDD/CatDog/Isaak/engine/gems/image/BUILD:42:1: Couldn't build file engine/gems/image/_objs/cuda_conversions/yuv2rgb.cu.o: error while parsing .d file:root/.cache/bazel/_bazel_root/6ab44b9a455585caa8f9f5f55ddd002b/execroot/com_nvidia_isaac/bazel-out/k8-opt/bin/engine/gems/image/_objs/cuda_conversions/yuv2rgb.cu.d (No ch file or directory)
gcc: error: engine/gems/image/cuda/yuv2rgb.cu.cpp: Permission denied
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
Target //apps/samples/stereo_dummy:stereo_dummy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6.627s, Critical Path: 0.62s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 0 processes.
FAILED: Build did NOT complete successfully
And so much the same "Permission denied" error.
I've tried root, sudo, but none of that works.
Is anyone has the same Bazel problem (I think this problem is not about NVidia Isaac but Bazel)?

Is it possible to compile c++ using Clang only on windows?

I really tried a lot. Clang does not come with standard C++ includes, and obviously can not find them :
clang++ file.cpp -o file.out
C:\Folder\file.cpp:1:11: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
Passing the mingw includes by arguments, it returns another error:
clang++ -target x86_64-w64-mingw32 C:\Folder\file.cpp -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++ -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32 -IC:\MinGW\mingw64\x86_64-w64-mingw32\include -o C:\Folder\file.out -std=c++11
clang++.exe: error: unable to execute command: program not executable
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
When I use -c it does not use the linker and also not generate an executable file.
Edit : I'm running on windows
Run your commands from "x64 Native Tools Command Prompt for VS 2017", or something similar. It will setup some required env vars for you.

Compile cling bug

I'm trying to compile Cling (followed build instructions) and i'm unable to find bug reports maillist:
llvm[4]: Compiling AutoSynthesizer.cpp for Debug+Asserts build
llvm[4]: Compiling AutoloadCallback.cpp for Debug+Asserts build
/Users/asmirnov/Documents/dev/src/llvm_cling/tools/cling/lib/Interpreter/AutoloadCallback.cpp:16:67: error:
expected a class or namespace
= sema.getDiagnostics().getCustomDiagID (DiagnosticsEngine::Level::Warning,
~~~~~~~~~~~~~~~~~~~^
1 error generated.
make[4]: *** [/Users/asmirnov/Documents/dev/src/llvm_cling_build/tools/cling/lib/Interpreter/Debug+Asserts/AutoloadCallback.o] Error 1
Use -enable-cxx11 configure option. Updated build tutorial after it.

Compile errors with Assembler messages

I'm working with Point Cloud Library. It's mostly in C++ When I compile it, gives such error:
[ 0%] Building CXX object common/CMakeFiles/pcl_common.dir/src/intersections.cpp.o
In file included from /home/lv/pcl-trunk/common/include/pcl/point_types.h:301:0,
from /home/lv/pcl-trunk/common/include/pcl/common/impl/common.hpp:41,
from /home/lv/pcl-trunk/common/include/pcl/common/common.h:186,
from /home/lv/pcl-trunk/common/include/pcl/common/intersections.h:41,
from /home/lv/pcl-trunk/common/src/intersections.cpp:38:
/home/lv/pcl-trunk/common/include/pcl/impl/point_types.hpp:1009:68: warning: ‘SHOT’ is deprecated [-Wdeprecated-declarations]
/tmp/ccRLy4Re.s: Assembler messages:
/tmp/ccRLy4Re.s:2488: Error: no such instruction: `vfmadd312ss (%r9),%xmm2,%xmm1'
/tmp/ccRLy4Re.s:2638: Error: no such instruction: `vfmadd312ss (%rdx),%xmm2,%xmm1'
/tmp/ccRLy4Re.s:3039: Error: no such instruction: `vfmadd312ss (%rax,%r11,4),%xmm5,%xmm1'
/tmp/ccRLy4Re.s:3402: Error: no such instruction: `vfmadd312ss (%rax,%r11,4),%xmm5,%xmm1'
/tmp/ccRLy4Re.s:3534: Error: no such instruction: `vfmadd312ss (%rax,%rdx,4),%xmm1,%xmm2'
/tmp/ccRLy4Re.s:3628: Error: no such instruction: `vfmadd312ss (%rax,%rdx,4),%xmm1,%xmm2'
/tmp/ccRLy4Re.s:6103: Error: no such instruction: `vfmadd312ss (%r11),%xmm0,%xmm4'
/tmp/ccRLy4Re.s:6121: Error: no such instruction: `vfmadd312ss (%r11,%rbx,4),%xmm0,%xmm3'
/tmp/ccRLy4Re.s:6131: Error: no such instruction: `vfmadd312ss (%r11,%rbp,4),%xmm0,%xmm2'
/tmp/ccRLy4Re.s:6135: Error: no such instruction: `vfmadd312ss (%r11,%r13,4),%xmm0,%xmm1'
/tmp/ccRLy4Re.s:6344: Error: no such instruction: `vfmadd312ss (%r10),%xmm0,%xmm1'
/tmp/ccRLy4Re.s:11760: Error: no such instruction: `vfnmadd312ss (%rdx),%xmm0,%xmm0'
/tmp/ccRLy4Re.s:13976: Error: no such instruction: `vfmadd312ss (%rdi),%xmm0,%xmm1'
/tmp/ccRLy4Re.s:14125: Error: no such instruction: `vfmadd312ss (%rdx),%xmm0,%xmm1'
make[2]: *** [common/CMakeFiles/pcl_common.dir/src/intersections.cpp.o] Error 1
make[1]: *** [common/CMakeFiles/pcl_common.dir/all] Error 2
make: *** [all] Error 2
Could anyone tell me how to read these errors and give me some suggestions to solve?
You can use the command below to see what is your CPU (for the compiler):
gcc -march=native -Q --help=target | grep march
Then you can add your cpu type in the ccmake CMAKE_CXX_FLAGS option, for me:
CMAKE_CXX_FLAGS = -march=corei7-avx
You can add -march=native -mno-avx This worked for me.
In my CMakeLists.txt, I added the above to the CMAKE_CXX_FLAGS :
SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++0x -march=native -mno-avx")
[Source can be found in this page.]
I faced this issue when trying to install glove.
The problem I faced was resolved by upgrading the g++ version installed in my ubuntu 14.04 machine.
My original g++ version was 4.6.4 and I upgraded it to the g++-5 (5.4.1 when I upgraded it).
There are error message from assembler, which means assembler doesn't know these assembly code, for example vfmadd312ss.
This happens when compiler generate some CPU only assembly code, for example intel E5 with arch core-avx2 have extra instruction set advanced vector extensions, but if "as" is tool old to know the new CPUs, this error would happen.
Try a new version Binutils, the latest is 2.29 now.
If you compile code from another tool, for example bazel, make sure it will call the new "as".
Have you tried using a different compiler?
I had assembler errors in a project using Point Cloud Library. It was possibly due to using Ubuntu 12.04 on an core i7 processor (see https://github.com/uzh-rpg/rpg_svo/issues/7).
I was able to compile by installing the 'clang' compiler
sudo apt-get install clang
and then running cmake with:
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
I have met the same error messages,
I removed the -march=native from CXXFLAGS and CFLAGS in my makefile,
it works in my case. But since you didn't put out your makefile, I am not sure this will works in your case, any way you can have a try.
You probably need to enable advanced vector extensions when compiling (and use toolchain that supports this). Try -march=core-avx2 or something similar.
If you compiled library yourself, it is possible you need to configure it to not use AVX.