Skip to content

Issues solved when compiling on Linux Ubuntu 12.04 LTS 64-bit #1

@nicgallego

Description

@nicgallego

Hi everyone,
I hope it helps.
Linux Ubuntu 12.04 LTS 64-bit, gcc / g++ version 4.6.3

Q: After installing opengl (hardware drivers if needed and glut library) <GLUT/glut.h> does not exist

A: freeglut3 package headers are installed in /usr/include/GL rather than /usr/include/GLUT. To correct this create a symbolic link GLUT pointing to GL with the command on the terminal
$ sudo ln -s /usr/include/GL /usr/include/GLUT

Q: Compilation error 'glDeleteProgram' was not declared in this scope

A: This is because gl extensions are wrapped by a flag called GL_GLEXT_PROTOTYPES on opengl headers, so to compile with extensions, add to your compilation flags on the project Makefile -DGL_GLEXT_PROTOTYPES (see Makefile example below)

Q: Linking error libgspr.a undefined reference to 'SuiteSparse_time'
A: Add -lsuitesparseconfig to DDG_SUITESPARSE_LIBS (See Makefile example below)

Q: Linking error libsuitsparseconfig undefied reference to 'clock_gettime'
A: Add -lrt to DDG_SUITESPARSE_LIBS

Notes: If you are in an 64 bit system, remember to configure (uncommenting) the blas related line to 64 bits.
You may also need to add

include to modules Complex.cpp, DenseMatrix.cpp, since appearently it is missing. Probably a solution is possible with compiler flags without modifying the code also,

For further reference, here the lines modefied on the project makefile, ie. course/BaseCode/Makefile
...

# Linux

DDG_INCLUDE_PATH = -I/usr/include -I/usr/local/include
DDG_LIBRARY_PATH = -L/usr/lib -L/usr/local/lib
DDG_BLAS_LIBS = -llapack -lblas -lgfortran
DDG_SUITESPARSE_LIBS = -lspqr -lumfpack -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -lm -lsuitesparseconfig -lrt
DDG_OPENGL_LIBS = -lglut -lGL -lGLU -lX11
...
CFLAGS = -O3 -Wall -Werror -ansi -pedantic $(DDG_INCLUDE_PATH) -I./include -I./src -DGL_GLEXT_PROTOTYPES
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions