mozart/mozart2

ClangConfig.cmake package configuration is missing

Closed this issue · 6 comments

Hi,
I've just tried to build mozart2 on my debian jessie 8.5 followed the instructions. When I'm trying to configure the build environment for mozart2 building I got the following error:

Could not find a package configuration file provided by "Clang" with any of
the following names:
ClangConfig.cmake
clang-config.cmake

vm/generator/main/CMakeLists.txt if trying to find this file but neither the clang source (in the instruction: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final/) nor the build llvm-release folder include this file.

This is my cmake command:
cmake -DCMAKE_BUILD_TYPE=Release -DGTEST_SRC_DIR=~/mozart2/projects/externals/gtest -DGTEST_BUILD_DIR=~/mozart2/projects/builds/gtest-debug -DLLVM_SRC_DIR=~/mozart2/projects/externals/llvm -DLLVM_BUILD_DIR=~/mozart2/projects/builds/llvm-release -DCMAKE_PREFIX_PATH=~/mozart2/projects/builds/llvm-release -DCLANG_SRC_DIR=~/mozart2/projects/externals/llvm/tools/clang ~/mozart2/projects/mozart2
Thanks in advance.
Karoly

layus commented

Well... Hmm... Yes :-).

Your issue is that the build steps have been updated but not the related documentation. To get ClangConfig.cmake (and LLVMConfig.cmake), you probably need a dev version of (lib)clang.
Ubuntu is shipping ClangConfig.cmake with its clang package[1], but I could not find it in the debian package.

If you cannot find that file, I would recommend to either

Do not hesitate to ask if you encounter more issues.

[1] http://packages.ubuntu.com/search?mode=exactfilename&suite=xenial&section=all&arch=any&keywords=ClangConfig.cmake&searchon=contents

Thanks Guillaume. I've tried the harder way first but I was failed. Anyway the second try the easy one worked.

layus commented

I'm glad it worked for you. If you have other issues, feel free to ask.

Your issue is that the build steps have been updated but not the related documentation.

Is there a brief outline of what the new build steps are? I can update the documentation if I manage to get a build going.

layus commented

My aim is to avoid LLVM/Clang for the end-user as these two are only required to generate boilerplate c++ headers, and change their internal API (which we use) with each release.
This is why there is ongoing work to release a pre-generated source archive, which is ATM available only at https://github.com/layus/mozart2/releases/v2.0.0-beta.0/ (file mozart2-2.0.0-beta.0-Source.zip).
This would follow the usual build process, but skipping the headers generation with LLVM/Clang, so you don't even need to configure and/or build these two.

Now, if you want to hack with mozart, and you happen to change the oz interface of some object (very unlikely), you may need to regenerate the headers, and provide the required version LLVM/Clang.
For these steps, the build has been changed. We no longer try to guess the location of LLVM/Clang, we expect to find ClangConfig.cmake in the cmake path. This file is shipped by some distros (Ubuntu, archlinux) but not others (debian). Anyway, you would get this file by compiling LLVM/Clang locally as described in the "outdated" build process. What remains to be explained is where to find these, and how to tell cmake where to find them.

I hope this all makes sense ?

Yes, that gives me something to go on, thanks.