OpenGL libraries

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenGL libraries

Mark Brethen-2
Per the attached Calculix-cgx Makefile, I needed to modify it to indicate the OpenGL framework. I tried this:

CFLAGS = -O2 -Wall -Wno-narrowing \
  -I./ \
  -I/usr/include \
  -I../../libSNL/src \
  -I../../glut-3.5/src \
  -I/usr/X11/include

LFLAGS = \
  -framework OpenGL -lGL -lGLU \
  -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
  -lm -lpthread

.
.
.

cgx: $(OLIB) $(OUTIL) $(OULIB)
        g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@

This didn’t work. Is LDFlags appropriate here? There isn’t a config file so in the portfile I pass the following @ pre-build:

    pre-build {
        build.args          CC=${configure.cc} \
                            CXX=${configure.cxx}
    }



Mark Brethen
[hidden email]




Makefile (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: OpenGL libraries

Ryan Schmidt-24


On Nov 12, 2018, at 13:17, Mark Brethen wrote:

> Per the attached Calculix-cgx Makefile, I needed to modify it to indicate the OpenGL framework. I tried this:
>
> CFLAGS = -O2 -Wall -Wno-narrowing \
>  -I./ \
>  -I/usr/include \
>  -I../../libSNL/src \
>  -I../../glut-3.5/src \
>  -I/usr/X11/include
>
> LFLAGS = \
>  -framework OpenGL -lGL -lGLU \
>  -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
>  -lm -lpthread
>
> .
> .
> .
>
> cgx: $(OLIB) $(OUTIL) $(OULIB)
> g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
>
> This didn’t work. Is LDFlags appropriate here? There isn’t a config file so in the portfile I pass the following @ pre-build:
>
>    pre-build {
>        build.args          CC=${configure.cc} \
>                            CXX=${configure.cxx}
>    }

In what way didn't it work? Did you get an error? What error?

Certainly "-I/usr/include" in the CFLAGS is unnecessary because the compiler will look there automatically, and "-I/usr/X11/include" is inappropriate because we don't want to find anything there (we want to find X11 stuff in the MacPorts prefix).

That hardcoded "g++" in the Makefile will need to be replaced with "$(CXX)" in order for your build.args to work for that.

Reply | Threaded
Open this post in threaded view
|

Re: OpenGL libraries

Mark Brethen-2
The calculix source builds it’s own glut-3.5. Glut wants to link to GL3, but the calculix source links to GL.

So I patched the Makefile to link to /opt/local/include, /opt/local/include/GL and /opt/local/lib and installed libGLU. I was able to build and install the program but it doesn’t render any OpenGL graphics in XQuartz. Not sure what’s broke but there were some "function is deprecated …” statements in the build log.

Mark Brethen
[hidden email]



> On Nov 14, 2018, at 8:08 PM, Ryan Schmidt <[hidden email]> wrote:
>
>
>
> On Nov 12, 2018, at 13:17, Mark Brethen wrote:
>
>> Per the attached Calculix-cgx Makefile, I needed to modify it to indicate the OpenGL framework. I tried this:
>>
>> CFLAGS = -O2 -Wall -Wno-narrowing \
>> -I./ \
>> -I/usr/include \
>> -I../../libSNL/src \
>> -I../../glut-3.5/src \
>> -I/usr/X11/include
>>
>> LFLAGS = \
>> -framework OpenGL -lGL -lGLU \
>> -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
>> -lm -lpthread
>>
>> .
>> .
>> .
>>
>> cgx: $(OLIB) $(OUTIL) $(OULIB)
>> g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
>>
>> This didn’t work. Is LDFlags appropriate here? There isn’t a config file so in the portfile I pass the following @ pre-build:
>>
>>   pre-build {
>>       build.args          CC=${configure.cc} \
>>                           CXX=${configure.cxx}
>>   }
>
> In what way didn't it work? Did you get an error? What error?
>
> Certainly "-I/usr/include" in the CFLAGS is unnecessary because the compiler will look there automatically, and "-I/usr/X11/include" is inappropriate because we don't want to find anything there (we want to find X11 stuff in the MacPorts prefix).
>
> That hardcoded "g++" in the Makefile will need to be replaced with "$(CXX)" in order for your build.args to work for that.
>

Reply | Threaded
Open this post in threaded view
|

Re: OpenGL libraries

mf2k


On Nov 14, 2018, at 8:33 PM, Mark Brethen <[hidden email]> wrote:

I was able to build and install the program but it doesn’t render any OpenGL graphics in XQuartz. Not sure what’s broke but there were some "function is deprecated …” statements in the build log.

Were there any runtime errors on the command line in the Terminal window used to start the application?


Cheers!
Frank

Reply | Threaded
Open this post in threaded view
|

Re: OpenGL libraries

Mark Brethen-2
No runtime errors.

Sent from my iPhone

On Nov 15, 2018, at 10:32 AM, <[hidden email]> <[hidden email]> wrote:



On Nov 14, 2018, at 8:33 PM, Mark Brethen <[hidden email]> wrote:

I was able to build and install the program but it doesn’t render any OpenGL graphics in XQuartz. Not sure what’s broke but there were some "function is deprecated …” statements in the build log.

Were there any runtime errors on the command line in the Terminal window used to start the application?


Cheers!
Frank