GithubHelp home page GithubHelp logo

Comments (11)

bradking avatar bradking commented on July 23, 2024 1

@suedlaender83 the discussion of "build tree" versus "install tree" above is about the build of LLVM/Clang. If you're using a distro-installed package the "install tree" is what comes with the package. Be sure to install the Clang library development package, such as libclang-11-dev (the name may depend on the distro and the version of clang).

from castxml.

bradking avatar bradking commented on July 23, 2024

We build CastXML with VS 2013 regularly and do not see this.

  • What version (commit sha1) did you build?
  • What version of LLVM/Clang did you build against?
  • What CMake version did you use?
  • What CMake generator did you use? For x86 or x64?

From where did you run the executable? Directly from the build tree or install tree?

from castxml.

vanxining avatar vanxining commented on July 23, 2024

I found the file "castxmlClangResourceDir.txt" located in "build\CMakeFiles" was empty, so I added to it the path of Clang's lib dir (in my case was "LLVM\build\Release\lib\clang\3.6.0"). Finally CastXML worked.

What version (commit sha1) did you build?
-- The latest commit 0a10370
What version of LLVM/Clang did you build against?
-- 3.6.0
What CMake version did you use?
What CMake generator did you use? For x86 or x64?
-- CMake version 3.2.2 x86
From where did you run the executable? Directly from the build tree or install tree?
-- I ran it from the install tree, but it failed with the error message "Unable to locate resources for <...>\castxml.exe". With "castxmlClangResourceDir.txt" modified, I ran the executable from the build tree, and got the correct result successfully.

from castxml.

bradking avatar bradking commented on July 23, 2024

Thanks. All of the problems running in both the build and install trees come from CLANG_RESOURCE_DIR not being set in the CMake cache in the build tree. There is code here that is supposed to detect this location automatically if the user does not set the cache entry explicitly. Please try to figure out why that setting is not detected for you.

from castxml.

vanxining avatar vanxining commented on July 23, 2024

Thanks!
I will try it and post feedback here.

from castxml.

bradking avatar bradking commented on July 23, 2024

Meanwhile I pushed commit fe633c2 to fail at CMake time if the Clang resources cannot be found. It also prints out the places it tried looking which might help you debug it.

from castxml.

vanxining avatar vanxining commented on July 23, 2024

I tried the latest version, and got a CMake configure error message:

CMake Error at CMakeLists.txt:77 (message):
Could not find CLANG_RESOURCE_DIR. Tried:

D:/Work/CppLibs/LLVM/build/$(Configuration)/lib/clang/3.6.0

Please set CLANG_RESOURCE_DIR to the Clang SDK directory containing
"include/stddef.h", typically of the form "/lib/clang/3.6.0".

This path is the value of ${LLVM_LIBRARY_DIRS} which is defined in "LLVM\build\share\llvm\cmake\LLVMConfig.cmake" line 96:

set(LLVM_LIBRARY_DIRS "D:/Work/CppLibs/LLVM/build/$(Configuration)/lib")

Though I can't figure out why this happens, I think the error message is a useful guide to make a successful build after setting CLANG_RESOURCE_DIR to a proper directory manually in CMake GUI. (I don't know much about CMake.)

Thanks!

from castxml.

vanxining avatar vanxining commented on July 23, 2024

I finally figure out the real cause.
I compiled CastXML on the build tree of LLVM/Clang SDK directly. Actually, the install tree must be used.

Please forgive me for such a stupid mistake. Thanks for your time. 👍

CastXML is really useful. Many thanks!

from castxml.

bradking avatar bradking commented on July 23, 2024

Thanks. I pushed commit 40aed5c to reject attempts to use a LLVM/Clang build tree up front.

from castxml.

suedlaender83 avatar suedlaender83 commented on July 23, 2024

@vanxining @bradking This is an old thread but i will give it a try. Maybe i get an answer. I'm new to Castxml and I'm trying to build it with a preinstalled Clang. I'm having the same issues you described here. My question is how to find the "install tree" and how to differentiate "install tree" from a "build tree"? I suspect that this would also resolve my issue once i figure out where i can find the "install tree". Many thanks in advance.

from castxml.

suedlaender83 avatar suedlaender83 commented on July 23, 2024

Thanks a lot for the explanation @bradking

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.