-
Notifications
You must be signed in to change notification settings - Fork 53
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
CMake Error #46
Comments
I got the same error again now on Mac 10.12.6 |
Are you running The docker container is not yet up to date unfortunately. |
Yes I am running build.sh from the root of the repo. CMake 3.21.2. |
Are there any files in |
Yes, there are more files. I zipped what was contained in |
I'm not sure what the problem is, but a potential workaround, add this to the end of the command line invocation at line 58 of -DLLVM_INCLUDE_BENCHMARKS=OFF |
A simple test added into CMakeList.txt
returns empty when running ./build.sh. The error is that FILE(GLOB) is never returning anything thus the error "no sources given to the target" on the call to add_library because SOURCE_FILES is empty. I think this is the error here documented here but I haven't dug into it yet. |
You're right that I think something is up with FILE(GLOB ...) but that's unfortunately not really something we can control, and that aspect of the build system is in the LLVM build set-up, which makes the error a bit more opaque. However, this part of the build system hasn't been updated since we started using it in the main LLVM repository either. You might try to add But, I suspect this aspect of the project isn't super related to what you're working on and would recommend also trying the workaround to just disable this part of the build. |
Including the flag to turn benchmarks off, I now have a new flurry of error messages. I appreciate the help! The errors look like Same results on both Ubuntu and Mac |
I can't quite figure out why the build system isn't finding these items but add this in the same place you added the last flag: It'll just ignore the path that's triggering those warnings for now. Scaffold doesn't use the If I had to guess, something is different between the |
Sorry to keep getting stuck. I'm just excluding 'opt' and will see if that lets me pass the regression test suite. |
I'm not sure what's happening in this case. I think CMake is not able to find the directories it needs to be able to create these as sources. Could you try to follow the directions here: https://llvm.org/docs/GettingStarted.html, and try to run the CMake step? That might help see where the issue is if it fails. You could also try to add "add_llvm_tool_subdirectory(opt)" to llvm/tools/CMakeLists.txt. |
This runs fine.
This allowed me to run the command [702/2862] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTOModule.cpp.o FAILED: lib/LTO/CMakeFiles/LLVMLTO.dir/LTOModule.cpp.o /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/user/Documents/[dir]/build/lib/LTO -I/home/user/Documents/[dir]/llvm/lib/LTO -I/usr/include/libxml2 -I/home/user/Documents/[dir]/build/include -I/home/user/Documents/[dir]/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -g -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/LTO/CMakeFiles/LLVMLTO.dir/LTOModule.cpp.o -MF lib/LTO/CMakeFiles/LLVMLTO.dir/LTOModule.cpp.o.d -o lib/LTO/CMakeFiles/LLVMLTO.dir/LTOModule.cpp.o -c '/home/user/Documents/[dir]/llvm/lib/LTO/LTOModule.cpp' In file included from /home/user/Documents/[dir]/llvm/include/llvm/Support/Compiler.h:18, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/Optional.h:19, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/STLExtras.h:19, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/StringRef.h:12, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/StringMap.h:16, from /home/user/Documents/[dir]/llvm/include/llvm/LTO/legacy/LTOModule.h:17, from /home/user/Documents/[dir]/llvm/lib/LTO/LTOModule.cpp:14: /home/user/Documents/[dir]/llvm/include/llvm/Support/TargetSelect.h: In function ‘bool llvm::InitializeNativeTargetAsmPrinter()’: /home/user/Documents/[dir]/build/include/llvm/Config/llvm-config.h:39:32: error: ‘LLVMInitializeX86AsmPrinter’ was not declared in this scope; did you mean ‘LLVMInitializeX86AsmParser’? 39 | #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/Documents/[dir]/llvm/include/llvm/Support/TargetSelect.h:132:5: note: in expansion of macro ‘LLVM_NATIVE_ASMPRINTER’ 132 | LLVM_NATIVE_ASMPRINTER(); | ^~~~~~~~~~~~~~~~~~~~~~ [705/2862] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTOCodeGenerator.cpp.o FAILED: lib/LTO/CMakeFiles/LLVMLTO.dir/LTOCodeGenerator.cpp.o /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/user/Documents/[dir]/build/lib/LTO -I/home/user/Documents/[dir]/llvm/lib/LTO -I/usr/include/libxml2 -I/home/user/Documents/[dir]/build/include -I/home/user/Documents/[dir]/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -g -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/LTO/CMakeFiles/LLVMLTO.dir/LTOCodeGenerator.cpp.o -MF lib/LTO/CMakeFiles/LLVMLTO.dir/LTOCodeGenerator.cpp.o.d -o lib/LTO/CMakeFiles/LLVMLTO.dir/LTOCodeGenerator.cpp.o -c '/home/user/Documents/[dir]/llvm/lib/LTO/LTOCodeGenerator.cpp' In file included from /home/user/Documents/[dir]/llvm/include/llvm/Support/Compiler.h:18, from /home/user/Documents/[dir]/llvm/include/llvm/Support/ErrorHandling.h:17, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/Hashing.h:48, from /home/user/Documents/[dir]/llvm/include/llvm/ADT/ArrayRef.h:12, from /home/user/Documents/[dir]/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:38, from /home/user/Documents/[dir]/llvm/lib/LTO/LTOCodeGenerator.cpp:14: /home/user/Documents/[dir]/llvm/include/llvm/Support/TargetSelect.h: In function ‘bool llvm::InitializeNativeTargetAsmPrinter()’: /home/user/Documents/[dir]/build/include/llvm/Config/llvm-config.h:39:32: error: ‘LLVMInitializeX86AsmPrinter’ was not declared in this scope; did you mean ‘LLVMInitializeX86AsmParser’? 39 | #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/Documents/[dir]/llvm/include/llvm/Support/TargetSelect.h:132:5: note: in expansion of macro ‘LLVM_NATIVE_ASMPRINTER’ 132 | LLVM_NATIVE_ASMPRINTER(); | ^~~~~~~~~~~~~~~~~~~~~~ [711/2862] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/ThinLTOCodeGenerator.cpp.o ninja: build stopped: subcommand failed. |
Andrew, I've build the tool flow on various flavors of Mac, including from 10.13 to 11.5...I used homebrew/macports in different cases to build the supplementary tools like ninja. Interestingly I'm running into different issues than Evan. I tried to build it on a fresh ubuntu 20.04 server installation and had problems with the linking stage when running the "ninja llvm-headers" command. I suspect it is related to using gold rather than ld. ubuntu bundles gold and ld in the same package. Is there a way to specify in your build flow to use /usr/bin/gold instead of /usr/bin/ld for the linker? |
But was it able to correctly build still?
I tried doing this on a fresh 20.04 installation as well without installing the goldutils, and this step was able to work. I believe that this is a requirement that has carried over from the and old version of llvm, and is no longer necessary. The GNU included
The build script actually already has a flag for this if you're using linux:
|
I believe this error has something to do with the fact that CMake globbing for whatever reasons doesn't seem to be working for you, and so it's not grabbing all the include files, I created an Ubunutu 20.04 instance, and installed: clang-10.0.0, python3, CMake 3.21.2, and ninja 1.10.0 only and was able to run Something I've noticed is the
|
Correct, I was able to build on all of those MacOS flavors. Actually your answer to Evan gave me an idea. I was using gcc/g++ in my environment and hadn't installed clang...I switched to clang and got past the linker problem. I guess that stage was bootstrapping and mixing compilers...Its now building... |
Hello, I have installed all the prerequisites and tried using docker as well but cannot get past this step. I'm using Ubuntu 20.04.
CMake Error at utils/benchmark/src/CMakeLists.txt:19 (add_library): No SOURCES given to target: benchmark CMake Generate step failed. Build files cannot be regenerated correctly.
output.txt
The text was updated successfully, but these errors were encountered: