RE: [Repost] Building with VS.NET 2003 and ICU 2.8 on Win32

2005-02-02 Thread Sriram Krishnan

 
Thanks for the reply. Readme.Win32 should have a notice about building in
anything other than Visual Studio 6. Since 'msdev' is hardcoded inside the
ICU build stuff, it *won't build on anything other than Visual Studio 6*.
For anyone interested, I've written step-by-step instructions on how to
build it at
http://dotnetjunkies.com/WebLog/sriram/archive/2005/01/28/49040.aspx .

>Would you care to retrace your steps carefully from a clean CVS HEAD, 
>and provide a detailed description (eg, console in and output)?

Doing so.I have Windows XP SP2 with Visual Studio 2003. My ICU binaries are
at D:/lib/icu/bin and /lib respectively. Parrot is at D:/parrot/parrot. For
anyone building ICU from source on Win32, make sure you do a release build
as the filenames are different for the debug build.

Attempt #1
---

First, Readme.Win32 asks us to use " perl Configure.pl
--icushared="C:\usr\lib\icu\lib\icudata.lib C:\usr\lib\icu\lib\icuuc.lib"
--icuheaders="C:\usr\lib\icu\include""

So I run

  D:\parrot\parrot>perl Configure.pl --icushared="D:\lib\icu\lib\icudata.lib
D:\lib\icu\lib\icuuc.lib" --icuheaders="D:\lib\icu\include"

After configuring, I run nmake.

D:\parrot\parrot\nmake

Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C)
Microsoft Corporation.  All rights reserved.

Compiling with:
xx.c
cl -nologo -GF -W3 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
-DNO_HASH_SE D -Zi -I./include -ID:\lib\icu\include -DHAS_JIT -DI386 -I. -Fo
xx.obj -c xx.c

A bunch of warnings later (about unreferenced local variables,etc), I get
this

.\parrot -o runtime\parrot\include\parrotlib.pbc
runtime\parrot\library\ parrotlib.imc

This throws an access violation and lands me in the debugger. The problem
here  is in string.c

   data_dir = Parrot_getenv("PARROT_ICU_DATA_DIR", &free_data_dir);
if (data_dir == NULL) {
const char *prefix;
char *p, *build_path;
build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
/*
 * if the installed --prefix directory exists then use it
 */
prefix = Parrot_get_runtime_prefix(interpreter, NULL);
if (prefix) {
p = strstr(build_path, "blib");/* .../blib/lib/...
*/
assert(p);
--p;/* slash or backslash */
data_dir = mem_sys_allocate(strlen(prefix) + strlen(p) + 1);
strcpy(data_dir, prefix);
strcat(data_dir, p);
free_data_dir = 1;
}
}
The problem is that data_dir is a blank string - PARROT_ICU_DATA_DIR seems
to have a null string which causes it to finally blow up in the strlen(p)
call. What is interesting is that the assert doesn't get called at all - so
there's something wrong with the compiler switches as well.

Attempt #2
--

Now, the next attempt I made was by passing --icudatadir also (as
D:/lib/icu/source/data/out). This time, PARROT_ICU_DATA_DIR gets assigned
properly but the code blows up in the same section. The reason this time is
that there is no "blib" anywhere in the path of the datadir - which causes
the strstr to return 0x0 which becomes 0xF after p--. I'm not really
sure why the data directory must be under "blib" though - and if so, what is
the point of a command line paramter to specify where it should be?

Attempt #3
---

This time, I copied the contents of my data directory into the blib folder
and configured it like this

D:/parrot/parrot>perl Configure.pl --icushared="D:\lib\icu\lib\icudata.lib
D:\lib\icu\lib\icuuc.lib" --icuheaders="D:\lib\icu\include"
--icudatadir="D:\parrot\parrot\blib\lib" 

This time, the build succeeds (as "blib" is present in the datadir path).
However, the linking during the 'nmake test' fails with the same error you
saw.

Attempt #4
---

I removed nci_dlvar_vv  from libnci_test.def and built again.This lets me
actually run the tests. My output for the tests are identical to yours (with
the nci tests failing).

Thanks,
Sriram






[Repost] Building with VS.NET 2003 and ICU 2.8 on Win32

2005-02-01 Thread Sriram Krishnan


If you've already seen this through the Google Groups interface, sorry! I'm
kind of confused about the syncing between the Google interface and this
list - and it seems that my posts never made it here.  The original is here
(http://groups-beta.google.com/group/perl.perl6.internals/browse_thread/thre
ad/dd3cb5e94f1eb835/74b248bf61c2f1f6?_done=%2Fgroup%2Fperl.perl6.internals%3
F&_doneTitle=Back+to+topics&_doneTitle=Back&&d#74b248bf61c2f1f6).

 I'm reproducing all 3 posts below
 
Post #1
---
 
 
I'm a Parrot newbie so forgive me if this has already been a-ddressed. 
I'm trying to build Parrot (from CVS) on Win XP Sp2 with VS.-NET 2003. 


1.The current build scripts for ICU refer to 'msdev'. 'msdev-' was the
executable for Visual Studio 6 . The executable, the command-line switches
as well as the file format have changed for VS.NET -2002 and
2003.Unfortunately, my unfamiliarity with Perl means that I -cannot submit a
patch :( 


2. After downloading the latest ICU source from IBM's site, -I built that
from source (they have updated their src distribution t-o support building
using VS 2003). 


Now, the Readme files says that you have to set icushared an-d icuheader -
but even after I set both to point to my ICU bui-ld, the build broke the
first time it tried to run parrot.exe (durin-g the nmake itself). 


The offending piece of code is this (in string.c) 


data_dir = Parrot_getenv("PARROT_ICU_DATA_DIR", &free_data_d-ir); 
if (data_dir == NULL) { 
const char *prefix; 
char *p, *build_path; 
build_path = data_dir = const_cast(DEFAULT_ICU_D-ATA_DIR); 
/* 
 * if the installed --prefix directory exists th-en use it 
 */ 
prefix = Parrot_get_runtime_prefix(interpreter, -NULL); 
if (prefix) { 
p = strstr(build_path, "blib"); 
   assert(p); 
--p;/* slash or backslash */ 
data_dir = mem_sys_allocate(strlen(prefix) +- strlen(p) 
+ 1);
strcpy(data_dir, prefix); 
strcat(data_dir, p); 
free_data_dir = 1; 
} 


The first time I tried building it, the strstr call returned- a bad pointer.
Some investigation showed that the ICU data directo-ry was an empty string.
So this time, I tried building again, by passi-ng icudatadir to
Configure.pl. 


The assert call wasn't being executed at all - must be somet-hing with the
compiler options. 


It again crashed at the same spot - this time because the bu-ild_path 
variable contained the ICU data dir -but there is no "blib" -anywhere 
in it, making the strstr call fail. 


Am I missing something pretty basic here? 


Post #2


I managed to get it to build finally. I built ICU 2.8 and co-py-pasted 
the data output to the blib folder.I don't think this is the- way to do 
it - but hey..it works :) 

Post #3
--

Yet another Win32 + VS 2003 update. 


My 'nmake test' was failing with a liner error about nci_dlv-ar_vv. 
After removing that from libnci_test.def, I was able to atle-ast run the 
tests. Dynclass and nci tests failed - and at the end, got a- weird 
error about perl.exe. Here's the output 


Failed TestStat Wstat Total Fail  Failed  List o-f Failed 


t\dynclass\pybuiltin.t5  1280 65  83.33%  1-2 4--6 
t\dynclass\pyclass.t  6  1536 66 100.00%  1-6 
t\dynclass\pycomplex.t1   256 11 100.00%  1 
t\dynclass\pyfunc.t   4  1024 44 100.00%  1-4 
t\dynclass\pyint.t   25  640025   25 100.00%  1-25 
t\pmc\nci.t  55 1408056   55  98.21%  1-55 
7 tests and 64 subtests skipped. 
Failed 6/133 test scripts, 95.49% okay. 96/2166 subtests fai-led, 95.57% 
oka 
NMAKE : fatal error U1077: 'D:\Perl\bin\perl.exe' : return c-ode '0xff' 
Stop. 



Thanks,
Sriram