Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

castXML cannot be build with llvm-3.8 #40

Closed
unknowingdisorder opened this issue Jun 3, 2016 · 7 comments
Closed

castXML cannot be build with llvm-3.8 #40

unknowingdisorder opened this issue Jun 3, 2016 · 7 comments

Comments

@unknowingdisorder
Copy link

Hey, I just want to tell you that I was struggling to build castXML with llvm-3.8. I got the following error message:
$ cmake ../../src/castXML/

CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:178 (include): include could not find load file:

/usr/share/llvm/cmake/LLVMExports.cmake Call Stack (most recent call first): CMakeLists.txt:64 (find_package)

CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include): include could not find load file:

/usr/share/llvm/cmake/LLVM-Config.cmake Call Stack (most recent call first): CMakeLists.txt:64 (find_package)

CMake Error at src/CMakeLists.txt:46 (llvm_map_components_to_libnames): Unknown CMake command "llvm_map_components_to_libnames".

-- Configuring incomplete, errors occurred!

I removed llvm-3.8 and installed llvm-3.7 instead and everything works fine.

@florian-wagner
Copy link
Member

Thanks for reporting. This is likely related to the fact that we have fixed the castxml version to a specific stable commit (bc1d8c2) rather than going with the newest version. While this fixed previous problems, it is obviously not optimal for people with newer llvm versions. @carsten-forty2: Maybe we can include a LLVM version check in cmake?

@kaufmanno
Copy link

kaufmanno commented Aug 27, 2016

Hi Florian,

I encountered this problem when trying to install on a fresh Ubuntu 16.04LTS with curl.

I think it is due to a reported bug in the Ubuntu llvm-3.8-dev package where links are broken during the packaging (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819072)

I managed to fix it with this :

sudo apt-get install -y llvm-3.8-dev libclang-3.8-dev
sudo mkdir -p /usr/lib/llvm-3.8/share/llvm
sudo ln -s /usr/share/llvm-3.8/cmake /usr/lib/llvm-3.8/share/llvm/cmake
sudo sed -i -e '/get_filename_component(LLVM_INSTALL_PREFIX/ {s|^|#|}' -e '/^# Compute the installation prefix/i set(LLVM_INSTALL_PREFIX "/usr/lib/llvm-3.8")' /usr/lib/llvm-3.8/share/llvm/cmake/LLVMConfig.cmake
sudo sed -i '/_IMPORT_CHECK_TARGETS Polly/ {s|^|#|}' /usr/lib/llvm-3.8/share/llvm/cmake/LLVMExports-relwithdebinfo.cmake
sudo sed -i '/_IMPORT_CHECK_TARGETS sancov/ {s|^|#|}' /usr/lib/llvm-3.8/share/llvm/cmake/LLVMExports-relwithdebinfo.cmake
sudo ln -s /usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1 /usr/lib/llvm-3.8/lib/

An ubuntu package fix will probably come out soon...

Olivier

@florian-wagner
Copy link
Member

Hi Olivier,

thanks a lot for the insight! I called CC=clang-3.8 CXX=clang++-3.8 cmake ../gimli again on Debian with llvm-3.8.1 and CastXML builds fine. @carsten-forty2 But during the pygimli compilation CastXML still looks for older versions.

/home/wagner/tmp/gimli/gimli/src/elementmatrix.h:170:18: warning: 'register' storage class
      specifier is deprecated [-Wdeprecated-register]
            for (register Index j = 0; j < size(); j ++) {
                 ^~~~~~~~~
castxml: /usr/lib/llvm-3.6/include/clang/AST/Decl.h:134: llvm::StringRef clang::NamedDecl::getName() const: Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed.
Aborted
Traceback (most recent call last):
  File "/home/wagner/tmp/gimli/gimli/python/generate_pygimli_code.py", line 605, in <module>
    generate(defined_symbols, options.extraIncludes)
  File "/home/wagner/tmp/gimli/gimli/python/generate_pygimli_code.py", line 257, in generate
    xml_generator_config=xml_generator_config
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pyplusplus/module_builder/boost_python_builder.py", line 106, in __init__
    , indexing_suite_version)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pyplusplus/module_builder/boost_python_builder.py", line 149, in __parse_declarations
    decls = reader.read_files( files, compilation_mode )
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/project_reader.py", line 249, in read_files
    return self.__parse_file_by_file(files)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/project_reader.py", line 293, in __parse_file_by_file
    reader.create_xml_file(header, prj_file.cached_source_file)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/source_reader.py", line 341, in create_xml_file
    " xml file does not exist")
RuntimeError: Error occurred while running CASTXML xml file does not exist

@carsten-forty2
Copy link
Contributor

On Tuesday 30 August 2016 03:20:43 Florian Wagner wrote:

Hi Olivier,

thanks a lot for the insight! I called CC=clang-3.8 CXX=clang++-3.8 cmake ../gimli again on Debian with llvm-3.8.1 and CastXML builds fine. @carsten-forty2 But during the pygimli compilation CastXML still looks for older versions.

/home/wagner/tmp/gimli/gimli/src/elementmatrix.h:170:18: warning: 'register' storage class
      specifier is deprecated [-Wdeprecated-register]
            for (register Index j = 0; j < size(); j ++) {
                 ^~~~~~~~~
castxml: /usr/lib/llvm-3.6/include/clang/AST/Decl.h:134: llvm::StringRef clang::NamedDecl::getName() const: Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed.
Aborted
Traceback (most recent call last):
  File "/home/wagner/tmp/gimli/gimli/python/generate_pygimli_code.py", line 605, in <module>
    generate(defined_symbols, options.extraIncludes)
  File "/home/wagner/tmp/gimli/gimli/python/generate_pygimli_code.py", line 257, in generate
    xml_generator_config=xml_generator_config
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pyplusplus/module_builder/boost_python_builder.py", line 106, in __init__
    , indexing_suite_version)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pyplusplus/module_builder/boost_python_builder.py", line 149, in __parse_declarations
    decls = reader.read_files( files, compilation_mode )
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/project_reader.py", line 249, in read_files
    return self.__parse_file_by_file(files)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/project_reader.py", line 293, in __parse_file_by_file
    reader.create_xml_file(header, prj_file.cached_source_file)
  File "/home/wagner/tmp/gimli/thirdParty/dist-Clang-3.8.1-64/pygccxml/parser/source_reader.py", line 341, in create_xml_file
    " xml file does not exist")
RuntimeError: Error occurred while running CASTXML xml file does not exist

if you not have a global installed castxml

which castxml

there only compile a new with llvm-3.8 if there is no old in place.
I recommend using the CLEAN=1 environment first or removing the old thirdParty path manual.

@florian-wagner
Copy link
Member

No global castxml installation and everything was in a clean directory. I tried again with 3.7, i.e. CLEAN=1 CC=clang-3.7 CXX=clang++-3.7 cmake ../gimli, but it seems like the CC and CXX environment variables are not used everywhere:

[...]
git checkout --force d5934bd08651dbda95a65ccadcc5f39637d7bc59 .
~/tmp/gimli/thirdParty
/usr/bin/clang-3.6
Setting clang to:  clang-3.6
SRC /home/wagner/tmp/gimli/thirdParty/src/castXML
 Cleaning /home/wagner/tmp/gimli/thirdParty/build-Clang-3.6.2-64/castXML
~/tmp/gimli/thirdParty/build-Clang-3.6.2-64/castXML ~/tmp/gimli/thirdParty
SRC /home/wagner/tmp/gimli/thirdParty/src/castXML
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1

@carsten-forty2
Copy link
Contributor

Setting CC or CXX will force the gimli build using this compilers.

Is there any existing clang-3.6 on the system?

command -v clang-3.6
/usr/bin/clang-3.6
Setting clang to:  clang-3.6

btw. I see that booth messages are dead ends and won't be used .. I remove them

-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1

means that cmake is build with clang-3.7

On Tuesday 30 August 2016 06:46:08 Florian Wagner wrote:

No global castxml installation and everything was in a clean directory. I tried again with 3.7, i.e. CLEAN=1 CC=clang-3.7 CXX=clang++-3.7 cmake ../gimli, but it seems like the CC and CXX environment variables are not used everywhere:

[...]
git checkout --force d5934bd08651dbda95a65ccadcc5f39637d7bc59 .
~/tmp/gimli/thirdParty
/usr/bin/clang-3.6
Setting clang to:  clang-3.6
SRC /home/wagner/tmp/gimli/thirdParty/src/castXML
 Cleaning /home/wagner/tmp/gimli/thirdParty/build-Clang-3.6.2-64/castXML
~/tmp/gimli/thirdParty/build-Clang-3.6.2-64/castXML ~/tmp/gimli/thirdParty
SRC /home/wagner/tmp/gimli/thirdParty/src/castXML
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1

@florian-wagner
Copy link
Member

CastXML builds fine with llvm 3.8 on my platform. So this really seems to be an Ubuntu specific issue as @kaufmanno already pointed out. I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants