You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Dawid Weiss <da...@gmail.com> on 2010/01/20 17:30:13 UTC
Compiling mahout-math in 1.5-compatibility mode.
Hi. Is it possible to compile mahout-math in 1.5-compatibility mode?
This would require adding compiler plugin rules to POM. Mahout-math
does not use any of the Java 1.6-specific API, I checked.
Dawid
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Dawid Weiss <da...@gmail.com>.
> I would love to see mahout-math be fully 1.5 compatible. I thought it might
> be possible when I pulled out Writable and the hadoop stuff, but I didn't
> realize there was it was so close. Yay!
It should be binary-compatible with 1.5 with the patch I provided. The
source-compatibility would require removing
@Override annotations from methods that override interfaces (1.5
compilers return an error in such a case).
I used a workaround to detect 1.6-specific API, actually --
1) generated Eclipse project files: mvn eclipse:eclipse
2) modified per-project configuration to use 1.6-compiler, but accept
source at 1.5 level and generated 1.5 bytecode,
3) modified per-project classpath configuration, replacing the default
standard library (which would match to any 1.6-compatible JRE you have
set up in your environment) to a 1.5-compatible execution environment.
Given the steps above, Eclipse should compile all classes with
@Override annotations cleanly, generate 1.5-compatible code, accept
@Override annotations AND detect missing standard library API calls
(because you are effectively compiling against rt.jar from the
standard library.
Hope this helps someone,
Dawid
>
> -jake
>
> On Wed, Jan 20, 2010 at 10:57 AM, Dawid Weiss <da...@gmail.com> wrote:
>
>> I must have compiled to 1.5-bytecode, but using 1.6 standard library.
>> There are calls to Arrays#copyOf and, as far as I can tell, it's the
>> only thing there that is 1.6-specific. Will file a patch for this.
>>
>> Dawid
>>
>> On Wed, Jan 20, 2010 at 7:14 PM, Dawid Weiss <da...@gmail.com>
>> wrote:
>> >> Gee, I was sure something in there was using a 1.6 feature, perhaps of
>> Arrays.
>> >
>> > Really? I recompiled it under 1.5... or so I thought... Might have
>> > been 1.6 JRE with 1.5 compatibility switch for the produced
>> > bytecode... Will look into it.
>> >
>> > Dawid
>> >
>>
>
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Jake Mannix <ja...@gmail.com>.
I would love to see mahout-math be fully 1.5 compatible. I thought it might
be
possible when I pulled out Writable and the hadoop stuff, but I didn't
realize there
was it was so close. Yay!
-jake
On Wed, Jan 20, 2010 at 10:57 AM, Dawid Weiss <da...@gmail.com> wrote:
> I must have compiled to 1.5-bytecode, but using 1.6 standard library.
> There are calls to Arrays#copyOf and, as far as I can tell, it's the
> only thing there that is 1.6-specific. Will file a patch for this.
>
> Dawid
>
> On Wed, Jan 20, 2010 at 7:14 PM, Dawid Weiss <da...@gmail.com>
> wrote:
> >> Gee, I was sure something in there was using a 1.6 feature, perhaps of
> Arrays.
> >
> > Really? I recompiled it under 1.5... or so I thought... Might have
> > been 1.6 JRE with 1.5 compatibility switch for the produced
> > bytecode... Will look into it.
> >
> > Dawid
> >
>
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Benson Margulies <bi...@gmail.com>.
Thus animal-sniffer.
On Wed, Jan 20, 2010 at 1:57 PM, Dawid Weiss <da...@gmail.com> wrote:
> I must have compiled to 1.5-bytecode, but using 1.6 standard library.
> There are calls to Arrays#copyOf and, as far as I can tell, it's the
> only thing there that is 1.6-specific. Will file a patch for this.
>
> Dawid
>
> On Wed, Jan 20, 2010 at 7:14 PM, Dawid Weiss <da...@gmail.com> wrote:
>>> Gee, I was sure something in there was using a 1.6 feature, perhaps of Arrays.
>>
>> Really? I recompiled it under 1.5... or so I thought... Might have
>> been 1.6 JRE with 1.5 compatibility switch for the produced
>> bytecode... Will look into it.
>>
>> Dawid
>>
>
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Dawid Weiss <da...@gmail.com>.
I must have compiled to 1.5-bytecode, but using 1.6 standard library.
There are calls to Arrays#copyOf and, as far as I can tell, it's the
only thing there that is 1.6-specific. Will file a patch for this.
Dawid
On Wed, Jan 20, 2010 at 7:14 PM, Dawid Weiss <da...@gmail.com> wrote:
>> Gee, I was sure something in there was using a 1.6 feature, perhaps of Arrays.
>
> Really? I recompiled it under 1.5... or so I thought... Might have
> been 1.6 JRE with 1.5 compatibility switch for the produced
> bytecode... Will look into it.
>
> Dawid
>
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Dawid Weiss <da...@gmail.com>.
> Gee, I was sure something in there was using a 1.6 feature, perhaps of Arrays.
Really? I recompiled it under 1.5... or so I thought... Might have
been 1.6 JRE with 1.5 compatibility switch for the produced
bytecode... Will look into it.
Dawid
Re: Compiling mahout-math in 1.5-compatibility mode.
Posted by Benson Margulies <bi...@gmail.com>.
Gee, I was sure something in there was using a 1.6 feature, perhaps of Arrays.
I tried to make animal-sniffer work and failed recently, care to take
a shot at that?
On Wed, Jan 20, 2010 at 11:30 AM, Dawid Weiss <da...@gmail.com> wrote:
> Hi. Is it possible to compile mahout-math in 1.5-compatibility mode?
> This would require adding compiler plugin rules to POM. Mahout-math
> does not use any of the Java 1.6-specific API, I checked.
>
> Dawid
>