Commit 27ae3184 authored by whitlocb's avatar whitlocb

Changes for building on BG/Q with Mesa support.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@21116 18c085ea-50e0-402c-830e-de6fd14e8384
parent f089469f
......@@ -995,17 +995,32 @@ CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES (zlib.h HAVE_ZLIB_H)
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)
# Configure Mesa support.
IF(NOT WIN32 AND VISIT_MESA_DIR AND NOT VISIT_DBIO_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindVisItMesa.cmake)
IF(MESA_FOUND)
SET(HAVE_OSMESA 1)
ENDIF(MESA_FOUND)
ENDIF(NOT WIN32 AND VISIT_MESA_DIR AND NOT VISIT_DBIO_ONLY)
# Configure OpenGL support.
IF(NOT VISIT_DBIO_ONLY)
IF(VISIT_OPENGL_DIR)
SET(OPENGL_FOUND ON)
SET(OPENGL_GLU_FOUND ON)
SET(OPENGL_INCLUDE_DIR ${VISIT_OPENGL_DIR}/include)
# Hack for BG/Q. Assume if Mesa has been set and we're telling
# VisIt where to look for GL that we're using Mesa for GL.
IF(HAVE_OSMESA)
SET(LIBGL OSMesa)
ELSE(HAVE_OSMESA)
SET(LIBGL GL)
ENDIF(HAVE_OSMESA)
IF(VISIT_STATIC)
SET(OPENGL_gl_LIBRARY ${VISIT_OPENGL_DIR}/lib/libGL.a)
SET(OPENGL_gl_LIBRARY ${VISIT_OPENGL_DIR}/lib/lib${LIBGL}.a)
SET(OPENGL_glu_LIBRARY ${VISIT_OPENGL_DIR}/lib/libGLU.a)
ELSE(VISIT_STATIC)
SET(OPENGL_gl_LIBRARY ${VISIT_OPENGL_DIR}/lib/libGL.so)
SET(OPENGL_gl_LIBRARY ${VISIT_OPENGL_DIR}/lib/lib${LIBGL}.so)
SET(OPENGL_glu_LIBRARY ${VISIT_OPENGL_DIR}/lib/libGLU.so)
ENDIF(VISIT_STATIC)
SET(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
......@@ -1015,14 +1030,6 @@ IF(NOT VISIT_DBIO_ONLY)
ENDIF(VISIT_OPENGL_DIR)
ENDIF(NOT VISIT_DBIO_ONLY)
# Configure Mesa support.
IF(NOT WIN32 AND VISIT_MESA_DIR AND NOT VISIT_DBIO_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindVisItMesa.cmake)
IF(MESA_FOUND)
SET(HAVE_OSMESA 1)
ENDIF(MESA_FOUND)
ENDIF(NOT WIN32 AND VISIT_MESA_DIR AND NOT VISIT_DBIO_ONLY)
IF(VISIT_R_DIR)
# Configure R support.
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindR.cmake)
......
......@@ -62,11 +62,15 @@ VISIT_OPTION_DEFAULT(VISIT_STATIC ON TYPE BOOL)
##############################################################
##
##
## Mesa
##
VISIT_OPTION_DEFAULT(VISIT_MESA_DIR ${VISITHOME}/mesa/7.8.2/${VISITARCH})
##
## VTK
##
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR ${VISITHOME}/vtk/5e3c539/${VISITARCH})
##
##
## SZIP
......
......@@ -42,7 +42,7 @@ DO_SVN=""
DO_SVN_ANON=""
SVN=""
TAR=tar
THIRD_PARTY_PATH="thirdparty_static"
THIRD_PARTY_PATH="`pwd`/thirdparty_static"
export CMAKE_VERSION=2.8.10.2
export CMAKE_SHORT_VERSION=2.8
......@@ -206,12 +206,12 @@ APP_CXX = g++
CFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
GL_LIB_NAME = libGL.a
GL_LIB_NAME = libUsedToBeCalledGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB = GL
OSMESA_LIB_NAME = libGL.a
OSMESA_LIB = OSMesa
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = glsl mesa glu
DRIVER_DIRS = osmesa
......@@ -251,9 +251,6 @@ EOF
return 1
fi
# VTK will later want an OSMesa, which we've called GL. Make a copy.
cp $PF/lib/libGL.a $PF/lib/libOSMesa.a
# Some versions of Mesa erroneously install GLEW as well. We need to make
# sure we get VisIt's GLEW when we include it, so remove the ones Mesa
# installs.
......@@ -514,10 +511,10 @@ function build_vtk_BGQ
# Form extra arguments that we'll pass to cmake for VTK.
vopts="-DCMAKE_CROSSCOMPILING:BOOL=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=ON"
vopts="${vopts} -DOPENGL_INCLUDE_DIR:PATH=$MESADIR/include"
vopts="${vopts} -DOPENGL_gl_LIBRARY:PATH=$MESADIR/lib/libGL.a"
vopts="${vopts} -DOPENGL_gl_LIBRARY:PATH=$MESADIR/lib/libOSMesa.a"
vopts="${vopts} -DOPENGL_glu_LIBRARY:PATH=$MESADIR/lib/libGLU.a"
vopts="${vopts} -DVTK_USE_X:BOOL=OFF"
vopts="${vopts} -DOSMESA_LIBRARY:FILEPATH=$MESADIR/lib/libGL.a"
vopts="${vopts} -DOSMESA_LIBRARY:FILEPATH=$MESADIR/lib/libOSMesa.a"
vopts="${vopts} -DOSMESA_INCLUDE_DIR:FILEPATH=$MESADIR/include"
vopts="${vopts} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
......@@ -679,7 +676,7 @@ function build_for_compute_node
--cc $BG_CC $CFLAGSARGS \
--cxx $BG_CXX $CXXFLAGSARGS $MAKEARGS \
--no-thirdparty --zlib $IO_PACKAGES \
--parallel --icet \
--parallel --icet --mesa\
--group $GROUP
if [[ $? != 0 ]] ; then
warn "VisIt build failed. Giving up"
......@@ -960,10 +957,10 @@ function main
fi
# Make an installation directory.
if ! test -d $ARCH ; then
mkdir $ARCH
if ! test -d $THIRD_PARTY_PATH ; then
mkdir $THIRD_PARTY_PATH
else
echo "$ARCH already exists."
echo "$THIRD_PARTY_PATH already exists."
fi
# We build cmake specially so we can share the build between the login
......
......@@ -120,12 +120,12 @@ vtkStandardNewMacro(vtkOSMesaGLRenderWindow);
#define MAX_LIGHTS 8
// a couple of routines for offscreen rendering
void vtkOSMesaDestroyWindow(void *Window)
static void vtkOSMesaDestroyWindow(void *Window)
{
free(Window);
}
void *vtkOSMesaCreateWindow(int width, int height)
static void *vtkOSMesaCreateWindow(int width, int height)
{
return malloc(width*height*4);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment