x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Option to make UnrealBuildTool log all commands, eg. full compiler command lines

I'm trying to figure out a build error on Linux.

I want to see the actual command line that is passed to clang (and ld). Echo all commands invoked by UBT to some log so I can trace where it's going wrong.

Is there an option for this?

(-verbose doesn't give me anything useful)

Also is there a way to add options to the compiler/linker command lines? In particular I want to add --verbose to ld.

Product Version: UE 4.20
Tags:
more ▼

asked Nov 05 '18 at 03:18 PM in C++ Programming

avatar image

charlesatrad
1 1 2

avatar image DarkwindRichard Nov 05 '18 at 03:44 PM

Hi charlesatrad,

What exactly is your build error? You should only need to look into the commands UBT is using if you believe that there is a bug in the build system.

avatar image charlesatrad Nov 05 '18 at 03:56 PM

I'm a plugin developer trying to work on my build command line. I need to see the full command line being executed by the system to see where the errors are.

What I want to see is something like :

/usr/bin/g++ -fno-rtti -c -x none -Wall -fPIC -Wno-comment -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-result -Wno-extra -Wno-m ultichar -Wno-unused-label -Wno-unused-but-set-variable -Wno-unused-local-typede fs -Wno-unused-value -fno-stack-protector -ffast-math -finline -fno-exceptions [...]

it's extremely hard and frustrating trying to figure out build issues when I can't see the command lines that are actually being invoked to check if the changes that I think I'm making are actually happening the way I intend when I modify my build.cs rules.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi charlesatrad,

The only way to enable verbose output would be to set both bVerboseCompiler and bVerboseLinker to true on the passed in SDK in the Linux toolchain's constructor in LinuxToolChain.cs in UBT's source.

If that still does not do what you want, then you could try logging out the returned values from LinuxToolChain::GetLinkArguments and LinuxToolChain::GetCLArguments_Global.

more ▼

answered Nov 05 '18 at 04:12 PM

DarkwindRichard (suspended)
avatar image charlesatrad Nov 05 '18 at 10:07 PM

Thanks that helps.

At what point of the process are the arguments all done being processed? That is, where should I call GetLinkArguments and GetCLArguments_Global such that I can get them as they were passed to the shell?

avatar image DarkwindRichard Nov 05 '18 at 10:57 PM

Hi charlesatrad,

You could just find where those calls are invoked inside of LinuxToolChain.cs. If they're not called inside of that script directly, then you could try just printing out the compounded Result string before it is returned from those two functions.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question