SGI: Computer Graphics

Compiling YafRay V0.0.7 On MIPSPRO - Page 2

Diego wrote: ...mmmhhh
Anyone has completed succesfully the build of YafRay V0.0.7 on IRIX? ...I got the package already compiled, but on the 'make install' phase I get:

Ok everybody please start laughing at Yafray makefile "specialists", 'cause this one is a real screamer:

Code: Select all

.
g++ -shared -nostdlib /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtbegin.o  .libs/pathlight.o .libs/pathtools.o  -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lyafraycore -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3 -L/usr/bin -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../.. -lstdc++ -lm -L/usr/lib32/mips3 -L/usr/lib32 -lgcc /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtend.o  -Wl,-soname -Wl,libpathlight `test -n "" && echo -Wl,-set_version -Wl,` -Wl,-update_registry -Wl,.libs/so_locations -o .libs/libpathlight
ld32: FATAL   9  : I/O error (-lyafraycore): No such file or directory
collect2: ld returned 32 exit status
libtool: install: error: relink `libpathlight.la' with the above command before installing it
*** Error code 1 (bu21)
*** Error code 1 (bu21)
*** Error code 1 (bu21)
*** Error code 1 (bu21)

g++ ??? what the hell does that do in a mipspro build? Looks like somebody made a sick joke upon us. I tried this myself and even with env settings like 'setenv CXX CC' it still came up with g++.


Sure enough, i found the bug in src/yafraycore/Makefile.in:

Code: Select all

CPP = @CPP@
CPPFLAGS = @CPPFLAGS@

CXX = g++
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
Hardcoded g++ compiler in the makefile. It doesn't get any worse than this. Stupid crack kiddies...

So add this patch:

Code: Select all

--- Makefile.in.save    Fri Jun 17 02:11:56 2005
+++ Makefile.in Fri Jun 17 02:12:16 2005
@@ -51,7 +51,7 @@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@

-CXX = g++
+CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
--- vector3d.h.save     Fri Jun 17 02:20:41 2005
+++ vector3d.h  Fri Jun 17 02:20:54 2005
@@ -26,7 +26,7 @@
#include<config.h>
#endif

-#include<cmath>
+#include<math.h>
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
--- color.h.save        Fri Jun 17 02:23:23 2005
+++ color.h     Fri Jun 17 02:23:36 2005
@@ -28,7 +28,7 @@
#endif

#include <iostream>
-#include <cmath>
+#include <math.h>

#define COLOR_SIZE 3


And this environment:

Code: Select all

setenv CC c99
setenv CXX CC
setenv CFLAGS '-O3 -mips4 -n32'
setenv CXXFLAGS '-O3 -mips4 -n32'
setenv CPPFLAGS '-I/usr/nekoware/include'
setenv LDFLAGS '-L/usr/nekoware/lib  -Wl,-rpath -Wl,/usr/nekoware/lib'
setenv GNUMAKE '/usr/nekoware/bin/make'
setenv PERL '/usr/nekoware/bin/perl'

There are more Makefile.in which also have this harcode. Please fix them accordingly...

The " _ZN6yafray9context_tC1Ev" i recognised as c++ name mangling errors, which would be perfectly logical if one would mix g++ libs with mipspro code.

It could be that the libraries need to be rearchived with CC -ar -WR,-suv -o
I'm rechecking this ATM...
dexter1 wrote: Ok everybody please start laughing at Yafray makefile "specialists", 'cause this one is a real screamer:

Code: Select all

.
g++ -shared -nostdlib /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtbegin.o  .libs/pathlight.o .libs/pathtools.o  -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lyafraycore -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3 -L/usr/bin -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../.. -lstdc++ -lm -L/usr/lib32/mips3 -L/usr/lib32 -lgcc /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtend.o  -Wl,-soname -Wl,libpathlight `test -n "" && echo -Wl,-set_version -Wl,` -Wl,-update_registry -Wl,.libs/so_locations -o .libs/libpathlight
ld32: FATAL   9  : I/O error (-lyafraycore): No such file or directory
collect2: ld returned 32 exit status
libtool: install: error: relink `libpathlight.la' with the above command before installing it
*** Error code 1 (bu21)
*** Error code 1 (bu21)
*** Error code 1 (bu21)
*** Error code 1 (bu21)

g++ ??? what the hell does that do in a mipspro build? Looks like somebody made a sick joke upon us. I tried this myself and even with env settings like 'setenv CXX CC' it still came up with g++.


Nice catch, Dexter! ;)
...but I've also tried using g++ (GCC Version 3.3), and I can't get a clean install here... Hence my words:

Diego wrote: it compiles fine, even with MIPSPRO


As far as I can see, it is not a very clean "multiplatform" sourcecode, but I could be wrong! ;)
Diego wrote: Nice catch, Dexter! ;)
...but I've also tried using g++ (GCC Version 3.3), and I can't get a clean install here... Hence my words:

Diego wrote: it compiles fine, even with MIPSPRO


As far as I can see, it is not a very clean "multiplatform" sourcecode, but I could be wrong! ;)

No Diego, you're missing the entire point.

With the Makefile.in template you ALWAYS compile with g++ even when the ./configure script says it has found CC and you have set environment variables the right way.
The g++ is HARDCODED in all Makefile.in templates...

If you really managed to get it compiled with MIPSPro 7.4.x you should have had complaints with

Code: Select all

#include <cmath>
in 2 files because that is an old, unsupported style header file. See my patch, it's in there...

That's why you need to change all g++ occurences with @CXX@ in all Makefile.in files. Then do a ./configure again and it should start compiling with MIPSPro CC.

The make install problem is an entirely different one. Looks like the supplied libtool severely screws up. The solution is to get the latest libtool from gnu.org ( 1.5.18 ), ./configure;make that one and copy libtool and ltmain.sh to the yafray top source dir. Then do

Code: Select all

./configure --enable-static --disable-fast-install ; gmake ; gmake install

The next thing that you get is that every cout/cerr stream ending with '<<endl' will segfault and dump core. Looks like the coders got overzealous and decided to overload every << instance in their own ostream class. Handy...
Replacing all '<<endl' with '<<"\n"' seems to fix this. Better get a script to do that for you. :)

I have this almost done. Good testing still needs to be done before we can go to '-Ofast -IPA'
hi,

tried it, too.
it's a real pain. seems like the guys over there are some sort of 'made with and for linux' :lol:
hardcoding g++ in some makefiles is crap anyway. no matter which os.
dexter1 wrote: No Diego, you're missing the entire point.

With the Makefile.in template you ALWAYS compile with g++ even when the ./configure script says it has found CC and you have set environment variables the right way.
The g++ is HARDCODED in all Makefile.in templates...


Ouch! :oops: Now I really feel stupid! :lol:
That's it, seems that I'm too much hurried by this days, and I've not taked well care of your post...
Now all has a lot of sense.

dexter1 wrote: If you really managed to get it compiled with MIPSPro 7.4.x you should have had complaints with

Code: Select all

#include <cmath>
in 2 files because that is an old, unsupported style header file. See my patch, it's in there...

That's why you need to change all g++ occurences with @CXX@ in all Makefile.in files. Then do a ./configure again and it should start compiling with MIPSPro CC.


Nah... then, I've never really compiled with MIPSPRO; now I can see the g++ sentences hardcoded in my Makefile.in! :shock:
Sorry, I'm felt in the fact too late. You can see it even in my previous post! Augh! :(

dexter1 wrote: The make install problem is an entirely different one. Looks like the supplied libtool severely screws up. The solution is to get the latest libtool from gnu.org ( 1.5.18 ), ./configure;make that one and copy libtool and ltmain.sh to the yafray top source dir. Then do

Code: Select all

./configure --enable-static --disable-fast-install ; gmake ; gmake install

The next thing that you get is that every cout/cerr stream ending with '<<endl' will segfault and dump core. Looks like the coders got overzealous and decided to overload every << instance in their own ostream class. Handy...
Replacing all '<<endl' with '<<"\n"' seems to fix this. Better get a script to do that for you. :)

I have this almost done. Good testing still needs to be done before we can go to '-Ofast -IPA'


Well; seems a lot of work for a nice piece of software that I'll only use a few minutes by month in my spare time... But stills interesting...
I already have done a tardist install for Blender 2.37a, and I could like to add this one to the list of customizations modules for my SlimDesktop, since both makes a good douple! ;)
SlimDesktop has currently included a tardist for YafRay V0.0.6, but if the new version is "NekoWared" I'll be happy pulling out the 0.0.6 to replace it with another "IRIX-Orphan" software...
The prerequisites for a program, to be added to my SlimDesktop are:

1) Not other tardist versions visible on the net for such program.
2) An IRIX friendly roadmap of the program, without too many gcc/g++ 'isms or platform dependant vicious.
3) That the program by itself can be interesting from a graphic/visual work point of view for the end user.
4) That the program can enhance the already available features on IRIX/IMD/4Dwm.
5) The author agreement about the inclusion of his software on my big tardist install! :) ...Even when sometimes I'm too lazy to ask to the authors, and I only wait for a claim to pull-out the whole thing! ;)

But as a rule of my philosophy, I'll not double efforts already present on the IRIX community, beeing this SGI FreeWare, NekoWare, or whatever else. So, every tardist version already present on SlimDesktop for a given program, yet covered by the SGI/IRIX community, there'll be replaced for a new one acomplishing strictly the above five rules to keep my software rich from the point of view of their originality and usefulness.

This also works as a good way to manage better my time at front my SGI boxes! :)
After some bloody confrontation scenarious with yafray source, i think i have the magic patch file pinned down. Problem only is that i cannot find a mundane test.xml file so i can test the yafray binary. I already tried the test007.zip package and i can't get a sensible xml out of blender. Or the xml code will come out fine, but i get things like this:

Code: Select all

neo:~>yafray YBtest.xml
Starting YafRay ...
Loading grammar ...
Starting parser ...
[Warning]: Unknown camera attr aspect_ratio
[Warning]: Unknown camera attr bokeh_type
[Warning]: Unknown camera attr bokeh_bias
[Warning]: Unknown camera attr bokeh_rotation
Parsing OK

Loading plugins ...
[Warning]: Unknown shader type blendershader
[Warning]: Unknown shader type blendershader
[Warning]: Unknown shader type blendershader
[Error]: undefined shader MAcristal object ignored
[Error]: undefined shader MArojo object ignored
[Error]: undefined shader MArojo object ignored
[Error]: undefined shader MAMaterial object ignored
[Error]: undefined shader MArojo object ignored
[WARNING]:Unused param angle in light
[WARNING]:Unused param cluster in light
[WARNING]:Unused param color in light
[WARNING]:Unused param depth in light
[WARNING]:Unused param fixedradius in light
[WARNING]:Unused param from in light
[WARNING]:Unused param photons in light
[WARNING]:Unused param power in light
[WARNING]:Unused param search in light
[WARNING]:Unused param to in light
[WARNING]:Unused param use_QMC in light
[WARNING]:Unused param cast_shadows in light
[WARNING]:Unused param color in light
[WARNING]:Unused param from in light
[WARNING]:Unused param power in light
[WARNING]:Unused param cache in light
[WARNING]:Unused param cache_size in light
[WARNING]:Unused param caus_depth in light
[WARNING]:Unused param depth in light
[WARNING]:Unused param grid in light
[WARNING]:Unused param ignore_bumpnormals in light
[WARNING]:Unused param power in light
[WARNING]:Unused param samples in light
[WARNING]:Unused param search in light
[WARNING]:Unused param shadow_threshold in light
[WARNING]:Unused param threshold in light
[WARNING]:Unused param use_QMC in light
[Warning]: Wrong type for background constant
[Loader]: Added camera MAINCAM
Using a world resolution of 0.00142857 per unit
Rendering with 5 raydepth
2 anti-alias passes and 4 minimum samples per pass, 8 samples total.
[Warning]: Background world_background does not exist
Building bounding tree ... OK
Light setup ...
Setting up lights ...
Finished setting up lights


Render pass: [########]
Saving Targa file as /tmp/YBtest.tga
OK

... and YBtest.tga is completely black. BTW this is the same in Linux as it is in IRIX. Seems the Yafray coders have their heads firmly in mr Gates' butt...

Can anyone provide me with a small working XML file so i can do some speed testing?
now this thread is starting to make sense :)
This is a normal output from Yafray V0.06, for comparation purposes... oh, and yup, complaining about the Python environment variables, that I must fix at some point in my system :roll:

Code: Select all

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
No installed Python found.
Only built-in modules are available.  Some scripts may not run.
Continuing happily.
Starting scene conversion.
Scene conversion done.
Yafray found at : /usr/local/bin/
Starting parser ...
[Warning]: Unknown camera attr type
[Warning]: Unknown camera attr aspect_ratio
[Warning]: Unknown camera attr dof_distance
[Warning]: Unknown camera attr bokeh_type
[Warning]: Unknown camera attr bokeh_bias
[Warning]: Unknown camera attr bokeh_rotation
Parsing OK

Loading plugins ...
Registered sunlight
Registered arealight
Registered hemilight
Registered spotlight
Registered blendershaders
Registered HDRI background
Registered basicblocks
Registered globalphotonlight
Registered spherelight
Registered mix block
Registered pathlight
Registered softlight
Registered sunsky
Registered photonlight
Registered pointlight
Registered basicshaders
[Loader]: Added shader MAMaterial
[Loader]: Added object OBCube
[Loader]: Added pointlight light LAMP1
[Loader]: Added sunlight light LAMP2
[Loader]: Added pointlight light LAMP3
[Loader]: Added sunlight light LAMP4
[Loader]: Added pointlight light LAMP5
[Loader]: Added constant background world_background
[Loader]: Added camera MAINCAM
Using a world resolution of 0.00285714 per unit
Rendering with 5 raydepth
No anti-aliasing.
Building the bounding tree ... OK
Setting up lights ...
Finished setting up lights
Launching 1 threads for rendering ...
Rendering ...
0%                 50%                 100%
[########################################]
Threads finished
Saving Targa file as /WareRoot/YBtest.tga
OK
Yafray completed successfully
Saved session recovery to /tmp/quit.blend

Blender quit


The generated XML file :

Code: Select all

<scene>

<shader type="blendershader" name="MAMaterial" >
<attributes>
<color r="0.756191" g="0.756191" b="0.756191" />
<specular_color r="1.000000" g="1.000000" b="1.000000" />
<mirror_color r="1.000000" g="1.000000" b="1.000000" />
<diffuse_reflect value="0.800000" />
<specular_amount value="0.500000" />
<hard value="50" />
<alpha value="1.000000" />
<emit value="0.000000" />
<matmodes value="traceable shadow" />
</attributes>
</shader>

<transform m00="1.000000" m01="0.000000" m02="0.000000" m03="0.000000"
m10="0.000000" m11="1.000000" m12="0.000000" m13="0.000000"
m20="0.000000" m21="0.000000" m22="1.000000" m23="0.000000"
m30="0.000000" m31="0.000000" m32="0.000000" m33="1.000000">
<object name="OBCube" shadow="on"  shader_name="MAMaterial" >
<attributes>
</attributes>
<mesh autosmooth="0.1" has_orco="on" >
<points>
<p x="1.000000" y="1.000000" z="-1.000000" />
<p x="0.999999" y="1.000000" z="-1.000000" />
<p x="1.000000" y="-1.000000" z="-1.000000" />
<p x="0.999999" y="-0.999999" z="-1.000000" />
<p x="-1.000000" y="-1.000000" z="-1.000000" />
<p x="-1.000000" y="-0.999999" z="-1.000000" />
<p x="-1.000000" y="1.000000" z="-1.000000" />
<p x="-0.999999" y="1.000000" z="-1.000000" />
<p x="1.000001" y="1.000000" z="1.000000" />
<p x="1.000000" y="0.999999" z="1.000000" />
<p x="-0.999999" y="1.000000" z="1.000000" />
<p x="-1.000000" y="1.000000" z="1.000000" />
<p x="-1.000000" y="-1.000000" z="1.000000" />
<p x="-1.000000" y="-0.999999" z="1.000000" />
<p x="1.000000" y="-1.000001" z="1.000000" />
<p x="0.999999" y="-1.000000" z="1.000000" />
</points>
<faces>
<f a="0" b="2" c="4" shader_name="MAMaterial" />
<f a="4" b="6" c="0" shader_name="MAMaterial" />
<f a="8" b="10" c="12" shader_name="MAMaterial" />
<f a="12" b="14" c="8" shader_name="MAMaterial" />
<f a="0" b="8" c="14" shader_name="MAMaterial" />
<f a="14" b="2" c="0" shader_name="MAMaterial" />
<f a="2" b="14" c="12" shader_name="MAMaterial" />
<f a="12" b="4" c="2" shader_name="MAMaterial" />
<f a="4" b="12" c="10" shader_name="MAMaterial" />
<f a="10" b="6" c="4" shader_name="MAMaterial" />
<f a="8" b="0" c="6" shader_name="MAMaterial" />
<f a="6" b="10" c="8" shader_name="MAMaterial" />
</faces>
</mesh>
</object>
</transform>

<light type="pointlight" name="LAMP1" power="29.999983" cast_shadows="off" >
<from x="0.000001" y="0.039670" z="10.092789" />
<color r="1.000000" g="1.000000" b="1.000000" />
</light>

<light type="sunlight" name="LAMP2" power="1.000000" cast_shadows="off" >
<from x="0.000000" y="0.000000" z="1.000000" />
<color r="1.000000" g="1.000000" b="1.000000" />
</light>

<light type="pointlight" name="LAMP3" power="29.999983" cast_shadows="off" >
<from x="0.047583" y="10.031761" z="0.005537" />
<color r="1.000000" g="1.000000" b="1.000000" />
</light>

<light type="sunlight" name="LAMP4" power="1.000000" cast_shadows="off" >
<from x="0.000000" y="0.000000" z="1.000000" />
<color r="1.000000" g="1.000000" b="1.000000" />
</light>

<light type="pointlight" name="LAMP5" power="29.999983" cast_shadows="off" >
<from x="0.047582" y="-10.047583" z="0.005538" />
<color r="1.000000" g="1.000000" b="1.000000" />
</light>

<background type="constant" name="world_background" >
<color r="0.056563" g="0.220815" b="0.400000" />
</background>

<camera name="MAINCAM" type="perspective" resx="320" resy="240"
focal="1.093750" aspect_ratio="1.000000"
dof_distance="0.000000" aperture="0.000000" use_qmc="on"
bokeh_type="disk1" bokeh_bias="uniform" bokeh_rotation="0.000000" >
<from x="6.282718" y="-5.000000" z="5.866797" />
<to x="0.046017" y="-0.095082" z="-0.125717" />
<up x="5.792415" y="-4.648865" z="6.664486" />
</camera>

<render camera_name="MAINCAM"
raydepth="5" gamma="1.000000" exposure="0.000000"
AA_passes="0" AA_minsamples="1"
AA_pixelwidth="1.5" AA_threshold="0.05" bias="0.001000"
background_name="world_background"
>
<outfile value="/WareRoot/YBtest.tga" />
</render>

</scene>


These will give you a cube with the upper face hardly enlightened...
Oh Mr Diego, i think you might want to read this:

viewtopic.php?t=1826&start=112
dexter1 wrote: Oh Mr Diego, i think you might want to read this:

viewtopic.php?t=1826&start=112


Very cool Dexter!
...Now we can play again with raytraycing on Blender using the latest version of YafRay! I'll download now to give it a try. Thanks by the mention of the NekoWare thread... ;)
I timed big.xml on an Octane2/R12k@400/2gig and on a Notebook(P IV, 3 GHZ, 512 meg)

The notebook runs yafray from debian stable, while the irixbox runs neko-yafray:

octane:
real 3m30.63s
user 2m56.788s
sys 0m0.221s

linuxbook:
real 4m35.402s
user 4m17.550s
sys 0m0.080s

:D
maybe the built on debian is not very optimized, but most user won't optimize their apps...still this is surprising...
Whoa, I wonder if the extra memory of the Octane was part of that... It looks like the octane did those renders in about half of the time of the Linux 'Book.
I [heart] the Performer Town Demo
Where can I get big.xml, I'd like to run it on the Onyx350?
squeen wrote: Where can I get big.xml, I'd like to run it on the Onyx350?

It's mentioned in thread: viewtopic.php?t=1826&start=112

big.xml
r12k@300 8mb cache

Code: Select all

real    3m43.328s
user    3m42.527s
sys     0m0.169s


r10k@250 4mb cache

Code: Select all

real    4m53.950s
user    4m17.997s
sys     0m33.644s



regards
Joerg
Wow!; nice benchamarking figures... I guess I must run the test on my O2/602MHz to have the whole picture about what different processors/platforms can do with Dexter's build of YafRay!

...Great to see that our monsters can crunch ray traces really fast! ;)
http://www.acid.org/

Did anyone else used to do this? Any way I can make ANSI art on my o2?
miunk wrote:
Any way I can make ANSI art on my o2?


emacs?
Hmm, is that similar to aciddraw? Just kidding. I have avoided learning emacs for so long it would be a shame to start now.
after 23 years i can't do with anything else :)