Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Tuesday, December 21, 2010

Building installation of FreeWRL for Fedora 12/13/14 on X86_64


The official site of FreeWRL only provides installation guide for Ubuntu in the range of Linux series. While different OS has different tool kit and features (esp. installed packages or library requirements), 
the instruction can not simply lead you to success in installation of FreeWRL for fedora.

Here to go:

the guided steps should be:

cd freewrl/freex3d
sh autogen.sh /bin/bash
./configure --with-target=motif --prefix=/usr --with-fontsdir=/usr/share/fonts/bitstream-vera
make
make install


But you might most possibly get stunt before make.

In order to generate ./configure, "sh autogen.sh" will constantly complain under Fedora like :
Remaining args: /bin/bash
Platform: Linux
Please install the ttf-bitstream-vera font package.

and to do nothing further, thus we can not go to ./configure since it was blocked to produce.

open the autogen.sh it can be found that this script is mostly catering for Debian among Linux platforms:
case $platform in
    Linux)
        echo "Platform: Linux"


if [ -f /etc/debian_version ] ; then
            echo "Distribution: Debian / Ubuntu"
            if [ -d /usr/share/fonts/truetype/ttf-bitstream-vera ] ; then
                fontsdir=/usr/share/fonts/truetype/ttf-bitstream-vera
            fi
        else
            echo "Please install the ttf-bitstream-vera font package."
            exit 0
        fi


In a coarse way, just forcibly comment out the "exit 0" line. Then run the script back again.

It can work and spawn ./configure !
then Here we go!

2. Get the source code from CVS so that I touch the latest. Might it be unstable like the release packages, but most likely it is okay.
cvs -z3 -d:pserver:anonymous@freewrl.cvs.sourceforge.net:/cvsroot/freewrl checkout -P freewrl

Sure, You can also simple pick source code releases from the project page of FreeWRL on sourceForge
at http://sourceforge.net/projects/freewrl/files/freewrl-linux/1.22/freewrl-1.22.10.tar.bz2/download
 
3. Install Font stuffs that FreeWRL needs

a. FreeType devel component
yum -y install freetype-devel
b. ttf-bitstream-vera TrueType font
yum -y install bitstream-vera-fonts-1.10-0.fdr.14.noarch.rpm 

Not done with this gnat yet, for sure should get the real thing, font files.
wget http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf-bitstream-vera-1.10.zip

unpack it, should see the 10 font files inside

mkdir -p /usr/share/fonts/ttf-bitstream-vera/
cp ttf-bitstream-vera-1.10/*.ttf /usr/share/fonts/ttf-bitstream-vera/
 
then, update the font cache with this new font
fc-cache -f -v /usr/share/fonts/ttf-bitstream-vera/
 
again, flush the cache
fc-cache -f -v 

4. other miscellaneous components, stumped with them during ./configure with freeWRL
 
a. the expat XML Parser 
  yum -y install expat-devel
  yum -y install expat
 
b. the Mozilla XUL (XML User Interface Language) runtime backend
  yum -y install xulrunner-devel
 
c.Javascript Engine and the seamonkey internet suite component
  yum -y install rhino
  yum -y install seamonkey

d. X window libraries
yum -y install libXmu-devel
yum -y install libXaw-devel
 
e. the  Enlightenment Foundation Libraries (EFL) graphical library
yum -y install imlib2 
 
if this is not sufficient to make the ./configure  aware of imlib2, play the trump:
yum -y install imlib2.x86_64 imlib2-devel.x86_64
 
5. install openMotif
(if you succeeded by "locate "Xm/Xm.h", skip this step)
yum -y install openmotif
yum -y install openmotif-devel 
yum install openmotif-2.3.3-1.fc12.x86_64.rpm (for my X86_64 machine)
 
if this gives no cure, then  erase it 
yum -y erase openmotif 
and reinstalled. 
 
Download and build it with source code, it might not be straightforward as imagined. 
(see for detail  http://surfingtroves.blogspot.com/2010/12/compiling-openmotif-under-fedora-13.html )
 
6. install OpenGL extension : GLEW
yum -y install glew
yum -y install glew-devel 
 
7. get back to freeWRL
cd freewrl/freex3d
./configure --with-target=motif --prefix=/usr --with-fontsdir=/usr/share/fonts/ttf-bitstream-vera 
make
make install
 
8. set LD_LIBRARY_PATH, make sure it includes where the dynamic libraries libFreeWRL.so.*
are situated.
provided they are placed by "make install" under /usr/lib, then 
export  LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
 
9. almost get it, verify by testing
cd freewrl/freewrl/tests
freewrl *.wrl (choose any of them to test) 
 
10. see the graphical things? all well done! 
 
(for the stuff above, http://freewrl.sourceforge.net/TomSmithCore13.html was referred!)
 
* Other pages to refer :
 
http://www.gnome.org/fonts/ 
http://www.cb1.com/~john/notes/fedora-font-install.html
 
(should any more questions, please post as comments below, will check it and try to solve it.)



------------------------------------------------------------
[ Supplement ]

Some others reported that during the "make", still more problems arise like :



/usr/include/xulrunner-sdk-1.9.2/expat.h:530:43: warning: type defaults to 'int' in declaration of 'XML_Char'
/usr/include/xulrunner-sdk-1.9.2/expat.h:530:52: error: expected ';', ',' or ')' before '*' token
/usr/include/xulrunner-sdk-1.9.2/expat.h:535:23: error: expected declaration specifiers or '...' before 'XML_StartElementHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:536:23: error: expected declaration specifiers or '...' before 'XML_EndElementHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:540:28: error: expected declaration specifiers or '...' before 'XML_StartElementHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:544:26: error: expected declaration specifiers or '...' before 'XML_EndElementHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:548:29: error: expected declaration specifiers or '...' before 'XML_CharacterDataHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:552:37: error: expected declaration specifiers or '...' before 'XML_ProcessingInstructionHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:555:23: error: expected declaration specifiers or '...' before 'XML_CommentHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:576:23: error: expected declaration specifiers or '...' before 'XML_DefaultHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:584:29: error: expected declaration specifiers or '...' before 'XML_DefaultHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:588:27: error: expected declaration specifiers or '...' before 'XML_StartDoctypeDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:593:32: error: expected declaration specifiers or '...' before 'XML_StartDoctypeDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:601:34: error: expected declaration specifiers or '...' before 'XML_UnparsedEntityDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:605:28: error: expected declaration specifiers or '...' before 'XML_NotationDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:609:29: error: expected declaration specifiers or '...' before 'XML_StartNamespaceDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:610:29: error: expected declaration specifiers or '...' before 'XML_EndNamespaceDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:614:34: error: expected declaration specifiers or '...' before 'XML_StartNamespaceDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:618:32: error: expected declaration specifiers or '...' before 'XML_EndNamespaceDeclHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:626:33: error: expected declaration specifiers or '...' before 'XML_ExternalEntityRefHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:638:29: error: expected declaration specifiers or '...' before 'XML_SkippedEntityHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:642:31: error: expected declaration specifiers or '...' before 'XML_UnknownEncodingHandler'
In file included from x3d_parser/X3DParser.c:57:0:
/usr/include/xulrunner-sdk-1.9.2/expat.h:683:42: warning: type defaults to 'int' in declaration of 'XML_Char'
/usr/include/xulrunner-sdk-1.9.2/expat.h:683:51: error: expected ';', ',' or ')' before '*' token
In file included from x3d_parser/X3DParser.c:57:0:
/usr/include/xulrunner-sdk-1.9.2/expat.h:723:38: warning: type defaults to 'int' in declaration of 'XML_Char'
/usr/include/xulrunner-sdk-1.9.2/expat.h:723:47: error: expected ';', ',' or ')' before '*' token
/usr/include/xulrunner-sdk-1.9.2/expat.h:725:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from x3d_parser/X3DParser.c:57:0:
/usr/include/xulrunner-sdk-1.9.2/expat.h:850:38: warning: type defaults to 'int' in declaration of 'XML_Char'
/usr/include/xulrunner-sdk-1.9.2/expat.h:850:47: error: expected ';', ',' or ')' before '*' token
In file included from x3d_parser/X3DParser.c:57:0:
/usr/include/xulrunner-sdk-1.9.2/expat.h:957:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/include/xulrunner-sdk-1.9.2/expat.h:961:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/include/xulrunner-sdk-1.9.2/expat.h:992:19: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token
In file included from x3d_parser/X3DParser.c:57:0:
/usr/include/xulrunner-sdk-1.9.2/expat.h:1010:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
x3d_parser/X3DParser.c: In function 'getRoutingInfo':
x3d_parser/X3DParser.c:440:10: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c:444:10: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c:448:10: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c: In function 'saveAttributes':
x3d_parser/X3DParser.c:1277:54: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c:1279:53: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c:1281:54: warning: assignment from incompatible pointer type
x3d_parser/X3DParser.c: In function 'initializeX3DParser':
x3d_parser/X3DParser.c:1754:3: warning: implicit declaration of function 'XML_ParserCreate'
x3d_parser/X3DParser.c:1754:36: warning: assignment makes pointer from integer without a cast
x3d_parser/X3DParser.c:1755:3: error: too many arguments to function 'XML_SetElementHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:534:1: note: declared here
x3d_parser/X3DParser.c:1757:3: error: too many arguments to function 'XML_SetDefaultHandler'
/usr/include/xulrunner-sdk-1.9.2/expat.h:575:1: note: declared here
x3d_parser/X3DParser.c: In function 'X3DParse':
x3d_parser/X3DParser.c:1824:4: warning: implicit declaration of function 'XML_ErrorString'
x3d_parser/X3DParser.c:1825:4: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
make[3]: *** [x3d_parser/X3DParser.lo] Error 1
make[3]: Leaving directory `/root/freewrl/freex3d/src/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/freewrl/freex3d/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/freewrl/freex3d'
make: *** [all] Error 2


For the solutions, istakenv's suggestion is really simple but great. Since it is in the comment area which is not always presented on the page, I copied here for your ease of reading:

There is an issue with the way expat and xulrunner are installed on most
linux systems. FreeWRL needs to use the system-wide expat (installed to
/usr/include), whereas xulrunner bundles an expat and, due to the way that
gcc -always- puts priority on "-I/path/to/include" arguments over
/usr/include, gcc always ends up compiling with the expat.h bundled in
xulrunner instead of /usr/include/expat.h ... The fix for this is as
follows:

mkdir /tmp/include

cp /usr/include/expat*.h /tmp/include
cd /path/to/freewrl
./configure --with-expat=/tmp


(quoted from http://sourceforge.net/tracker/index.php?func=detail&aid=3061173&group_id=9120&atid=109120 )


2 comments:

Anonymous said...

This is a good write-up. I would like to make a couple of corrections, though:

1 - do not use autogen.sh; simply running "autoreconf --force --install" will work just fine to generate ./configure ... Depelding on the version of autotools in use, there may be some warning messages, there may not.

2 - As of freewrl-1.22.10, there is support for fontconfig and so the specific tryetype fonts are no longer necessary; ./configure --enable-fontconfig can be used to set support for this, and is highly recommended.

3 - Expat is not actually needed by freewrl; libxml2 provides all the functionality required. ./configure --without-expat on freewrl-1.22.10 and above will disable expat checking and by association avoid the expat compile-time issues mentioned above.

4 - Fedora should now have an official rpm available for freewrl, and so none of this should now be necessary.

Surfing Troves said...

Tons of thanks for your comments, really appreciate it!