No display, Ubuntu 14.04

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

No display, Ubuntu 14.04

Post by emjac » Fri Nov 28, 2014 3:20 pm

Hi,

I compiled OpenSees (rev. 5844). It runs, I get text results from the recorders, but when I use the display recorder I get no window showing the model.

I am using the model here http://opensees.berkeley.edu/wiki/index ... ment_Frame

So I don't think it is a model problem, but rather a compilation problem. Maybe a problem with Tcl? Could it not be finding TclFeViewer?

Any ideas would be greatly appreciated.

E

emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

Re: No display, Ubuntu 14.04

Post by emjac » Mon Dec 01, 2014 7:59 pm

So now I am closer. I realised there were no graphics libraries specified. :p So I modified them with inspiration from an example here :
http://opensees.berkeley.edu/WebSVN/fil ... .def.LINUX

Now I am getting the window which should pop up and give me the display, but get this error :
X11Renderer::setPlaneDist() - invalid planes10562.1 -10562.1
View::update() - VPN cannot have zero length

So I don't know, maybe I have the wrong version of the X11 library? I will have to open up this X11Renderer and see what is happening... in the mean time, any suggestion is welcome!

This is my Makefile.def:

############################################################################
#
# Program: OpenSees
#
# Purpose: A Top-level Makefile to create the libraries needed
# to use the OpenSees framework. Works on Linux version 6.1
# and below.
#
# Written: fmk
# Created: 10/99
#
# Send bug reports, comments or suggestions to fmckenna@ce.berkeley.edu
#
############################################################################

#
# https://help.ubuntu.com/community/EC2StartersGuide

## ssh to machine from your own:
#
# chmod 'go+rwx' XXX.pem
# ssh -i XXX.pem ubuntu@YYY.amazonaws.com
#

# Instructuction for building OpenSees on Ubuntu
# using amazon EC-2 instance ami-d0f89fb9 (running Ubunto 12.04) once logged in

# sudo in and type the following:
# sudo apt-get update
# sudo apt-get install subversion
# svn co svn://opensees.berkeley.edu/usr/local/svn/OpenSees/trunk OpenSees
# sudo apt-get install emacs
# sudo apt-get install make
# sudo apt-get install tcl8.5
# sudo apt-get install tcl8.5-dev
# sudo apt-get install gcc
# sudo apt-get install g++
# sudo apt-get install gfortran
# mkdir lib
# mkdir bin
# cd OpenSees
# cp ./MAKES/Makefile.def.EC2-UBUNTU ./Makefile.def
# make


# NOTE: if 64 bit the TCL dir is placed elsewhere; make will fail
# you need to uncomment out the correct line below TL_LIBS =
# TCL_LIBS should point to the following: /usr/lib/x86_64-linux/gnu/libtcl8.5.so

# you can always find it using the find command:
# find / -name libtcl8.5.so 2>/dev/null

# %---------------------------------%
# | SECTION 1: PROGRAM |
# %---------------------------------%
#
# Specify the location and name of the OpenSees interpreter program
# that will be created (if this all works!)

OpenSees_PROGRAM = $(HOME)/bin/OpenSees

OPERATING_SYSTEM = LINUX
GRAPHICS = GRAPHICS = UsingOpenGL
PROGRAMMING_MODE = SEQUENTIAL
DEBUG_MODE = NO_DEBUG
RELIABILITY = NO_RELIABILITY


# %---------------------------------%
# | SECTION 2: PATHS |
# %---------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries or if you have
# any of the libraries already leave the directory location blank AND
# remove the directory from DIRS.

BASE = /usr/local
HOME = /home/my_user_name
FE = $(HOME)/OpenSees/SRC

AMDdir = $(HOME)/OpenSees/OTHER/AMD
BLASdir = $(HOME)/OpenSees/OTHER/BLAS
CBLASdir = $(HOME)/OpenSees/OTHER/CBLAS
LAPACKdir = $(HOME)/OpenSees/OTHER/LAPACK
SUPERLUdir = $(HOME)/OpenSees/OTHER/SuperLU_4.1/SRC
ARPACKdir = $(HOME)/OpenSees/OTHER/ARPACK
UMFPACKdir = $(HOME)/OpenSees/OTHER/UMFPACK
METISdir = $(HOME)/OpenSees/OTHER/METIS
CSPARSEdir = $(HOME)/OpenSees/OTHER/CSPARSE
SRCdir = $(HOME)/OpenSees/SRC


DIRS = $(BLASdir) $(CBLASdir) $(LAPACKdir) $(AMDdir) $(CSPARSEdir) \
$(SUPERLUdir) $(ARPACKdir) $(UMFPACKdir) $(SRCdir) $(METISdir)

# %-------------------------------------------------------%
# | SECTION 3: LIBRARIES |
# | |
# | The following section defines the libraries that will |
# | be created and/or linked with when the libraries are |
# | being created or linked with. |
# %-------------------------------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries leave the
# libraries blank. You have to get your own copy of the tcl/tk
# library!!
#
# Note: For libraries that will be created (any in DIRS above)
# make sure the directory exsists where you want the library to go!

FE_LIBRARY = $(HOME)/lib/libOpenSees.a
NDARRAY_LIBRARY = $(HOME)/lib/libndarray.a # BJ_UCD jeremic@ucdavis.edu
MATMOD_LIBRARY = $(HOME)/lib/libmatmod.a # BJ_UCD jeremic@ucdavis.edu
BJMISC_LIBRARY = $(HOME)/lib/libBJmisc.a # BJ_UCD jeremic@ucdavis.edu
LAPACK_LIBRARY = $(HOME)/lib/libLapack.a
BLAS_LIBRARY = $(HOME)/lib/libBlas.a
SUPERLU_LIBRARY = $(HOME)/lib/libSuperLU.a
CBLAS_LIBRARY = $(HOME)/lib/libCBlas.a
ARPACK_LIBRARY = $(HOME)/lib/libArpack.a
AMD_LIBRARY = $(HOME)/lib/libAMD.a
UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY = $(HOME)/lib/libMetis.a
CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a

TCL_LIBRARY = /usr/lib/x86_64-linux-gnu/libtcl8.5.so

BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
GRAPHIC_LIBRARY = /usr/lib/x86_64-linux-gnu/mesa/libGL.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so \
/usr/lib/x86_64-linux-gnu/libGLU.so

# WATCH OUT .. These libraries are removed when 'make wipe' is invoked.
WIPE_LIBS = $(FE_LIBRARY) \
$(LAPACK_LIBRARY) \
$(BLAS_LIBRARY) \
$(CBLAS_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(ARPACK_LIBRARY) \
$(UMFPACK_LIBRARY) \
$(CSPARSE_LIBRARY) \
$(METIS_LIBRARY)

# %---------------------------------------------------------%
# | SECTION 4: COMPILERS |
# | |
# | The following macros specify compilers, linker/loaders, |
# | the archiver, and their options. You need to make sure |
# | these are correct for your system. |
# %---------------------------------------------------------%

# Compilers
CC++ = /usr/bin/g++
CC = /usr/bin/gcc
FC = /usr/bin/gfortran

AR = ar
ARFLAGS = cqls
RANLIB = ranlib
RANLIBFLAGS =

# Compiler Flags
#
# NOTES:
# C++ FLAGS TAKE need _UNIX or _WIN32 for preprocessor dircetives
# - the _WIN32 for the Windows95/98 or NT operating system.
# C FLAGS used -DUSE_VENDOR_BLAS (needed in SuperLU) if UNIX in C++ FLAGS
#

# modified as optimizaton currently causing problems with Steeln01 code
ifeq ($(DEBUG_MODE), DEBUG)

C++FLAGS = -Wall -D_LINUX -D_UNIX -D_TCL85 \
$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG) \
-g -pg


CFLAGS = -Wall -pg $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG)
FFLAGS = -Wall

# Linker
LINKER = $(CC++)
LINKFLAGS = -g -pg

else

C++FLAGS = -Wall -D_LINUX -D_UNIX -D_TCL85 \
$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) \
$(PROGRAMMING_FLAG) -O3 -ffloat-store
CFLAGS = -Wall -O2
FFLAGS = -Wall -O

# Linker
LINKER = $(CC++)
LINKFLAGS = -rdynamic

endif


# Misc
MAKE = make
CD = cd
ECHO = echo
RM = rm
RMFLAGS = -f
SHELL = /bin/sh

# %---------------------------------------------------------%
# | SECTION 5: COMPILATION |
# | |
# | The following macros specify the macros used in |
# | to compile the source code into object code. |
# %---------------------------------------------------------%

.SUFFIXES:
.SUFFIXES: .C .c .f .f90 .cpp .o .cpp

#
# %------------------%
# | Default command. |
# %------------------%
#
.DEFAULT:
@$(ECHO) "Unknown target $@, try: make help"
#
# %-------------------------------------------%
# | Command to build .o files from .f files. |
# %-------------------------------------------%
#

.cpp.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@

.C.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@
.c.o:
@$(ECHO) Making $@ from $<
$(CC) $(CFLAGS) -c $< -o $@
.f.o:
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

# %---------------------------------------------------------%
# | SECTION 6: OTHER LIBRARIES |
# | |
# | The following macros specify other libraries that must |
# | be linked with when creating executables. These are |
# | platform specific and typically order does matter!! |
# %---------------------------------------------------------%
MACHINE_LINKLIBS = -L$(BASE)/lib \
-L$(HOME)/lib

MACHINE_NUMERICAL_LIBS = -lm \
$(ARPACK_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(UMFPACK_LIBRARY) $(CSPARSE_LIBRARY) \
$(LAPACK_LIBRARY) $(BLAS_LIBRARY) $(CBLAS_LIBRARY) \
$(AMD_LIBRARY) $(GRAPHIC_LIBRARY)\
-ldl -lgfortran

MACHINE_SPECIFIC_LIBS =



# %---------------------------------------------------------%
# | SECTION 7: INCLUDE FILES |
# | |
# | The following macros specify include files needed for |
# | compilation. |
# %---------------------------------------------------------%
MACHINE_INCLUDES = -I/usr/include \
-I$(BASE)/include \
-I/usr/include/cxx \
-I$(HOME)/include -I$(HOME)/blitz

# this file contains all the OpenSees/SRC includes
include $(FE)/Makefile.incl

#TCL_INCLUDES = -I/usr/includes/tcl-private/generic
TCL_INCLUDES = -I/usr/include/tcl8.5

INCLUDES = $(TCL_INCLUDES) $(FE_INCLUDES) $(MACHINE_INCLUDES)

emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

Re: No display, Ubuntu 14.04

Post by emjac » Mon Dec 01, 2014 8:20 pm

Actually there is a little more to the error message. Here is the complete error :

WindowDevice::initWindow() - could not add any colors to the
existing colormap - will try to create our own colormap
WindowDevice::initX11() - could not get a visual for PseudoColor
Colors diplayed will be all over the place
X11Renderer::setPlaneDist() - invalid planes3339.46 -3339.46
View::update() - VPN cannot have zero length

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: No display, Ubuntu 14.04

Post by fmk » Mon Jan 12, 2015 3:35 pm

you need to try and build using OpenGL and not X11 .. GRAPHICS = UsingOpenGL .. is this is the case X11Renderer will not be built.

emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

Re: No display, Ubuntu 14.04

Post by emjac » Sat Mar 21, 2015 12:18 pm

So I have tried GRAPHICS = UsingOpenGL

New error :

make[2]: Leaving directory `/home/emjac/OpenSees/SRC/tcl'
/home/emjac/lib/libOpenSees.a(OpenGlDevice.o): In function `OpenGlDevice::saveImageAsPNG(char const*)':
OpenGlDevice.cpp:(.text+0x92f): undefined reference to `png_create_write_struct'
OpenGlDevice.cpp:(.text+0x945): undefined reference to `png_create_info_struct'
OpenGlDevice.cpp:(.text+0x977): undefined reference to `png_destroy_write_struct'
OpenGlDevice.cpp:(.text+0x9ba): undefined reference to `png_init_io'
OpenGlDevice.cpp:(.text+0x9c9): undefined reference to `png_set_compression_level'
OpenGlDevice.cpp:(.text+0xa0e): undefined reference to `png_set_IHDR'
OpenGlDevice.cpp:(.text+0xa1d): undefined reference to `png_write_info'
OpenGlDevice.cpp:(.text+0xaa1): undefined reference to `png_write_image'
OpenGlDevice.cpp:(.text+0xab0): undefined reference to `png_write_end'
OpenGlDevice.cpp:(.text+0xabf): undefined reference to `png_destroy_write_struct'
OpenGlDevice.cpp:(.text+0xbd3): undefined reference to `png_destroy_write_struct'
OpenGlDevice.cpp:(.text+0xc12): undefined reference to `png_destroy_write_struct'
collect2: error: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/emjac/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: No display, Ubuntu 14.04

Post by fmk » Tue Mar 24, 2015 8:14 am

well to get to compile you can either find some library that does this on unix or comment out the method (you will only loose the functionality of saving an image which you can do with some screen capturing software anyway)

ceferino
Posts: 3
Joined: Wed Apr 30, 2014 11:01 pm
Location: StanfordUniversity

Re: No display, Ubuntu 14.04

Post by ceferino » Tue May 05, 2015 6:19 pm

I was wondering if this issue was solved without compromising UNIX functionality.
Luis

emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

Re: No display, Ubuntu 14.04

Post by emjac » Tue Jun 02, 2015 11:23 am

No. I can compile OpenSees without graphics, but whenever I try with graphics something fails. :(

emjac
Posts: 41
Joined: Sun Oct 05, 2014 2:23 pm
Location: École polytechnique de Montréal

Re: No display, Ubuntu 14.04

Post by emjac » Thu Mar 03, 2016 3:47 pm

For a long time, whenever I have wanted to have a display of my model I get the following error from OpenSees:

View::update() - VPN cannot have zero length
View::update() - VPN cannot have zero length
View::update() - VPN cannot have zero length
View::update() - VPN cannot have zero length
View::update() - VPN cannot have zero length
View::update() - VPN cannot have zero length

This is a little annoying because the vpn I always specify shouldn't be zero length; the same models and display work fine on Windows, but slower... anyhow. I have found a work around for this that works for 2D viewing of my models. At least I can now check visually that I haven't mis-applied gravity or anything stupid like that!

Before compiling, you can modify View.cpp such that it doesn't try to normalise the vectors vpn vuv. Find the View::update function and modify it as follows :

int
View::update(void)
{
// first determine coords for Viewing system
VECTOR u, v, n;
// float scalar;
int i;


for (i=0; i<3; i++) {
n[i] = vpn[i];
v[i] = vuv[i];
}

//~ if (n.Normalize() != 0) {
//~ opserr << "View::update() - VPN cannot have zero length\n";
//~ return -1;
//~ }

u = v % n;
//~ if (u.Normalize() != 0) {
//~ opserr << "View::update() - VUV X VPN cannot have zero length\n";
//~ return -1;
//~ }

v = n % u;
//v.Normalize();

TMat.Set( u[0], v[0], n[0], 0,
u[1], v[1], n[1], 0,
u[2], v[2], n[2], 0,
-vrp.Dot(u), -vrp.Dot(v), -vrp.Dot(n), 1.0);

return 0;
}

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: No display, Ubuntu 14.04

Post by fmk » Wed Mar 09, 2016 10:03 am

i would not bother with the graphics .. i will have something for you shortly, if you want to build it yourselves you will need to install Qt.

Post Reply