writing transforms newbie question

Hi,

I apologize if this is a duplicate question; I didn't see it previously on the list. I'm using llvm 1.6 and my setup is as follows. LLVM is installed at /usr/software/llvm and the cfrontend is installed at /usr/software/cfrontend.

If I cd to /usr/software/llvm/lib/Transforms/Hello and compile the Hello transform I have no problems. However, if I copy the Hello directory to my home directory and change the makefile so the LEVEL points to /usr/software/llvm I get the following error message:

Makefile:15: /Makefile.common: No such file or directory
make: *** No rule to make target `/Makefile.common'. Stop.

The same thing happens if I try to set LEVEL to something like ../../../usr/software/llvm.

Do I need my transform in the LLVM lib/Transforms directory to build it? Are there other variables I need to set in the makefile?

Regards,
Ryan

Hi,

I apologize if this is a duplicate question; I didn't see it previously
on the list. I'm using llvm 1.6 and my setup is as follows. LLVM is
installed at /usr/software/llvm and the cfrontend is installed at
/usr/software/cfrontend.

If I cd to /usr/software/llvm/lib/Transforms/Hello and compile the Hello
transform I have no problems. However, if I copy the Hello directory to
my home directory and change the makefile so the LEVEL points to
/usr/software/llvm I get the following error message:

I assume you did something like:
LEVEL = /usr/software/llvm

If so, you can't do that. :slight_smile: The LEVEL must be a relative path from the
local directory and it must also be the case that it is a subdirectory
of LLVM tree.

I think what you want is an LLVM makefile project. Please take a look
at the "sample" project (llvm/projects/sample) and also:

http://llvm.org/docs/MakefileGuide.html

Makefile:15: /Makefile.common: No such file or directory
make: *** No rule to make target `/Makefile.common'. Stop.

Its trying to find the LLVM Makefile.common file but not succeeding
because of the way it uses the LEVEL variable.

The same thing happens if I try to set LEVEL to something like
../../../usr/software/llvm.

That, however, I would expect to work. Not sure why it doesn't. What
happens if you do this?

Do I need my transform in the LLVM lib/Transforms directory to build it?
  Are there other variables I need to set in the makefile?

Please see the Makefile Guide. You can set your own project up using the
LLVM Makefile system.

Reid.

I use the llvm-config utility with g++, eg.

g++ myfile.o `llvm-config --ldflags` `llvm-config --libs` -lpthread -ldl -o mytest

Simon.