Denormgen running on OSX?

Informations, Help and general talk around the Normal and Displacement Map Generator Tool.
User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Tue Apr 03, 2007 6:21 am

Hi,

Ok, turns out the OpenGL libraries included with Apple X11 were outdated, no vertex or fragment programs. I found references to pre ARB functions, some are labled as NV extensions, not sure the OpenGL version this changed. So this is the reason those functions were bombing.

I am now using the Apple System version of OpenGL instead of the X11 version, if that creates more problems working with X11 down the line... I dunno.

On compiling I get these errors which might have to do with your prevoius post about some of these functions being core and not extensions.

Code: Select all

fi
./gui/ngOpenGlSystem.h:34: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:35: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:36: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:37: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:38: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:39: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:40: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:41: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:106: error: 'GLGENPROGRAMSARB' does not name a type
./gui/ngOpenGlSystem.h:107: error: 'GLDELETEPROGRAMSARB' does not name a type
./gui/ngOpenGlSystem.h:108: error: 'GLBINDPROGRAMARB' does not name a type
./gui/ngOpenGlSystem.h:109: error: 'GLPROGRAMSTRINGARB' does not name a type
./gui/ngOpenGlSystem.h:110: error: 'GLPROGRAMLOCALPARAMETER4FARB' does not name a type
./gui/ngOpenGlSystem.h:111: error: 'GLMULTITEXCOORD2FARB' does not name a type
./gui/ngOpenGlSystem.h:112: error: 'GLMULTITEXCOORD3FARB' does not name a type
./gui/ngOpenGlSystem.h:113: error: 'GLACTIVETEXTUREARB' does not name a type
make[2]: *** [ngWindowMain.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
I am now going to do some of the above mentioned alterations :)

jsplifer

User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Tue Apr 03, 2007 8:32 am

Hello

Stopping for the night:

Code: Select all

if g++ -DHAVE_CONFIG_H -I. -I. -I.    -D_OS_UNIX_   -g -O2 -MT ngWindowMain.o -MD -MP -MF ".deps/ngWindowMain.Tpo" \
  -c -o ngWindowMain.o `test -f './gui/ngWindowMain.cpp' || echo './'`./gui/ngWindowMain.cpp; \
then mv -f ".deps/ngWindowMain.Tpo" ".deps/ngWindowMain.Po"; \
else rm -f ".deps/ngWindowMain.Tpo"; exit 1; \
fi
./gui/ngOpenGlSystem.h:34: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:35: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:36: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:37: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:38: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:39: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:40: error: expected `)' before '*' token
./gui/ngOpenGlSystem.h:41: error: expected `)' before '*' token
make[2]: *** [ngWindowMain.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
Hope to hear from you.

jsplifer

User avatar
Dragonlord
Forum Administrator
Posts: 609
Joined: Fri Jul 30, 2004 4:30 pm
Location: Switzerland
Contact:

Post by Dragonlord » Tue Apr 03, 2007 4:23 pm

Dragonlord wrote:So far I could not test compiling it on OSX as I do not have access to such a machine. I poked at the error to see what is wrong. What I get is that "APIENTRY" is not defined on OSX in this case but is on linux and windows. On those systems the definition is:

Code: Select all

#define APIENTRY __stdcall
Now what goes for OSX I don't know what definition they use. Do once a search inside "gl.h" ( somewhere in your include path ) for a definition like this:

Code: Select all

#define GLAPIENTRY ***
with *** being something I don't know yet. If such a line exists we can hack it into the source like this:

Code: Select all

// ./gui/ngOpenGlSystem.h line 33 insert
// make sure APIENTRY is defined
#ifndef APIENTRY
#define APIENTRY ***
#endif
With *** the stuff you found in your gl.h file. If there is no such line then there is no such value required ( and I guess this is the case ). If so simply end the #define APIENTRY line without a value ( so it is defined to be empty ).

Now try compiling again with these changes and let me know if it works. If you don't know what I just talked about assume the later case without the value.
We are now back to this problem then. Have a look at this post. Most probably you simple have to declare it as an empty.
Image
Oh to be a dragon, of silkworm size or immense...

User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Tue Apr 03, 2007 4:53 pm


User avatar
Dragonlord
Forum Administrator
Posts: 609
Joined: Fri Jul 30, 2004 4:30 pm
Location: Switzerland
Contact:

Post by Dragonlord » Wed Apr 04, 2007 12:45 am

Okay, things go a bit hay wire right now. What goes for the first batch of errors this is my bug: the ngOpenGlSystem.cpp should not contain the typedefs again. So this is fixed by simply deleting lines 86 up to 90 ( hence those ):

Code: Select all

typedef void APIENTRY (*GLGENPROGRAMSARB)(GLsizei, GLuint*);
typedef void APIENTRY (*GLDELETEPROGRAMSARB)(GLsizei, const GLuint *);
typedef void APIENTRY (*GLBINDPROGRAMARB)(GLenum, GLuint);
typedef void APIENTRY (*GLPROGRAMSTRINGARB)(GLenum, GLenum, GLsizei, const GLvoid *);
typedef void APIENTRY (*GLPROGRAMLOCALPARAMETER4FARB)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
Now the second batch of errors looks weird. Looks like the definition in the .cpp file is the correct one and the definition in the .h file is not. So we need to rectify them to. So replace lines 34 up to 41 in ngOpenGlSystem.h with the following lines:

Code: Select all

typedef void APIENTRY (*GLGENPROGRAMSARB)(GLsizei, GLuint*);
typedef void APIENTRY (*GLDELETEPROGRAMSARB)(GLsizei, const GLuint *);
typedef void APIENTRY (*GLBINDPROGRAMARB)(GLenum, GLuint);
typedef void APIENTRY (*GLPROGRAMSTRINGARB)(GLenum, GLenum, GLsizei, const GLvoid *);
typedef void APIENTRY (*GLPROGRAMLOCALPARAMETER4FARB)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
typedef void APIENTRY (*GLMULTITEXCOORD2FARB)(GLenum, GLfloat, GLfloat);
typedef void APIENTRY (*GLMULTITEXCOORD3FARB)(GLenum, GLfloat, GLfloat, GLfloat);
typedef void APIENTRY (*GLACTIVETEXTUREARB)(GLenum);
Hopefully things work out correctly now.
Image
Oh to be a dragon, of silkworm size or immense...

User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Wed Apr 04, 2007 3:38 am

Hi,

This thread is getting long. Please don't give up on me Dragonlord.

This is error after the changes:

http://home.earthlink.net/~jaspermine/stuff/Err04.txt

jsplifer

User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Wed Apr 04, 2007 6:09 am

Dragonlord,

It is working!!! :shock:

I will post the edited files in a moment after I play a bit.

I received help in IRC from f00f of #blenderchat. And of course your awesome help. I really really am thankful of your assistance in getting this to work, and for providing this application.

Rendering,
jsplifer

User avatar
jsplifer
Apprentice
Posts: 16
Joined: Wed Mar 21, 2007 8:27 am
Location: Pennsylvania

Post by jsplifer » Wed Apr 04, 2007 3:59 pm

Hello,

To get DeNormGen working on mac osx I needed to install Fox GUI Toolkit 1.6, this required several dependancies: OpenGL and PNG.

OpenGL was a bit of a hack, I took the X11 OpenGL headers and symlinked to them from the /usr/local/include directory. I then took the the system OpenGL framework headers and symlinked to them from the /usr/local/include directory overwriting duplicate headers where necessary. Symlinks from /usr/local/lib were made to the system OpenGL framework pointing to the various libraries included in the framework.

PNG was installed through macports. Macports is a program that can install a wide range of tools for unix. Again symlinks were used to make the headers and libraries show up in /usr/local like above.

This allowed FOX Toolkit to configure, compile and run properly. After compilation make install was run to install this library. I remember there being a little bit more than this, but can't put my finger on it.

Next you will need to edit a few things in DeNormGen 1.5, or perhaps by the time you read this the changes will be updated in the sources. Here are the two pages that need to be altered:

http://home.earthlink.net/~kslifer/ngOpenGlSystem.cpp
http://home.earthlink.net/~kslifer/ngOpenGlSystem.h

DeNormGen 1.5 should then be configured, compiled, installed and run from X11.

I should probably have edited configure in these examples, or the make files, or to even set up proper search paths. But I didn't and it works. I hope it works for you too. Cheers and many thanks go to Dragonlord and f00f for the great tool, and the generous help.

jsplifer

User avatar
Dragonlord
Forum Administrator
Posts: 609
Joined: Fri Jul 30, 2004 4:30 pm
Location: Switzerland
Contact:

Post by Dragonlord » Wed Apr 04, 2007 7:14 pm

Turned this into a proper patch file for the time being. So for those with OSX first download the denormgen-1.5-osx_compatible.patch file and copy it to your denormgen-1.5 directory ( there where configure.ac is ). Then fire up a console in the same directory and whack in this:

Code: Select all

patch -p1 < denormgen-1.5-osx_compatible.patch
You are then ready to compile the sources. A proper fix will be included in the next version.
Image
Oh to be a dragon, of silkworm size or immense...

Post Reply