LLVM development in Xcode

Hi,

I am trying to use the new LLVM-2.7 release in Xcode for my analysis and development.
However, I do not see the top level Xcode directory as in LLVM-2.6. Can someone tell me how
to develop on top of LLVM-2.7 using Xcode?

Best Regards,
Raj

Rajkishore Barik <rb5@rice.edu> writes:

I am trying to use the new LLVM-2.7 release in Xcode for my analysis
and development.
However, I do not see the top level Xcode directory as in LLVM-2.6.
Can someone tell me how
to develop on top of LLVM-2.7 using Xcode?

Try using cmake:

http://www.llvm.org/docs/CMake.html

In trying to set up a LLVM development environment, CMake seemed "too easy" - cmake <srctree>. No configuration options necessary whatsoever. But it worked, at least for Xcode on MacOS and for Visual Studio on Windows. Builds were successful. I have not tried running any of the output yet, though, since I don't yet have a front-end set up.
Yet in discussion here, a lot of people are referring to configure options and the like.
When or why should someone use configure instead of CMake or vice-versa? Are both equally well maintained? What configure options does an optionless CMake-created build environment most closely match?

TIA,
Richard

"Relph, Richard" <Richard.Relph@amd.com> writes:

In trying to set up a LLVM development environment, CMake seemed "too
easy" - cmake <srctree>. No configuration options necessary
whatsoever. But it worked, at least for Xcode on MacOS and for Visual
Studio on Windows. Builds were successful. I have not tried running
any of the output yet, though, since I don't yet have a front-end set
up.

It is advisable to set CMAKE_BUILD_TYPE to either Release or
Debug. Other variants (including "undefined") are not tested nor are
taken too much attention on the code.

Yet in discussion here, a lot of people are referring to configure
options and the like.

When or why should someone use configure instead of CMake or
vice-versa?

CMake is your only option for working with Visual Studio and other
IDEs. Some people prefer CMake because that's what they use for other
projects, or because they just enjoy using it.

configure is used because it was there since the beginning and because
it is much more popular on the *nix field. It has some other minor
advantages, like not requiring to install extra stuff.

Are both equally well maintained?

It depends. Out of the box, maybe the autoconf build has more features,
most of them rarely used and easily replicable on cmake. OTOH, some
features like building shared libraries are was recently added to the
autoconf build was on the cmake build since almost the
beginning. Sometimes a new key feature of LLVM is implemented on the
autoconf build and the cmake one is ignored by the author, nobody
dreaming of putting a requirement for only accepting the feature iff is
implemented on both systems. An instance of that was loadable modules,
IIRC. Other key features for subsets of LLVM users are still
unimplemented, as it is the case of the OCaml bindings. On this aspect,
the cmake build is like a stepchild who only counts for a few members
of the family.

The most clear advantages of the CMake build are its cross-platform
support, it's easy maintenance and its flexibility.

What configure options does an optionless CMake-created build
environment most closely match?

cmake -DCMAKE_BUILD_TYPE=Release should be a close match for configure
--enable-optimized. Same for Debug.