0

I am looking for some assistance in figuring out the solution to an error that pops up during the configure command of Coreutils with llvm.

I use the command:

CC=wllvm ../configure --disable-nls CFLAGS="-g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__"

and receive the errors:

checking whether the compiler works...no
configure: error: in '/home/abhinath/coreutils/obj-llvm
configure: error: c compiler cannot create executables

I have run the command export LLVM_COMPILER=clang beforehand

I have installed and set up clang-6.0 and clang++-6.0 on my Ubuntu OS using the commands

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000
sudo update-alternatives --config clang
sudo update-alternatives --config clang++

The config.log file with errors generated can be viewed here, which also shows wllvm: command not found:

https://drive.google.com/open?id=1ExbLhT2tWRyGSAb67mAgu6D9y3AknZ2v

sepp2k
  • 363,768
  • 54
  • 674
  • 675
  • `CC=wllvm` - what is `wllvm`? llvm's C compiler is called `clang`. – Mat Mar 20 '20 at 19:52
  • @Mat wllvm is a C compiler, part of whole-program-llvm (WLLVM). I'm following the instructions from the tutorials on klee's github. Specifically step 3 from here https://klee.github.io/tutorials/testing-coreutils/ – Abhinath Kumar Mar 20 '20 at 19:59
  • Ok. Look at your log file and see what it has to say about `wllvm` – Mat Mar 20 '20 at 20:01
  • @Mat I've taken a look at the logs and it says wllvm: command not found ,as you can see too. Not sure how to address this – Abhinath Kumar Mar 20 '20 at 20:05
  • Have you searched your system for the program `wllvm`? Where is it installed? – Some programmer dude Mar 20 '20 at 20:09
  • If you did `pip install wllvm` as a non-root user, it probably installed the executables somewhere that isn't on your PATH. You'll probably have to find that directory and add it. You should probably make sure you can compile and run "hello world" with `wllvm` before trying to go on. – Nate Eldredge Mar 20 '20 at 20:15
  • @Someprogrammerdude its installed using pip install --upgrade wllvm . so its on the location /usr/local/lib/python2.7/site-packages – Abhinath Kumar Mar 20 '20 at 20:19
  • @NateEldredge Ah I see. I used the command `sudo -H python -m pip install wllvm` and it worked! – Abhinath Kumar Mar 20 '20 at 20:26

1 Answers1

1

Typically, nothing in /usr/local is included in the system directories.

And a non-standard location like usr/local/lib/python2.7/site-packages/some-directory even less so.

You need to find the exact location (as in full and absolute path) of the wllvm program and either use that full path or add its directory to the PATH environment variable.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621