SGI: Computer Graphics

Wings available for Irix precompiled - Page 3

[maybe this should go to the devel forum]

Compilation instructions for Erlang R11B-1, gcc 3.3, IRIX 6.5.26.
This is to build a 32-bit multithreaded runtime.

1) source patching:
At erts/emulator/sys/unix/sys.c, line 45: comment out "#include <sys/stropts.h>".

2) erts/configure patching:
- case starting at line 1976, add irix6*) DEXPORT="-Wl,-exports";;
- case starting at line 7848, add irix6*) DED_LDFLAGS="-mips4 -shared -all";;

3) configure:
Choose CFLAGS and installation prefix according to your needs.
$ CFLAGS="-mips4 -O3" ./configure --enable-threads --prefix=/usr/nekoware
If you see configure stuck on message "checking for presens of poll()/select() bug when another thread closes fd..." go to Process Manager and kill process "conftest".

4) make:
GNU make is required.
$ gmake
When you see the "Failed to create thread: Operation not permitted (1)" message, become root and do
# chcap "CAP_SCHED_MGT+eip" bin/mips-sgi-irix6.5/beam
then gmake again.

5) install as root:
# gmake install
The installed emulators, beam and beam.hybrid (the "shared heap" variant), have lost the CAP_SCHED_MGT capability.
# chcap "CAP_SCHED_MGT+eip" /usr/nekoware/lib/erlang/erts-5.5.1/bin/beam*

6) test the Erlang command line:
$ erl

That's it for Erlang. Please report any problems.
ESDL and Wings 3D notes will follow soon.

Regards.
-Daniel
VeKTeReX wrote: Can't be included into nekoware due to gcc, but a working tardist would be greatly appreciated.

/KRM


Not quite true. The boinc/setiathome I contributed to nekoware was built (with exception of libfftw) using gcc.
While gcc is not encouraged, if gcc is the only compiler that will work (which can be the case) then that is what you use.

Nik.
nvukovlj wrote:
VeKTeReX wrote: Can't be included into nekoware due to gcc, but a working tardist would be greatly appreciated.

/KRM


Not quite true. The boinc/setiathome I contributed to nekoware was built (with exception of libfftw) using gcc.
While gcc is not encouraged, if gcc is the only compiler that will work (which can be the case) then that is what you use.

Nik.

I was unaware of that, but it's understandable. Thanks for the correction.

/KRM
Hello. Sorry for the delay. Maybe someone managed to compile Erlang following the steps I posted a couple of weeks ago. Here are my notes regarding ESDL and Wings 3D.

Remember: GCC and GNU make required.

ESDL
Using the latest version, 0.96.0626, I followed installation instructions; only had to make these two changes before building:
- in c_src/Makefile, change $OGLDIR/lib to $OGLDIR/lib32
- add "-mips4" and other desired flags to CFLAGS
Previous to this I compiled my own libSDL, but I don't remember it needing special configuration options and this doesn't seem to be a must: nekoware SDL should be fine.

Wings 3D
Using 0.98.35, the latest at the time I tried.
in plugins_src/accel/Makefile:
- remove calls to "install -d $(LIBDIR)" (they fail on my box)
- create directory plugins/accel by hand
- correct GCC definition (add "-mips4" etc)
in plugins_src/autouv/shaders/Makefile:
- remove calls to "install -d $(DIR)"; no need to create anything in this case

It is best to copy (or link) the wings-0.98.35 directory to the lib/erlang/lib directory of your Erlang installation; the same goes for esdl-0.96.0626. That way Erlang will automatically incorporate them to the code path when it boots.

If all goes well you'll now have compiled Wings 3D, but it will lock up as soon as you launch it. Turns out this is because a division by zero causes the emulator (Erlang parlance for VM) to hang, instead of throwing a badarith exception as it should, and a number of these happen while converting from RGB to HSV. Maybe on some other places as well. I've yet to ask some questions in the Erlang mailing list regarding this issue.

At least two source files, wings_init.erl and wings_color.erl, must be patched. I have a 50-line patch file, but there doesn't seem to be a way to attach it to this message, so there it goes.

Code: Select all

--- wings_init.erl   Tue Apr 12 19:31:03 CEST 2005
+++ wings_init.erl.ds   Tue Nov 07 23:07:58 CET 2006
@@ -19,7 +19,7 @@
-include("wings.hrl").

init() ->
-    macosx_workaround(),
+%   macosx_workaround(),
os:putenv("SDL_HAS3BUTTONMOUSE", "true"),

wings_pref:set_default(window_size, {780,570}),

--- wings_color.erl   Sun Jan 23 10:34:56 CET 2005
+++ wings_color.erl.ds   Tue Nov 07 23:07:57 CET 2006
@@ -137,6 +137,11 @@
HSV -> HSV
end.

+safe_div(Q, D) ->
+   case D == 0.0 of
+      true  -> throw(badarith);
+      false -> Q / D end.
+
internal_rgb_to_hsv(R, G, B) ->
Max = lists:max([R,G,B]),
Min = lists:min([R,G,B]),
@@ -143,14 +148,21 @@
V = Max,
{Hue,Sat} = try
{if
-          Min == B -> (G-Min)/(R+G-2.0*Min);
-          Min == R -> (1.0+(B-Min)/(B+G-2.0*Min));
-          Min == G -> (2.0+(R-Min)/(B+R-2.0*Min))
-           end*120,(Max-Min)/Max}
+          Min == B ->     safe_div(G-Min, R+G-2.0*Min); %(G-Min)/(R+G-2.0*Min);
+          Min == R -> 1.0+safe_div(B-Min, B+G-2.0*Min); %(1.0+(B-Min)/(B+G-2.0*Min));
+          Min == G -> 2.0+safe_div(R-Min, B+R-2.0*Min)  %(2.0+(R-Min)/(B+R-2.0*Min))
+           end*120,safe_div(Max-Min, Max)} %(Max-Min)/Max}
catch
-          error:badarith ->
+%          error:badarith ->
+          badarith ->
{undefined,0.0}
end,
+%   {Hue, Sat} = case Max == 0.0 of
+%      false -> {if Min == B -> (G-Min)/(R+G-2.0*Min);
+%                   Min == R -> (1.0+(B-Min)/(B+G-2.0*Min));
+%                   Min == G -> (2.0+(R-Min)/(B+R-2.0*Min)) end*120,
+%                (Max-Min)/Max};
+%      true  -> {undefined, 0.0} end,
{Hue,Sat,V}.

hsv_to_rgb(H, S, V) ->


It seems phpBB does not preserve tabs; maybe the 'patch' utility will complain if you just copy this into a file and attept to patch the Wings 3D source with that. In any case, please feel free to request the real patch file by email: I'm 'dsolaz' at domain 'sistelcom' dot com (note that I'll be offline from Nov 9 to 12).

Better yet, read my forthcoming post regarding the creation of tardist files of Erlang, ESDL and Wings 3D. With them, getting a (hopefully) working Wings 3D should be much easier for everyone.

I'd like to hear from people who try this. Specially those working on machines other than what I have: an O2 and an Octane/SSE running 6.5.26 with GCC 3.3. Thanks in advance.
-Daniel
Wings is a wonderfully efficient standalone solution for 3D content creation, with great potential on less powerful hardware, such as the O2. I would suggest speed optimizations being a first priority with Wings on Irix - as Blender is a larger, more complete non-commercial solution. As SGIs do OpenGL in hardware, I would imagine the Wings version could evolve to be uniquely efficient, especially with respect to RAM. Presently, Wings can only really support 100,000 triangle scenes before instability ensues. Maya 3.0, by contrast, remains stable even with scenes loaded that total 10,000,000 triangles, RAM permitting. Not sure what the limit in Blender is, as I don't use it.
I confirm functional Wings3D on IRIX!
I followed the guide provided by dsolaz with version 0.98.36 and it works.
More: I prepared a self-contained package (no deps, 8MB tgz) and tested it on Tezro/dualR16k800/V12/6.5.29m, Fuel/R16k700/V10/6.5.29m and Octane/R12k300/ESI/6.5.26m
I've tested one more configuration (Octane/R12k/300/V6) and found one bug: It works only for the user root. I'm not sure why.
If you want and can test it yourself, download it from here:

http://eugen.cz/vtech/

(If you guess, that I created that webpage in 2 minutes, you're right :-) )
vtech wrote: I've tested one more configuration (Octane/R12k/300/V6) and found one bug: It works only for the user root. I'm not sure why.


Is there some error message or something? Maybe "failed to create thread: operation not permitted"?
The system-scope POSIX thread issue is a problem only if you are not root.
-Daniel
dsolaz wrote:
vtech wrote: I've tested one more configuration (Octane/R12k/300/V6) and found one bug: It works only for the user root. I'm not sure why.


Is there some error message or something? Maybe "failed to create thread: operation not permitted"?
The system-scope POSIX thread issue is a problem only if you are not root.
-Daniel


It's some other problem, it looks like LD_LIBRARY_PATH is ignored for non-root, or more probably changed by erlang on startup.
See yourself, if you can.
This is the error message:
Driver Failed {error,{open_error,"93719:/home/tekavi/wings3d-0.98.36/bin/beam: rld: Fatal Error: Cannot Successfully map soname 'libgcc_s.so.1' under any of the filenames /usr/vtech/sdl/lib/libgcc_s.so.1:/usr/lib32/libgcc_s.so.1:/usr/lib32/internal/libgcc_s.so.1:/lib32/libgcc_s.so.1:/opt/lib32/libgcc_s.so.1: "}}

libgcc_s.so.1 is in lib/esdl-0.96.0626/priv together with SDL and sdl_driver and LD_LIBRARY_PATH is set accordingly
vtech wrote: libgcc_s.so.1 is in lib/esdl-0.96.0626/priv together with SDL and sdl_driver and LD_LIBRARY_PATH is set accordingly


IIRC, LD_LIBRARY_PATH is for o32 binaries. Try LD_LIBRARYN32_PATH, that might be it.
-Daniel
dsolaz wrote: IIRC, LD_LIBRARY_PATH is for o32 binaries. Try LD_LIBRARYN32_PATH, that might be it.
-Daniel


It didn't help. LD_LIBRARYN32_PATH is used before LD_LIBRARY_PATH, but none should be ignored.
If I test it using ldd, LD_LIBRARY_PATH works, but then it's silently ignored by erl
It would be cool if people would test it on older machines, like R4.4k Solid Impacts and lower.

Wings runs acceptably on a P166 with 3D accelerator (I know I tried a Voodoo3, and a Riva TNT), so it would be really cool if it could also perform on older SGIs like Indys and/or Crimsons.
tested it briefly on my octane2 D600V12 - only problems i encountered during that session were that you could close it instantly by hitting the window border's close button once. no "want to save question", nada.
also when i maximized the window, it became huuuuge, several times screen size (mine's 1600x1200) and windows opened up outside the visible screen area and were not resizeable any more. had to hand edit the prefs to get it to look how i wanted it.

but now after a system restart it refuses to run anymore, what gives? user root, 6.5.27, chcap set and all and suddenly it cannot find libgcc_s.so.1 anymore.
just wanted to bump this. ;) anyone still working on it? for me, it sometimes works, sometimes it simply refuses to start.
Any progress reports??

<Anxiously waits>
just checking in...
I take it there are still serious bugs trying to run on a octane2 6.5.30?
I'd love to use Wings on my SGI, it's a great program

Andre
I might look at this again soon. I just got a new machine and right now I'm patching the Erlang emulator so it correctly detects the number of available CPU's. I'm still using 6.5.26, however.
If I get this working again, this time I'd like to make tardists, but I will need assistance from someone who is familiar with that package builder thing.
-Daniel
dsolaz wrote: I might look at this again soon. I just got a new machine and right now I'm patching the Erlang emulator so it correctly detects the number of available CPU's. I'm still using 6.5.26, however.
If I get this working again, this time I'd like to make tardists, but I will need assistance from someone who is familiar with that package builder thing.
-Daniel


Just drop a note... or visit the IRC channel #nekochan.

regards
Joerg
It downloaded and installed without a hitch, I am using a octane 2 single processor 400 Mhz V10, 2 Gigs, works great! no crashes yet. Only problem is the wavefront .obj files don't convert into .IV files. VRML file worked great! cool features , neat autorotation. User interface seems easy to use. I also confirm that it opens in a window area larger than the monitor screen. Resized to the monitor size and saved. when reopened it remembered the correct screen size. Cool! Need a program like this for animation = easy to use.

sgiSteve
When in doubt, go higher. Real time realistic interactive graphics.

WANTED Cray CX-1 cheap