- From: lpsmith at spod-central.org (Lucian Smith)
- Subject: [cellml-dev] compiling Telicims
- Date: Wed, 29 Dec 2010 00:50:21 +0000
* Andrew Miller <ak.miller at auckland.ac.nz> [2010-12-28 23:55] writes:
>
On 29/12/10 12:28, Lucian Smith wrote:
>
>OK, inching along here...
>
>
>
>One positive update is that I discovered in the latest Windows build
>
>without xulrunner that I can actually click on the test .exe programs
>
>produced by the cellml API and they run instead of saying something along
>
>the lines of 'This file is screwed up somehow; maybe it's a 16 vs 32-bit
>
>problem?' I also can run them from a Windows command line instead of only
>
>from a cygwin command line. So that's hugely important, and a great sign.
>
>
>
>On the negative side on Windows, I still can't get it to build
>
>libtelicems. As noted in my last message, if I configure manually within
>
>cygwin, I get an error message, and if I run win32-dev-setup after
>
>manually updating setup-cellml-api.sh to include '--enable-telicems',
>
>everything runs, but the library is not created. I'm not sure how I can
>
>tell if it's being configured correctly and not being run, or what.
>
>
I think we may have regressed somewhat on the Windows build, since we
>
currently have technical problems with the build system - that is
>
something that should be sorted out early next year (we are waiting on
>
new hardware for a proper Windows build system) - I think the best first
>
step for Lucian is to get everything working well on POSIX systems, and
>
then look into the issues porting it to Windows.
Well, OK. Please do keep me in the loop--we're trying to get this
released as soon as possible, and the major new feature is CellML
translation.
>
>On UNIX, I can now successfully compile the cellml api with telicems
>
>enabled, and it creates libtelicems in cellml-api/.libs/ There are test
>
>files that are missing (as noted in my previous email) causing 'make' to
>
>fail, so I just went through the Makefile and deleted them; the result was
>
>that 'make' successfully created everything else. (While you're fixing
>
>things, 'make install' does not install libtelicems yet.)
>
>
>
>This lets me compile libantimony successfully, along with cellml2antimony
>
>and antimony2cellml. However, the former crashes (well, asserts) within a
>
>routine written for me by Andrew 'makeUTF16', designed to convert
>
>std::strings to wstrings. This is perhaps outside the purview of this
>
>group, but if anyone else ever uses the api in C++, they may well do the
>
>same thing, so or what it's worth, here's the output from running it
>
>within gdb:
>
>
I think that it is probably a downstream effect of some kind of memory
>
usage error earlier on corrupting things. I'd suggest running it through
>
valgrind memcheck which will probably find the original cause of the crash.
Indeed, valgrind confirms that there was a memory usage error--one line
previously, in makeUTF16 ;-)
==2772== Command: cellml2antimony
/home/lpsmith/CellML/models/adrian_chandler_hodgkin_1970/adrian_chandler_hodgkin_1970.cellml
==2772==
==2772== Invalid write of size 4
==2772== at 0x471715B: __gconv_transform_ascii_internal (loop.c:332)
==2772== by 0x4781F4E: __mbsrtowcs_l (mbsrtowcs_l.c:124)
==2772== by 0x4777A49: mbsrtowcs (mbsrtowcs.c:34)
==2772== by 0x473513F: mbstowcs (mbstowcs.c:39)
==2772== by 0x80547A5: makeUTF16(std::string const&) (antimony_api.cpp:28)
==2772== by 0x8056BAA: loadCellMLFile (antimony_api.cpp:331)
==2772== by 0x8053A83: main (cellml2antimony.cpp:21)
==2772== Address 0x49c36b0 is 184 bytes inside a block of size 186 alloc'd
==2772== at 0x402532E: operator new[](unsigned int)
(vg_replace_malloc.c:299)
==2772== by 0x8054777: makeUTF16(std::string const&) (antimony_api.cpp:27)
==2772== by 0x8056BAA: loadCellMLFile (antimony_api.cpp:331)
==2772== by 0x8053A83: main (cellml2antimony.cpp:21)
Then after attaching to the debugger:
(gdb) bt
#0 0x0471715b in ascii_internal_loop (step=0x484fbc0, data=0xbebd9284,
inptrp=0xbebd92b0, inend=0x49c35c1 "", outbufstart=0x0,
irreversible=0xbebd92b4, do_flush=0, consume_incomplete=1)
at ../iconv/loop.c:332
#1 __gconv_transform_ascii_internal (step=0x484fbc0, data=0xbebd9284,
inptrp=0xbebd92b0, inend=0x49c35c1 "", outbufstart=0x0,
irreversible=0xbebd92b4, do_flush=0, consume_incomplete=1)
at ../iconv/skeleton.c:611
#2 0x04781f4f in __mbsrtowcs_l (
dst=0x49c35f8 L"/home/lpsmith/CellML/models/adrian_chandler_ho",
src=0xbebd9314, len=92, ps=0xbebd92fc, l=0x48503a0) at
mbsrtowcs_l.c:124
#3 0x04777a4a in __mbsrtowcs (
dst=0x49c35f8 L"/home/lpsmith/CellML/models/adrian_chandler_ho",
src=0xbebd9314, len=92, ps=<value optimized out>) at mbsrtowcs.c:34
#4 0x04735140 in mbstowcs (
pwcs=0x49c35f8 L"/home/lpsmith/CellML/models/adrian_chandler_ho",
s=0x49c3564
"/home/lpsmith/CellML/models/adrian_chandler_hodgkin_1970/adrian_chandler_hodgkin_1970.cellml",
n=92) at mbstowcs.c:39
#5 0x080547a6 in makeUTF16 (aStr=...) at src/antimony_api.cpp:28
#6 0x08056bab in loadCellMLFile (
filename=0xbebd9623
"/home/lpsmith/CellML/models/adrian_chandler_hodgkin_1970/adrian_chandler_hodgkin_1970.cellml")
at src/antimony_api.cpp:331
#7 0x08053a84 in main (argc=2, argv=0xbebd94d4) at
src/cellml2antimony.cpp:21
(gdb) frame 5
#5 0x080547a6 in makeUTF16 (aStr=...) at src/antimony_api.cpp:28
28 mbstowcs(buf, aStr.c_str(), aStr.length());
I don't know anything about mbstowcs, but 'aStr' seems to be fine.
-Lucian
Archive powered by MHonArc 2.6.18.