On Tuesday, 13 November 2012 13:15:52 UTC+1, David Nadlinger wrote:
> Setting the LLVM_CONFIG CMake variable to the path of the llvm-config
> binary of the installation you want to use (e.g. using ccmake) should do
> the trick.
Cool, will look into that. I tried setting the CMAKE_PREFIX_PATH but that failed with the following error:
------------------------------------------------------------------------
-- Found LLVM: /home/joseph/opt/clang+llvm-3.1 (found suitable version "3.1", required is "3.0")
-- Could NOT find LIBCONFIG++ (missing: LIBCONFIG++_INCLUDE_DIR LIBCONFIG++_LIBRARY)
-- Using path for llvm/Intrinsics.td: /home/joseph/opt/clang+llvm-3.1/include
-- Looking for _SC_ARG_MAX
-- Looking for _SC_ARG_MAX - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBCONFIG++_INCLUDE_DIR
used as include directory in directory /home/joseph/code/D/ldc
used as include directory in directory /home/joseph/code/D/ldc/runtime
used as include directory in directory /home/joseph/code/D/ldc/tests/d2
LIBCONFIG++_LIBRARY
linked by target "ldc2" in directory /home/joseph/code/D/ldc
------------------------------------------------------------------------
> By the way, even if 3.1 is preferred, LDC should work fine against LLVM
> 3.0 – the auto tester even runs it.
Oh, nice -- I recall some commits in the source history that made me think only 3.1 would work these days.
Anyway, trying to build against the system LLVM generates this error:
------------------------------------------------------------------------
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
llvm-config: unknown component name: all-targets
CMake Error at cmake/Modules/FindLLVM.cmake:77 (string):
string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
command.
Call Stack (most recent call first):
cmake/Modules/FindLLVM.cmake:96 (llvm_set_libs)
CMakeLists.txt:16 (find_package)
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find LLVM: Found unsuitable version "2.9", but required is at
least "3.0" (found /usr/lib/llvm-2.9)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:250 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLLVM.cmake:105 (find_package_handle_standard_args)
CMakeLists.txt:16 (find_package)
------------------------------------------------------------------------
... even though llvm-3.0-dev is installed: it looks like both -2.9-dev and -3.0-dev are both there.