Author Topic: Execution of Compiler Failed  (Read 712 times)

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Execution of Compiler Failed
« on: May 17, 2020, 08:31:24 pm »
Hi, I am new to Code::Blocks, but I am quickly getting up to speed.

After resolving various issues, I feel like I am close to compiling a project, but I get tripped up at the very end. It say says "Execution of 'X.. failed", where X is the Fortran compiler. A google search has not helped to resolve it. A few things I tried:

In the Toolchain Executables, I double checked things and tried a few different Fortran compilers. I also tried a simple "Hello World" and that compiles and creates and EXE. If that works, should'nt the Toolchain Executables be set correctly? I tried on two different computers (wondering if some setting or anti-virus was tripping it up), but both give the same result.

Any other ideas?

Another odd thing I noticed was that if I save project, close C::B, then reopen it, then Rebuild, it gives an error right away. However, if I just got into the Toolchain Executables menu (and not even change anything), I can then Rebuild and it will work on it for a while until it gets to the same error originally stated. I guess that is a bug or maybe a clue?

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: Execution of Compiler Failed
« Reply #1 on: May 17, 2020, 11:10:54 pm »
Have you tried the steps from here: http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Or running the compiler in a command line window?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #2 on: May 17, 2020, 11:34:55 pm »
Thanks. I have not, but I will do that next. I am not a coder so I struggle with some aspects, but I will look into this and let you know if I have success.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Execution of Compiler Failed
« Reply #3 on: May 18, 2020, 12:50:14 am »
Remember Code::Blocks is an IDE/Editor!
It is not a Compiler!
You need to make sure a compiler is installed and that the Code::Blocks toolchain points to the correct location.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #4 on: May 18, 2020, 12:58:36 am »
Tim: I believe I have gFotran present. I downloaded the Code::Blocks package with MinGW (codeblocks-20.03mingw-setup.exe). As I mentioned, I point the Toolchain Executables to the path where the Fortran compiler exists. On another computer, I first installed MinGW in the C:\MinGW directory and it automatically detected it. It was linked in the Toolchain Executables. Also, since I was able to compile "Hello World" and create an EXE, doesn't that mean the compiler is present?

Regarding the command line option, how is this done? The project has about 1,800 files with INCLUDE files. Should I use a Makefile? I created one, but do not know how to run the Makefile...if I am even in the right direction on this.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Execution of Compiler Failed
« Reply #5 on: May 18, 2020, 03:30:07 am »
Post a full rebuild log and I can figure out how to tell you how to check for the commands.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Execution of Compiler Failed
« Reply #6 on: May 18, 2020, 05:43:28 am »
I saw no errors in your html build log!
But, I am guessing that there is no errors.

Once, you press build a second time after an error do you get another error?

If not, you likely are just having an FORTRAN command that CB just does not understand.
When that happens CB reports a false error has happened.

If you wish it to be fixed you need to post the command in Code tags!
HTML is not easy to read for this type of issue.

NOTE: If you are really having a error it is likely because the linker command is too long.
The HTML had it cut off before the command was done.

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #7 on: May 18, 2020, 06:20:43 am »
I saw no errors in your html build log!
But, I am guessing that there is no errors.

Right, it does not appear there is a compiling error, but rather something is happening at the end and it doesn't create the EXE

Quote
Once, you press build a second time after an error do you get another error?

Yup.

Quote
If not, you likely are just having an FORTRAN command that CB just does not understand.
When that happens CB reports a false error has happened.

If you wish it to be fixed you need to post the command in Code tags!
HTML is not easy to read for this type of issue.

OK. I will look into this now. Are there instructions for this? I am not sure how to do it.

Quote
NOTE: If you are really having a error it is likely because the linker command is too long.
The HTML had it cut off before the command was done.

I changed the root path to just "C:\A" to keep it as short as possible but it still failed. I am not sure if that what what you meant, but I thought it was worth a shot.



« Last Edit: May 18, 2020, 06:22:58 am by FEA »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Execution of Compiler Failed
« Reply #8 on: May 18, 2020, 06:42:57 am »
Please read this thread!
http://forums.codeblocks.org/index.php/topic,23841.msg162680.html#msg162680

There is a max command line length that you are going over.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #9 on: May 18, 2020, 07:23:56 am »
Is the command line limit that you are referring to for Windows 8191 characters? And is the command that is runs the one you saw in red? The one in red is over 65,000 characters so it is not even close.

Or is is something else where shortening the directory lengths might solve the problem?
« Last Edit: May 18, 2020, 08:51:01 am by FEA »

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #10 on: May 18, 2020, 07:58:04 am »
Regarding the patch script, does one just use Settings/Scripting/Add/(Select the script)/OK/Allow execution of this command for all scripts from now on ?

For reference, when reading the source code in (recursively) it takes about 10 minutes because there are about 1900 files. After enacting the script, it took about 20 minutes.

I then did a Rebuild and it went along then did something new (so I guess the script was trying to work?). It briefly said said something about "can not read timestamp" in red for many files (it was scrolling) then the CodeBlocks window disappeared/crashed.

So maybe there is no way to resolve this?
« Last Edit: May 18, 2020, 08:54:22 am by FEA »

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #11 on: May 19, 2020, 05:59:11 pm »
I was able to get it to compile if I flattened all the source files to a single directory and then renamed all the files to a shorter version. While this works, its not a very practical working solution. This approach reduced the command line to about 19k characters and I believe the limit is 32k characters.

I am not sure why Visual Studio/Intel Fortran has no issues with things as is. From the build log, it seemed to be a single line at the end, so maybe they are rolling it all up into a temporary file before creating the EXE? I wonder if something like that could be done in C::B?

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 438
Re: Execution of Compiler Failed
« Reply #12 on: May 19, 2020, 06:52:29 pm »
This temporary file is called a response file. BlueHazzard is working on adding this to C::B, see https://sourceforge.net/p/codeblocks/tickets/953/.

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #13 on: May 19, 2020, 08:29:37 pm »
Thanks, I saw that from the prior link. I tried to run the script, but it did not work for me. But now I realized there is a patch file as well. I was confused about how to implement or if it even worked. Some of the commenters were saying that there might be a different approach? But maybe I can just sit tight and wait for this to be implemented.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2730
Re: Execution of Compiler Failed
« Reply #14 on: May 20, 2020, 09:12:23 am »
Will try to make a new patch today, so we can push it in the next days..

Offline FEA

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Execution of Compiler Failed
« Reply #15 on: May 20, 2020, 05:18:56 pm »
Will try to make a new patch today, so we can push it in the next days..

That would be great! Thanks so much for your effort. I am looking forward to it.