Can't build clang 3.4.2

I can build llvm 3.4.2 fine, using instructions in GettingStarted.html,
and making assumptions to account for my using tar files instead of svn.
Although I had downloaded and extracted both llvm-3.4.2.src.tar.gz and
cfe-3.4.2.src.tar.gz, giving directories llvm-3.4.2.src and cfe-3.4.2.src,
clang apparently did not get built. The only files with names starting
with "clang" anywhere inside my llvm directory are Ascii text, C source,
or directories.

If I run ../cfe-3.4.2.src/make, (in my "build" directory, as suggested), I see:

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

There is no file by this name anywhere inside cfe-3.4.2.src, nor is there
one named configure either. Merging the files in llvm-3.4.2.src and cfe-3.4.2.src
is obviously wrong, since they contain various same-named but different files.

GettingStarted.html, get_started.html, the llvm FAQ, two README.txt and one INSTALL.txt
have not helped me.

"Rodney M. Bates" <rodney_bates@lcwb.coop> writes:

I can build llvm 3.4.2 fine, using instructions in GettingStarted.html,
and making assumptions to account for my using tar files instead of svn.
Although I had downloaded and extracted both llvm-3.4.2.src.tar.gz and
cfe-3.4.2.src.tar.gz, giving directories llvm-3.4.2.src and cfe-3.4.2.src,
clang apparently did not get built. The only files with names starting
with "clang" anywhere inside my llvm directory are Ascii text, C source,
or directories.

If I run ../cfe-3.4.2.src/make, (in my "build" directory, as suggested), I see:

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

There is no file by this name anywhere inside cfe-3.4.2.src, nor is there
one named configure either. Merging the files in llvm-3.4.2.src and
cfe-3.4.2.src
is obviously wrong, since they contain various same-named but different files.

GettingStarted.html, get_started.html, the llvm FAQ, two README.txt
and one INSTALL.txt
have not helped me.

The build system wants the clang directory to be nested inside the llvm
directory (under tools). I think the SVN instructions make this fairly
clear, since they tell you where to cd before checking out clang, but I
guess it's not obvious how that translates to source releases.

Given your llvm directory, you need clang to be found under
<llvm-dir>/tools/clang, so you can either extract cfe-3.4.2.src in
tools/ and rename it to clang, or make a symlink to the cfe directory
beside the llvm one (ie, tools/clang -> ../../../cfe-3.4.2.src)

Hope that helps!

Thanks, that got me going.

Rereading the directions in the light of this, do I correctly infer that
I should also move extracted directory compiler-rt-3.4 inside of
llvm-3.4.2.src/llvm/projects and rename it compiler-rt, and likewise
move test-suite-3.4 to the same place and rename it test-suite?

At least part of what confused me about the needed directory structure
was that there was a cfe-3.4.2.src/tools/clang (I tried running make
in there too), but llvm-3.2.4.src/tools contains no clang.

"Rodney M. Bates" <rodney_bates@lcwb.coop> writes:

"Rodney M. Bates" <rodney_bates@lcwb.coop> writes:

I can build llvm 3.4.2 fine, using instructions in GettingStarted.html,
and making assumptions to account for my using tar files instead of svn.
Although I had downloaded and extracted both llvm-3.4.2.src.tar.gz and
cfe-3.4.2.src.tar.gz, giving directories llvm-3.4.2.src and cfe-3.4.2.src,
clang apparently did not get built. The only files with names starting
with "clang" anywhere inside my llvm directory are Ascii text, C source,
or directories.

If I run ../cfe-3.4.2.src/make, (in my "build" directory, as
suggested), I see:

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

There is no file by this name anywhere inside cfe-3.4.2.src, nor is there
one named configure either. Merging the files in llvm-3.4.2.src and
cfe-3.4.2.src
is obviously wrong, since they contain various same-named but
different files.

GettingStarted.html, get_started.html, the llvm FAQ, two README.txt
and one INSTALL.txt
have not helped me.

The build system wants the clang directory to be nested inside the llvm
directory (under tools). I think the SVN instructions make this fairly
clear, since they tell you where to cd before checking out clang, but I
guess it's not obvious how that translates to source releases.

Given your llvm directory, you need clang to be found under
<llvm-dir>/tools/clang, so you can either extract cfe-3.4.2.src in
tools/ and rename it to clang, or make a symlink to the cfe directory
beside the llvm one (ie, tools/clang -> ../../../cfe-3.4.2.src)

Hope that helps!

Thanks, that got me going.

Rereading the directions in the light of this, do I correctly infer that
I should also move extracted directory compiler-rt-3.4 inside of
llvm-3.4.2.src/llvm/projects and rename it compiler-rt, and likewise
move test-suite-3.4 to the same place and rename it test-suite?

Yep, you've got it.

At least part of what confused me about the needed directory structure
was that there was a cfe-3.4.2.src/tools/clang (I tried running make
in there too), but llvm-3.2.4.src/tools contains no clang.

That seems a little odd. There is a tools/ directory in the cfe sources,
but it should have things like libclang/, clang-format/, and driver/ - I
wouldn't expect llvm/tools/clang/tools/clang to exist.

Well, it's not there in my directories now, nor is it in a freshly untarred
copy of cfe-3.4.2.src I tried a lot of things in my incorrect directory structure
before getting it right from your advice.