GithubHelp home page GithubHelp logo

Building LLVM/Clang wit CMake about castxml HOT 27 CLOSED

castxml avatar castxml commented on July 23, 2024
Building LLVM/Clang wit CMake

from castxml.

Comments (27)

MarkOates avatar MarkOates commented on July 23, 2024 2

I had similar difficulties building CastXML. Notably confusions about the meaning of "LLVM/Clang compiler SDK install tree", distinctions between the dependencies of LLVM and Clang, and knowing when/where/how to properly configure install prefixs.

After looking through the mailing list (http://public.kitware.com/mailman/listinfo/castxml) I came across @thewtex's CastXMLSuperbuild. Which, quite frankly, is a real lifesaver. 👏

https://github.com/thewtex/CastXMLSuperbuild

from castxml.

thewtex avatar thewtex commented on July 23, 2024

Hello,

What compiler are you using? Is it Visual Studio 2012 / MSVC or later?

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Hello,

I have Visual Studio 2012 and Visual Studio 2010n I have the same errors with the two compilers

from castxml.

thewtex avatar thewtex commented on July 23, 2024

Is LLVM installed into a prefix path?

from castxml.

thewtex avatar thewtex commented on July 23, 2024

(as opposed to trying to use it in its build tree). Only building against an installed version is currently supported.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

I have downloaded the source of LLVM via guthub: http://llvm.org/releases/download.html
And I have tried to build it with Cmake

from castxml.

thewtex avatar thewtex commented on July 23, 2024

Basic instructions to build LLVM/Clang are found here:

http://clang.llvm.org/get_started.html

If these instructions have been followed, try starting the initial CMake configuration on a clean build tree from a command prompt that has executed the appropriate vcvars.bat file from Visual Studio.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Thanks,

I am following the instructions and I don't know which version of subversion should I take ?
Is VisualSVN for Visual Studio goof for windows ?

from castxml.

thewtex avatar thewtex commented on July 23, 2024

If you downloaded the 3.6.0 source tar.xz, it can be extracted with 7Zip and subversion is not required

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

I have used subversion but I still have the same problem when using CMake:

I have lots of errors like this

CMake Error: File /cygdrive/c/Users/qi11091/Documents/Logiciels/llvm/utils/llvm-build/llvmbuild/init.py does not exist.
CMake Error at C:/Users/qi11091/Documents/Logiciels/llvm-build/LLVMBuild.cmake:330 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:432 (include)

It search for files in a linux way (/cygdrive/c/...) instea of searching in windows way

Would the problem be solved if i install the pre built binaries instead of the sources ?

from castxml.

thewtex avatar thewtex commented on July 23, 2024

As indicated in the documentation, you will need Python installed to build the tests.

I have not tried using the pre-built binaries. Please try it and report your experiences.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

I have installed python and GnuWin32Tools but I still can not build the project files via CMake:

CMake Error: File /cygdrive/c/Users/qi11091/Documents/Logiciels/llvm/utils/llvm-build/llvmbuild/main.py does not exist.
CMake Error at C:/Users/qi11091/Documents/Logiciels/llvm-build/LLVMBuild.cmake:334 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:432 (include)

CMake Error: File /cygdrive/c/Users/qi11091/Documents/Logiciels/llvm/utils/llvm-build/llvmbuild/componentinfo.py does not exist.
CMake Error at C:/Users/qi11091/Documents/Logiciels/llvm-build/LLVMBuild.cmake:336 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:432 (include)

from castxml.

bradking avatar bradking commented on July 23, 2024

CMake Error: File /cygdrive/c/Users/.../main.py does not exist.

This looks like the build tree has been generated with Cygwin tools involved. No Cygwin should be in the PATH when building for Windows. Start again with a fresh build tree and make sure no Cygwin tools are found.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

SO i have to remove all the paths related to cygwin in te PATH systemvariable ?

from castxml.

bradking avatar bradking commented on July 23, 2024

You don't necessarily have to remove them from your system's PATH. You could configure a command prompt environment to have its own PATH that does not include Cygwin. However, in general I avoid running with Cygwin in the PATH unless I'm at an actual Cygwin shell prompt intending to run Cygwin tools. It is too easy for Windows programs to mistake Cygwin tools for versions that support Windows. Cygwin != Windows.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

I managed to build the project for LLVM/Clang, I can see the executables in teh release folder I created with Visual Studio 12 but when I tried to build CastXML I have 5 build succeeded and 1 failed, here is the error:

Cannot open include file: 'clang/AST/ASTContext.h' : No such file or directory
Cannot open include file: 'clang/AST/ASTConsumer.h' : No such file or directory

from castxml.

bradking avatar bradking commented on July 23, 2024

Cannot open include file: 'clang/AST/ASTContext.h' : No such file or directory

This likely means you pointed LLVM_DIR at the llvm build tree. The CastXML README.rst build instructions say it needs the "LLVM/Clang compiler SDK install tree". Reconfigure llvm with CMAKE_INSTALL_PREFIX set to point somewhere useful and then build the INSTALL target. Make sure you build CastXML with the same configuration (e.g. Debug or Release) you chose to install for LLVM.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Is that this path that I have to Reconfigure for CMAKE_INSTALL_PREFIX: /share/llvm/cmake

from castxml.

bradking avatar bradking commented on July 23, 2024

Reconfigure for CMAKE_INSTALL_PREFIX: /share/llvm/cmake

Yes. Point it to somewhere like C:/Users/qi11091/Documents/Logiciels/llvm-install.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Ok thanks ! I have downloaded the llvm source tree and with svn and clang the same way :
Checkout LLVM:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm

Checkout Clang:

cd llvm\tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang

Is it correct ?

from castxml.

bradking avatar bradking commented on July 23, 2024

Is it correct ?

That looks like the right checkout commands to me.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Thanks
How Can I do to only build the install target ? Is it not possible to build all the solution ?

from castxml.

bradking avatar bradking commented on July 23, 2024

When you load the project in the IDE, right-click on the INSTALL target and choose the option to build it.

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

Is it the install target right on the llvm tree ?

C:\Users\qi11091\Documents\Logiciels\llvm-build\INSTALL ?

from castxml.

alexnatch avatar alexnatch commented on July 23, 2024

I have build the install target for LLVM and also for CastXML after but I have still the same errors:

Error   1   error C1083: Cannot open include file: 'clang/AST/ASTContext.h': No such file or directory  C:\Users\qi11091\Documents\Logiciels\CastXML-master\src\Output.cxx  21
Error   2   error C1083: Cannot open include file: 'clang/AST/ASTConsumer.h': No such file or directory C:\Users\qi11091\Documents\Logiciels\CastXML-master\src\RunClang.cxx    24

Error   3   error MSB3073: The command "setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120                         \Microsoft.CppCommon.targets 132

from castxml.

bradking avatar bradking commented on July 23, 2024

You still need to configure CastXML with its LLVM_DIR option pointing to the location of LLVMConfig.cmake within the install tree rather than that in the build tree.

from castxml.

thewtex avatar thewtex commented on July 23, 2024

@MarkOates thanks for the kind feedback :-)

from castxml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.