Fork of Ork library with SCons build support.
Following lines describes how to build Ork under Ubuntu 22.04 LTS.
tar -xaf glew-1.5.6.tgz
command.
- install glew dependencies with
sudo apt install libxmu-dev libglu1-mesa-dev libglut-dev
command
- build with
cd glew-1.5.6
make -j8
command
note: works only with tarball (not zip glew library file)
- install with to
/usr
directory with
sudo make install
command. Where glew library in installed to /usr
directory.
- create linker configuration for
/usr/lib64
where glew was installed. Go to configuration directory with
cd /etc/ld.so.conf.d
and create usr_lib64.conf
with following
$ cat usr_lib64.conf
# linker configuration for /usr/lib64
/usr/lib64
content
- update linker cache with
sudo ldconfig
Be aware that (/usr/lib64/pkgconfig
) pkg-config install directory is not searched by pkg-config
command and as a result pkg-config
is not aware of locally installed glew library e.g.
$ pkg-config --modversion glew
2.2.0
can return 2.2.0 (verson of glew library installed by package manager) instead of 1.5.6 version installed manually.
This can be solved by setting PKG_CONFIG_PATH
environment variable from build script with
env.AppendENVPath('PKG_CONFIG_PATH', '/usr/lib64/pkgconfig')
line (see SConstruct
file).
Now finally we can run
scons -j8
command to build Ork library.
- undefined reference to
glEnable
/bin/ld: libork.a(FrameBuffer.o): undefined reference to symbol 'glEnable'
/bin/ld: /lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
There are missing -lGL -lX11 -lGLU
dependencies for glew library in a pkg-config configuration.
After succesfull building examples can be found in examples
directory.
$ cd examples
$ ./examples minimal
other examples are render, resource, scenegraph, scenegraphresource and tessellation.
Run
./examples render .
commnad for render example or
./examples resource .
command for resource or
./examples scenegraph .
command for scenegraph or
./example scenegraphresource . cubesScene|exampleScene|postprocessScene|skyboxScene
command for scene graph from resource file sample or
./examples tessellation
command for a tessellation sample (GLSL 4.0).
TODO: how to run tests to find errors?
- Unable to loading shared library
libGLEW.so.1.5
$ ./examples
./examples: error while loading shared libraries: libGLEW.so.1.5: c/etc/ld.so.conf.dannot open shared object file: No such file or directory
The root cause is that the library in not in a linker cache.
$ ldconfig -p|grep -i glew
libGLEW.so.2.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLEW.so.2.2
libGLEW.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libGLEW.so
There is missig linker configuration for /usr/lib64
in /etc/ld.so.conf.d
directory.
- OpenGL error 1282 complain for exampes
$ ./examples minimal
ERROR [RENDER] OpenGL error 1282, returned string 'invalid operation'
invalid operation
examples: ork/render/Program.cpp:660: void ork::Program::initUniforms(): Assertion `FrameBuffer::getError() == 0' failed.
Aborted (core dumped)
- unknown sequence resource type for scenegraph example
$ ./examples scenegraph .
...
ERROR [RESOURCE] Unknown resource type 'sequence' at line 1 in sequence>
this is because implicit resource type registration mechanism is optimized out by linker in case sequence resource part of the code is not called by an application (which is the case or runtime configuration). No idea how to force linker to not optimized out local static variables so therefore we've introduced explicit initialization as ork::InitResourceTypes()
in resources/InitResources.h
header.
To install Ork library run
sudo scons install
command and to update linker database, run
sudo ldconfig
TODO: is linker searching in
/usr/local/lib
by default?
command.
The library is installed to /usr/local/lib
directory.