LLVM_CONFIG_PATH when building Clang from sources

I'm trying to build LLVM, CFE and RT from sources on an old PowerMac
with OS X 10.5.

After download and unpack into LLVM_SOURCE_DIR (with
--strip-components=1), I configure with:

    cmake -DCMAKE_INSTALL_PREFIX="/opt/llvm" \
        -DLLVM_TARGETS_TO_BUILD="PowerPC" \
        -DLLVM_INCLUDE_TOOLS="ON" \
        -DLLVM_BUILD_TESTS="ON"
        "$LLVM_SOURCE_DIR"

It results in "llvm-config not found: specify LLVM_CONFIG_PATH". The
docs at https://llvm.org/docs/CMake.html don't appear to discuss
LLVM_CONFIG_PATH.

I'm building out-of-tree with these two variables:

    LLVM_SOURCE_DIR="$HOME/llvm_source"
    LLVM_BUILD_DIR="$HOME/llvm_build"

How should I fix the LLVM_CONFIG_PATH error?

Thanks in advance.

I'm trying to build LLVM, CFE and RT from sources on an old PowerMac
with OS X 10.5.

Which version of clang/llvm are you using?

-Tom

LLVM 7.0.

The script is available at
https://github.com/noloader/build-llvm/blob/master/build-llvm.sh

Jeff

I'm trying to build LLVM, CFE and RT from sources on an old PowerMac
with OS X 10.5.

Which version of clang/llvm are you using?

LLVM 7.0.

The script is available at
https://github.com/noloader/build-llvm/blob/master/build-llvm.sh

If I understand correctly, what you are doing with --strip-components is to
merge the the source trees into a single directory. This won't work. You
need to keep each project in its own directory and lay them out in a specific
way. You should review the getting started guide here:
https://llvm.org/docs/GettingStarted.html#getting-started-quickly-a-summary

-Tom

Thanks Tom.

Yeah, that's what I am doing.

Does LLVM have a script ready that does all of this? There's no reason
for me and other dev's to waste time on this.

Jeff

The script at https://github.com/noloader/build-llvm is doing pretty
good, but I can't seem to shake the missing __thread_local_data()
function. It causes failures on X6, Aarch64 and PowerPC (perhaps
others).

All the configurations I have tried end up dying like described at
https://stackoverflow.com/q/53356172/608639.

The guide at https://llvm.org/docs/GettingStarted.html does not appear
to have a procedure that avoids the failure. The FAQ at
https://llvm.org/docs/FAQ.html doe snot discuss the missing symbol,
either.

What is the trick to get things to compile?

Jeff

The script is available at
https://github.com/noloader/build-llvm/blob/master/build-llvm.sh

If I understand correctly, what you are doing with --strip-components is to
merge the the source trees into a single directory. This won't work. You
need to keep each project in its own directory and lay them out in a specific
way. You should review the getting started guide here:
https://llvm.org/docs/GettingStarted.html#getting-started-quickly-a-summary

Thanks Tom.

Yeah, that's what I am doing.

Does LLVM have a script ready that does all of this? There's no reason
for me and other dev's to waste time on this.

The script at https://github.com/noloader/build-llvm is doing pretty
good, but I can't seem to shake the missing __thread_local_data()
function. It causes failures on X6, Aarch64 and PowerPC (perhaps
others).

All the configurations I have tried end up dying like described at
https://stackoverflow.com/q/53356172/608639.

The guide at https://llvm.org/docs/GettingStarted.html does not appear
to have a procedure that avoids the failure. The FAQ at
https://llvm.org/docs/FAQ.html doe snot discuss the missing symbol,
either.

What is the trick to get things to compile?

You can try using the utils/release/test-release.sh script. This is what
release testers use to build and package the binaries. It does a lot
of extra stuff that you probably don't need, like staged compiler builds,
but it's a good reference to see if the standard configuration works on your
system.

I also noticed that you have a script for building cmake, what OS are you using
that doesn't have cmake3?

-Tom