Customizing path to gcc doesn't seem to work.

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

thanks
Xav
Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Daz DeBoer-2
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz
Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz

Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz


Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Daz DeBoer-2
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz



Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
Thanks Daz,

Is there time to fix this in 1.12?

I'll create a script that temporarily create those files so that I can move forward.

thanks again.


On Thu, Mar 6, 2014 at 1:19 PM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz




Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Adam Murdoch

On 7 Mar 2014, at 8:24 am, Xavier Ducrohet <[hidden email]> wrote:

Thanks Daz,

Is there time to fix this in 1.12?

Yes there is. I’ll fix it soon.


I'll create a script that temporarily create those files so that I can move forward.

thanks again.


On Thu, Mar 6, 2014 at 1:19 PM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
great, thanks!


On Thu, Mar 6, 2014 at 1:46 PM, Adam Murdoch <[hidden email]> wrote:

On 7 Mar 2014, at 8:24 am, Xavier Ducrohet <[hidden email]> wrote:

Thanks Daz,

Is there time to fix this in 1.12?

Yes there is. I’ll fix it soon.


I'll create a script that temporarily create those files so that I can move forward.

thanks again.


On Thu, Mar 6, 2014 at 1:19 PM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com




Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Adam Murdoch

This is somewhat fixed now. The GCC toolchain no longer complains if it can’t find a compiler that isn’t required to build the binaries. There’s still no way to tweak the objective-c and objective-c++ compilers, but I don’t think this affects you. I’ll add this configuration mechanism soon.

On 7 Mar 2014, at 9:04 am, Xavier Ducrohet <[hidden email]> wrote:

great, thanks!


On Thu, Mar 6, 2014 at 1:46 PM, Adam Murdoch <[hidden email]> wrote:

On 7 Mar 2014, at 8:24 am, Xavier Ducrohet <[hidden email]> wrote:

Thanks Daz,

Is there time to fix this in 1.12?

Yes there is. I’ll fix it soon.


I'll create a script that temporarily create those files so that I can move forward.

thanks again.


On Thu, Mar 6, 2014 at 1:19 PM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply | Threaded
Open this post in threaded view
|

Re: Customizing path to gcc doesn't seem to work.

Xavier Ducrohet
cool, thanks!


On Mon, Mar 10, 2014 at 12:25 PM, Adam Murdoch <[hidden email]> wrote:

This is somewhat fixed now. The GCC toolchain no longer complains if it can’t find a compiler that isn’t required to build the binaries. There’s still no way to tweak the objective-c and objective-c++ compilers, but I don’t think this affects you. I’ll add this configuration mechanism soon.

On 7 Mar 2014, at 9:04 am, Xavier Ducrohet <[hidden email]> wrote:

great, thanks!


On Thu, Mar 6, 2014 at 1:46 PM, Adam Murdoch <[hidden email]> wrote:

On 7 Mar 2014, at 8:24 am, Xavier Ducrohet <[hidden email]> wrote:

Thanks Daz,

Is there time to fix this in 1.12?

Yes there is. I’ll fix it soon.


I'll create a script that temporarily create those files so that I can move forward.

thanks again.


On Thu, Mar 6, 2014 at 1:19 PM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 2:10 PM, Xavier Ducrohet <[hidden email]> wrote:
ok so with progress made on the other thread, I'm running into new problems. I'll keep on this thread since it's more relevant.

with:
    toolChains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin'
            getCCompiler().executable = 'x86_64-linux-g++'
            getCppCompiler().executable = 'x86_64-linux-g++'
            getLinker().executable = 'x86_64-linux-ld'
            getAssembler().executable = 'x86_64-linux-as'
        }

building fails with:

* What went wrong:
Execution failed for task ':compileLinux32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'linux32':
    - Tool chain 'gcc' (GNU GCC):
        - Could not find Objective-C++ compiler 'g++'. Searched in: /usr/local/google/home/xav/dev/ext/idea133/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin

It looks like it's still looking for "g++" instead of the compiler executable I set. I'm also a bit confused with the message mentioning "Objective-C++".


Well that's a pretty sucky experience :). We've added Objective-C++ support for GCC, but in doing so we've made it a requirement that each GCC tool chain have an objective-c and objective-c++ compiler. These are named 'gcc' and 'g++' by default, but there's no equivalent mechanism to set the executable for them.

Your best bet would be to create empty files named 'g++' and 'gcc' in the same directory. Or symlink the real compilers to those names. Apologies for the inconvenience.
Daz
 
On Thu, Mar 6, 2014 at 12:14 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi Daz,

I'm not seeing any message about my toolchain not being available. When I try to build the MacOS exe on linux it does complain with:

Execution failed for task ':compileDarwin32MksdcardExecutableMksdcardC'.
> No tool chain is available to build for platform 'darwin32':
    - Tool chain 'visualCpp' (Visual Studio): Visual Studio is not available on this operating system.
    - Tool chain 'gcc' (GNU GCC): Don't know how to build for platform 'darwin32'.
    - Tool chain 'clang' (Clang): Could not find C++ compiler 'clang++' in system path.

I'm using Gradle 1.11, and I hadn't realized GccTool can customize the executable!

My build.gradle file now looks like:

model {
   toolchains {
        gcc(Gcc) {
            path '/path/to/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6'
            cCompiler.executable = 'x86_64-linux-g++'
            cppCompiler.executable = 'x86_64-linux-g++'
            linker.executable = 'x86_64-linux-ld'
            assembler.executable = 'x86_64-linux-as'
        }
   }
}

and it's still not doing anything. The --info still doesn't show any special output about my config being broken (or even used in anyway).

Am I correctly replacing the default toolchain or just adding a new one that's lower priority than the default? 


On Thu, Mar 6, 2014 at 11:59 AM, Daz DeBoer <[hidden email]> wrote:
On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <[hidden email]> wrote:
From the example in the docs:

model {
    toolChains {
        gcc(Gcc) {
            // Uncomment to use a GCC install that is not in the PATH
            // path "/usr/bin/gcc"
        }
    }
}

and the DSL documentation, it seems the only configuration for a GCC toolchain is the "path".

I've tried to use it but it seems like it always revert to my install GCC that's present in the path.

Looking at the info output it shows:

Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin Command: /usr/bin/g++ -dM -E -
Successfully started process 'command '/usr/bin/g++''
Found C++ compiler with version 4

Yes, this is likely Gradle executing the compiler to get the version string.

But it doesn't show the same for my custom toolchain, so it seems like it's not even trying to use it.

If you actually try to build something, you should get a message describing why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what gets reported.
 

One thing though is that my custom toolchain doesn't have a g++ entry in its "bin" folder. Instead it has "i686-linux-g++". Is this the source of the problem?

Very likely.
 

The Gcc class has properties for the c/c++ compiler, linker, etc... but those are read only so I can't customize them.

What version of Gradle are you using? These properties are indeed read-only, but they are configurable objects of type 'GccTool':
 
Daz






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com






--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com