[lucy-user] Compiling Lucy 4.2 Strawberry 5.20

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

[lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Thomas den Braber-2
Hi,

I am compiling version 4.2 on Strawberry 5.20 64-bit on Windows 7.

I first have successfully compiled Clownfish and the Clownfish ::CFC
(version 4.2).

When Compiling Lucy, first it starts to successful compile some modules but
after a while there are these undefined references:

gcc -c -I"core" -I"xs" -I"modules\analysis\snowstem\source\include"
-I"modules\u
nicode\ucd" -I"modules\unicode\utf8proc" -I"." -I"autogen\include"
-I"C:\Mediafi
ler\strawberry\perl\site\lib\Clownfish\_include" -s -O2 -DWIN32 -DWIN64
-DCONSER
VATIVE  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUS
E_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -std=gnu99
-D_GNU_SOURCE -D
 CFP_LUCY -D CFP_TESTLUCY -s -O2 -I"C:\Mediafiler\strawberry\perl\lib\CORE"
-I"C
:\Mediafiler\strawberry\c\include" -o "autogen\source\testlucy_parcel.o"
"autoge
n\source\testlucy_parcel.c"
gcc -c -I"core" -I"xs" -I"modules\analysis\snowstem\source\include"
-I"modules\u
nicode\ucd" -I"modules\unicode\utf8proc" -I"." -I"autogen\include"
-I"C:\Mediafi
ler\strawberry\perl\site\lib\Clownfish\_include" -s -O2 -DWIN32 -DWIN64
-DCONSER
VATIVE  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUS
E_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2
"-DVERSION=\"0.4.2\"
" "-DXS_VERSION=\"0.4.2\"" -I"C:\Mediafiler\strawberry\perl\lib\CORE"
-I"C:\Medi
afiler\strawberry\c\include" -o "lib\Lucy.o" "lib\Lucy.c"
Generating script 'lib\Lucy.lds'
g++ -o "blib\arch\auto\Lucy\Lucy.xs.dll" -Wl,--image-base,0x620d0000 -mdll
-s -L
"C:\Mediafiler\strawberry\perl\lib\CORE" -L"C:\Mediafiler\strawberry\c\lib"
"lib
\Lucy.lds" "lib\Lucy.def"
lib\Lucy.o:Lucy.c:(.text+0xc6): undefined reference to
`cfish_XSBind_allot_param
s'
lib\Lucy.o:Lucy.c:(.text+0xdd): undefined reference to
`cfish_XSBind_new_blank_o
bj'
lib\Lucy.o:Lucy.c:(.text+0x108): undefined reference to
`CFISH_Obj_To_Host_OFFSE
T'
lib\Lucy.o:Lucy.c:(.text+0x11d): undefined reference to
`CFISH_Obj_Dec_RefCount_
OFFSET'
lib\Lucy.o:Lucy.c:(.text+0x156): undefined reference to
`cfish_Err_get_error'
lib\Lucy.o:Lucy.c:(.text+0x16b): undefined reference to
`CFISH_Obj_Inc_RefCount_
OFFSET'
lib\Lucy.o:Lucy.c:(.text+0x18a): undefined reference to `cfish_Err_rethrow'
lib\Lucy.o:Lucy.c:(.text+0x1b6): undefined reference to `CFISH_ERR'
lib\Lucy.o:Lucy.c:(.text+0x1db): undefined reference to `cfish_Err_throw_at'
lib\Lucy.o:Lucy.c:(.text+0x279): undefined reference to `CFISH_ERR'
lib\Lucy.o:Lucy.c:(.text+0x29e): undefined reference to `cfish_Err_throw_at'
lib\Lucy.o:Lucy.c:(.text+0x2c5): undefined reference to
`cfish_XSBind_sv_to_cfis
h_obj'
lib\Lucy.o:Lucy.c:(.text+0x379): undefined reference to `CFISH_ERR'
lib\Lucy.o:Lucy.c:(.text+0x39e): undefined reference to `cfish_Err_throw_at'
lib\Lucy.o:Lucy.c:(.text+0x3c5): undefined reference to
`cfish_XSBind_sv_to_cfis
h_obj'

Then there is a long list of these messages that ends with:

lib\Lucy.o:Lucy.c:(.text+0x992bc): undefined reference to
`CFISH_Obj_Dec_RefCoun
t_OFFSET'
lib\Lucy.o:Lucy.c:(.text+0x99343): undefined reference to `CFISH_ERR'
lib\Lucy.o:Lucy.c:(.text+0x99373): undefined reference to
`cfish_Err_throw_at'
lib\Lucy.o:Lucy.c:(.text+0x9937a): undefined reference to `LUCY_FOLDER'
lib\Lucy.o:Lucy.c:(.text+0x99393): undefined reference to
`cfish_XSBind_sv_to_cf
ish_obj'
lib\Lucy.o:Lucy.c:(.text+0x99a77): undefined reference to
`cfish_Lucy_bootstrap'
C:/Mediafiler/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.8.3/../../../../x
86_64-w64-mingw32/bin/ld.exe: lib\Lucy.o: bad reloc address 0x0 in section
`.pda
ta'
collect2.exe: error: ld returned 1 exit status

Can you help me with this? I have no idea what I an doing wrong here.
I have successfully compiled a lot of other modules, so the Perl environment
looks right.

--
Thomas den Braber
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Nick Wellnhofer
On 30/03/2015 13:11, Thomas den Braber wrote:
> I am compiling version 4.2 on Strawberry 5.20 64-bit on Windows 7.
>
> I first have successfully compiled Clownfish and the Clownfish ::CFC
> (version 4.2).
>
> When Compiling Lucy, first it starts to successful compile some modules but
> after a while there are these undefined references:

This is caused by a change in Strawberry Perl 5.20. The 5.20 release uses
$Config{dlext} == 'xs.dll' which breaks the setup of our linker flags.

The following commit to Clownfish::CFC fixes the issue:

https://git-wip-us.apache.org/repos/asf?p=lucy-clownfish.git;a=commitdiff;h=6e16fc642830338beed22e9b1976e0585075f950

It will be part of the next release in the 0.4 series. In the meantime, you
can apply the patch manually or use Strawberry Perl 5.18.

Nick

Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Thomas den Braber
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Kruno Sever
In reply to this post by Thomas den Braber-2
Am 30.03.2015 um 13:11 schrieb Thomas den Braber:
> Hi,
>
> I am compiling version 4.2 on Strawberry 5.20 64-bit on Windows 7.
>
> I first have successfully compiled Clownfish and the Clownfish ::CFC
> (version 4.2).

How did you manage to do this? I have been trying around with various
versions of Strawberry (5.18 to 5.22) on Win 8 today. It compiles but so
far the tests fail to pass, preventing installation. Here the relevant
snippets from the output:

...
t/404-file.t ............... ok
t/500-hierarchy.t .......... 1/21 utime for 't\cfbase\Animal.cfh' failed
at t/500-hierarchy.t line 94.
# Looks like you planned 21 tests but ran 18.
# Looks like your test exited with 13 just after 18.
t/500-hierarchy.t .......... Dubious, test returned 13 (wstat 3328, 0xd00)
Failed 3/21 subtests
...

and

...
t/core/500-hierarchy.t ..... Can't set file time of
't\cfbase\Animal.cfh': Permission denied at t/core/500-hierarchy.t line 22.
t/core/500-hierarchy.t ..... Dubious, test returned 13 (wstat 3328, 0xd00)
Failed 26/44 subtests
...

Those failures look like some permission problem, but I am already
running the install with admin rights, so that shouldn't be an issue (?)

I can force install the module, but I'd rather have the tests pass.

Kruno
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Nick Wellnhofer
On 11/06/2015 17:18, Kruno Sever wrote:
> How did you manage to do this? I have been trying around with various versions
> of Strawberry (5.18 to 5.22) on Win 8 today. It compiles but so far the tests
> fail to pass, preventing installation. Here the relevant snippets from the
> output:

Both these issues are known and Windows-related. They should be harmless.

I think we should skip these tests on Windows until someone can investigate
further. Another test failure that I frequently encounter on Windows is
related to removing the test directory `_fstest`.

Nick

Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Kruno Sever
Am 11.06.2015 um 19:36 schrieb Nick Wellnhofer:

> On 11/06/2015 17:18, Kruno Sever wrote:
>> How did you manage to do this? I have been trying around with various
>> versions
>> of Strawberry (5.18 to 5.22) on Win 8 today. It compiles but so far
>> the tests
>> fail to pass, preventing installation. Here the relevant snippets from
>> the
>> output:
>
> Both these issues are known and Windows-related. They should be harmless.
>
> I think we should skip these tests on Windows until someone can
> investigate further. Another test failure that I frequently encounter on
> Windows is related to removing the test directory `_fstest`.

It was in fact a permission problem: the base Strawberry installation
dir had the write-protect flag set and this propagated to newly created
files, in particular those created by the test.

In my case I installed Strawberry from the zip packages and created the
directory manually and apparently inherited the write-protect from the
root dir. The MSI installer might not have that problem.

After fixing the write-protect, the tests run cleanly.

Instead of skipping the test altogether, it might make sense to add a
writability check on the created test files and only skip the test if
that fails, possibly with a warning.

Best
   Kruno
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Kruno Sever
Am 12.06.2015 um 08:16 schrieb Kruno Sever:

> Am 11.06.2015 um 19:36 schrieb Nick Wellnhofer:
>> On 11/06/2015 17:18, Kruno Sever wrote:
>>> How did you manage to do this? I have been trying around with various
>>> versions
>>> of Strawberry (5.18 to 5.22) on Win 8 today. It compiles but so far
>>> the tests
>>> fail to pass, preventing installation. Here the relevant snippets from
>>> the
>>> output:
>>
>> Both these issues are known and Windows-related. They should be harmless.
>>
>> I think we should skip these tests on Windows until someone can
>> investigate further. Another test failure that I frequently encounter on
>> Windows is related to removing the test directory `_fstest`.
>
> It was in fact a permission problem: the base Strawberry installation
> dir had the write-protect flag set and this propagated to newly created
> files, in particular those created by the test.
>
> In my case I installed Strawberry from the zip packages and created the
> directory manually and apparently inherited the write-protect from the
> root dir. The MSI installer might not have that problem.
>
> After fixing the write-protect, the tests run cleanly.
>
> Instead of skipping the test altogether, it might make sense to add a
> writability check on the created test files and only skip the test if
> that fails, possibly with a warning.

Got some more insight now: my base dir did not have in fact the read
only attribute, I just misinterpreted the square it (always) shows in
the Explorer Menu.

The problem rather seems to be with cpan unpacking the package content
of Clownfish::CFC with read-only attributes. After some experimentation,
the following worked for me consistently:

# cmd window 1: unpack module sources in build dir
cpan
get Clownfish::CFC

# cmd window 2: show files with read-only attributes
dir /a:r PATH/TO/STRAWBERRY/cpan/build/*.* /s /b
# now remove those attributes
attr -r PATH/TO/STRAWBERRY/cpan/build/*.* /s /d

# back to cmd #1: finish install of module
install Clownfish::CFC

Not sure if that is a packaging problem that can be fixed on your side
or standard cpan behaviour.

Best
   Kruno
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Compiling Lucy 4.2 Strawberry 5.20

Nick Wellnhofer
On 12/06/2015 12:11, Kruno Sever wrote:
> Got some more insight now: my base dir did not have in fact the read only
> attribute, I just misinterpreted the square it (always) shows in the Explorer
> Menu.
>
> The problem rather seems to be with cpan unpacking the package content of
> Clownfish::CFC with read-only attributes.

> Not sure if that is a packaging problem that can be fixed on your side or
> standard cpan behaviour.

Thanks for the detailed analysis. I fixed this on our side in the master and
0.4 branch:

https://github.com/apache/lucy-clownfish/commit/61067b8539bebef4172d16e84d06ad9a08a08632

I tested by making t/cfbase/Animal.cfh read-only manually, so I expect it to
work with a CPAN tarball as well.

Nick