#

OpenGL & libGD on Odyssey

In order to compile OpenGL code on Odyssey, use the following:

[hptc@iliadaccess03 opengl]$ cat Makefile
CC=gcc
CCC=g++
CFLAGS=-O
LIB=-lglut -lGL -lGLU -ltiff -lm
RM=/bin/rm -f

EXE = drawpoints
OBJ = drawpoints.o readdata.o glutworks.o trackball.o listfiles.o
writeimg.o datapoints.o commands.o getcolor.o

$(EXE): $(OBJ) Makefile
$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIB)

.c.o: Makefile
$(CC) $(CFLAGS) -o $*.o -c $*.c

.cpp.o: Makefile
$(CCC) $(CFLAGS) -o $*.o -c $*.cpp

clean:
$(RM) $(EXE) $(OBJ) *~

To compile code that uses libGD use:

[hptc@iliadaccess03 gridimages]$ cat Makefile
CC = gcc
CFLAGS = -I/usr/include/libpng12 -DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -O2 -Wall
LIBS = -lgd -L/usr/X11R6/lib64 -lXpm -lX11 -L/usr/lib64 -ljpeg -lfontconfig -lfreetype -L/usr/lib64 -Wl,-rpath,/usr/lib64 -lpng12 -lz -lm

OBJS = gridimages.o getcolor.o processcommands.o
EXE = gridimages

$(EXE): $(OBJS)
$(CC) $(OBJS) -o $(EXE) $(CFLAGS) $(LIBS)

.c.o:
$(CC) $(CFLAGS) -o $*.o -c $*.c

clean:
rm -f core $(EXE) $(OBJS) *~

CC BY-NC 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Permissions beyond the scope of this license may be available at Attribution.