0

I'm fresh to KLEE, and tried to install and test it. I worked with the manual steps by steps, and it seems no exception mistakes, but how did this problem happened?

here is the command I input:

dazenhom@dazenhom-ThinkPad-S3-S440:~/Desktop/stp/klee/examples$ llvm-gcc --emit-llvm -c -g get_sign.c
gcc-4.7: error: unrecognised command line option ‘--emit-llvm’
gcc-4.7: error: get_sign.c: No such file or directory
gcc-4.7: fatal error: no input files
compilation terminated.

I searched for answer on the web, but do not understand this explanation:

"Add llvm-gcc to your PATH. It is important to do this first so that llvm-gcc is found in subsequent configure steps. llvm-gcc will be used later to compile programs that KLEE can execute. Forgetting to add llvm-gcc to your PATH at this point is by far the most common source of build errors reported by new users."

does someone encounter this situation like me?

2 Answers2

2

The explanation you found on the web is telling you to add the library to your PATH variable. This is an environment (system) variable for Windows operating systems, so if you're running something other than Windows this solution won't help you.

Assuming you are running Windows you can add it to your PATH the following way:

If you're using Windows 10:

  1. Right click start.
  2. Click "System".
  3. Click "Advanced System Settings" (in the left sidebar).
  4. Click "Environment Variables" under the "Advanced" tab.
  5. There you will see a variable named Path under "System Variables"; select it.
  6. Click "Edit".
  7. Click "New".
  8. Add the path to your library.

If you're using an older version of Windows the steps are the same untill step 7. There instead of clicking "New" you add the path to the end of the string, seperated by a ;. So it would look something like this previous\path;your\new\path.

If you need more information try having a look at this question, or this one about setting the environment variable.

Community
  • 1
  • 1
Bono
  • 4,477
  • 6
  • 43
  • 76
0

you can use command clang -emit-llvm -c -g get_sign.c -I../../include to get a bitcode file get_sign.bc, then run klee with command klee get_sign.bc.