Richard,
I do my local build using tarballs generated from current trunk
svn pulls. The rough formula I use (after these are extracted) are...
cd llvm-3.7.0.src
mv ../cfe-3.7.0.src tools/clang
mv ../compiler-rt-3.7.0.src projects/compiler-rt
mv ../libcxx-3.7.0.src projects/libcxx
mv ../openmp-3.7.0.src projects/openmp
You will probably need to explicit support for checking out openmp here to
llvm/projects/CMakeLists.txt, in order to get the "same as libcxx" behavior
that Chandler is requesting.
mv ../polly-3.7.0.src tools/polly
mv ../clang-tools-extra-3.7.0.src tools/clang/tools/extra
mkdir build
cd build
cmake -DLLVM_BUILD_32_BITS:BOOL=OFF -DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_ENABLE_ASSERTIONS=OFF -DCMAKE_BUILD_TYPE=Release
-DLIBOMP_OSX_ARCHITECTURES="x86_64;i386" \
-DCMAKE_OSX_SYSROOT:STRING=/
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" \
-DLLVM_ENABLE_LIBCXX=ON -DLIBCXX_LIBCPPABI_VERSION=""
-DENABLE_CLANG_OPENMP=ON ..
make VERBOSE=1
As promised, I tried this out on a Linux machine. Here's what I did:
* check out all the pieces, including putting
http://llvm.org/svn/llvm-project/openmp/trunk/ into llvm/projects/openmp
* run cmake without specifying any special flags (this should "just work")
* build
* run clang from build area and test
Here's what I got:
# From cmake:
CMake Warning (dev) at projects/openmp/runtime/src/CMakeLists.txt:26
(add_custom_command):
Policy CMP0040 is not set: The target in the TARGET signature of
add_custom_command() must exist. Run "cmake --help-policy CMP0040" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.
The target name "common" is unknown in this context.
It looks like the cmake build is not correctly configured here. I'm not
sure whether these custom commands are the right way to handle these header
files, but the TARGET should presumably be "libomp-common" or "libomp-mod",
not just "common" or "mod". I assume this will be fixed by the cmake build
system rework.
# From build:
*Lots* of warnings, but a successful build. These warnings should be fixed
(or, where appropriate, suppressed), but I don't personally think that
needs to be a prerequisite for changing the default value of -fopenmp=.
# From running Clang with -fopenmp=libomp:
Everything I tested works fine (the not-yet-installed library is not found,
but that seems like the right behaviour if we expect this library to live
in /usr/lib rather than in a compiler-specific library area). However, I
couldn't find a make target to run the libomp tests, and I couldn't find a
target to install the libomp runtime.
This builds the libomp.dylib as a fat binary on x86_64 darwin (for