basic question about building ldc/calypso from source

John Colvin via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Feb 24 09:23:18 PST 2015


On Tuesday, 24 February 2015 at 16:33:31 UTC, Laeeth Isharc wrote:
> Hi.
>
> I am struggling with using cmake to build LDC.  I have 
> successfully built LLVM and clang following standard 
> instructions, but I am not so familiar with cmake and do not 
> know which directory LLVM_ROOT_DIR should point to.
>
> Ultimately I would like to build calypso, but I have the same 
> problem with stock LDC.
>
> Running arch linux on a 64 bit machine.  I have tried various 
> iterations of pointing to build directory as well as llvm 
> parent.
>
> [laeeth at console build]$ cmake .. -DLLVM_ROOT_DIR='../../llvm' 
> -DCMAKE_BUILD_TYPE=Release
>
> [laeeth at console build]$ ls ../../llvm/
> autoconf	 configure    LLVMBuild.txt	  README.txt
> bin		 CREDITS.TXT  llvm.spec.in	  test
> bindings	 docs	      Makefile		  tools
> build		 examples     Makefile.common	  unittests
> cmake		 include      Makefile.config.in  utils
> CMakeLists.txt	 lib	      Makefile.rules
> CODE_OWNERS.TXT  LICENSE.TXT  projects
> [laeeth at console build]$
>
>
> This is the error I receive:
>
> [laeeth at console build]$ cmake .. -DLLVM_ROOT_DIR='../../llvm' 
> -DCMAKE_BUILD_TYPE=Release
> CMake Error at cmake/Modules/FindLLVM.cmake:140 (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:174 (llvm_set_libs)
>   CMakeLists.txt:18 (find_package)
>
>
> CMake Error at 
> /usr/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 
> (message):
>   Could NOT find LLVM: Found unsuitable version "", but 
> required is at least
>   "3.1" (found )
> Call Stack (most recent call first):
>   
> /usr/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:372 
> (_FPHSA_FAILURE_MESSAGE)
>   cmake/Modules/FindLLVM.cmake:196 
> (find_package_handle_standard_args)
>   CMakeLists.txt:18 (find_package)
>
>
> -- Configuring incomplete, errors occurred!
> See also 
> "/btrfs0/dlang/calypso/calypso/build/CMakeFiles/CMakeOutput.log".

you shouldn't have to specify LLVM_ROOT_DIR on a system like 
Arch, cmake should be perfectly capable of finding it on its own, 
assuming you have llvm installed somewhere sensible (i.e. where 
pacman puts it). All ldc's dependencies are available through 
pacman.

What does `which llvm-config` give you?

I just tested this with ldc on arch:

git clone https://github.com/ldc-developers/ldc
cd ldc
git submodule update --init
mkdir build
cd build
cmake ../
make -j8

everything worked fine.


More information about the digitalmars-d-ldc mailing list