Page 1 of 1

mupdf - linker cannot find isfinite()

Posted: Mon Jan 23, 2017 5:09 pm
by jimmer
Hey all,

Am reporting this from memory from a PC as redbox is powered down now.

I pulled mupdf from the web a few days ago and attempted to build it with GCC. the 4.7.x one from nekoware. Much to my surprise the compile chugged along nicely, and though I did need to add some defs for NaN and INFINITE and do a little handholding, the compile of the main parts seems to pass pretty painless... Unfortunately, the linker throws a spanner in the works and bails as it tries to find isfinite() symbols.

Perhaps somebody who actually knows what they are doing would consider making/taking some time to look into this?

Many thanks,

J.

Re: mupdf - linker cannot find isfinite()

Posted: Tue Jan 24, 2017 2:13 am
by dexter1
What's the code like? C++ or C?
isfinite() appears in the C99 language definitions, C99 standard (ISO/IEC 9899:1999): 7.12.3.2 The isfinite macro (p: 216-217) to be exact. But IRIX doesn't go that far w.r.t. support for that specific function.

Is there a gcc library you can link against to resolve these external functions like isfinite()?

If you can't do that, maybe you can fudge in an isfinite() macro pulled from somewhere else, or use finite() since that is in IRIX libc. This give +1 on a finite number and 0 if the number is +-INF or a NAN

Re: mupdf - linker cannot find isfinite()

Posted: Tue Jan 24, 2017 3:12 am
by foetz
jimmer wrote:though I did need to add some defs for NaN and INFINITE and do a little handholding, the compile of the main parts seems to pass pretty painless... Unfortunately, the linker throws a spanner in the works and bails as it tries to find isfinite() symbols.

if you added a workaround for isfinite() you have to remove all calls to isfinite() as well as all prototypes to avoid linker errors.

Re: mupdf - linker cannot find isfinite()

Posted: Tue Jan 24, 2017 6:21 am
by Hakimoto
mupdf is a beautiful pdf viewer. I've been using it for a number of years now. Would certainly be lovely if you get it running on IRIX. Keep in mind, though, it's a pure viewer. Keyboard-driven and no printing or other "useless" functions. ;P

Re: mupdf - linker cannot find isfinite()

Posted: Wed Jan 25, 2017 8:48 am
by jimmer
Well, for a change I have some good news.

With the help of the lovely MuPDF people on irc.freenode.net I've managed to build MuPDF cleanly on IRIX. Big up to them for the help.

The other bit of good news is that MuPDF seems to be faster than xpdf. By OMG! levels of faster. And it does CBZ, EPUB and other sexy stuffs. It's just bettah.

Not sure where I'm taking this from here. I guess I should look into adding some UI to the bare x11 'example' which they provide in the tarball.

J.

PS. I stopped the compile at the x11 portion. I did not build the OpenGL-based example viewer.

Re: mupdf - linker cannot find isfinite()

Posted: Wed Jan 25, 2017 9:25 am
by foetz
jimmer wrote:Well, for a change I have some good news.

With the help of the lovely MuPDF people on irc.freenode.net I've managed to build MuPDF cleanly on IRIX.

that's great. would you also share these insights and maybe even the resulting binary?

Re: mupdf - linker cannot find isfinite()

Posted: Wed Jan 25, 2017 11:05 am
by jimmer
Made a little tardist. Where to upload? It's 35Mb.

Re: mupdf - linker cannot find isfinite()

Posted: Wed Jan 25, 2017 11:31 am
by foetz
ftp.nekochan.net/incoming

Re: mupdf - linker cannot find isfinite()

Posted: Thu Jan 26, 2017 2:35 pm
by jimmer
Done. And Nekonoko has kindly moved the simple tardist I made of stock MuPDF-x11 1.10a here:

ftp://ftp.nekochan.net/pub/downloads/contrib/jimmer

Hope this works for somebody :)