basic question about building ldc/calypso from source

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Feb 24 11:13:14 PST 2015


Hi Laeeth!

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]$
>

LLVM_ROOT_DIR is the directory where LLVM is installed. It is the 
output of llvm-config --prefix. If you have LLVM installed then 
there is no need to specify LLVM_ROOT_DIR. As an alternative you 
can add $(llvm-config --prefix)/bin to your PATH variable.

>
> 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".

Which version of LLVM and LDC do you use? The error message looks 
like your using a recent LLVM with an old LDC version....

Regards,
Kai


More information about the digitalmars-d-ldc mailing list