Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running from an installed version (Fix #618, Fix BlueBrain/Livre#379) #619

Merged
merged 4 commits into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog {#Changelog}

# git master

* [619](https://github.com/Eyescale/Equalizer/pull/619)
Fix running from an installed version
* [611](https://github.com/Eyescale/Equalizer/pull/611)
Add eq::getHelp(), eq::Client::getHelp() and seq::Application::getHelp(),
improve help for all applications
Expand Down
14 changes: 3 additions & 11 deletions eq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_MX_INCLUDE_DIRS})

install(FILES DESTINATION include/eq COMPONENT dev)
list(APPEND CPPCHECK_EXTRA_ARGS -DEQ_API=)

list(APPEND CPPCHECK_EXTRA_ARGS -DEQUALIZER_DSO_NAME=foo -DEQ_API=)

add_definitions(-DEQ_PLUGIN_BUILD -DBOOST_PROGRAM_OPTIONS_DYN_LINK)
add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK)

set(EQUALIZER_PUBLIC_HEADERS
agl/eventHandler.h
Expand All @@ -21,9 +19,6 @@ set(EQUALIZER_PUBLIC_HEADERS
client.h
commandQueue.h
compositor.h
compressor/compressor.h
compressor/compressorReadDrawPixels.h
compressor/compressorYUV.h
config.h
configStatistics.h
eq.h
Expand Down Expand Up @@ -151,9 +146,6 @@ set(EQUALIZER_SOURCES
windowStatistics.cpp
windowSystem.cpp
worker.cpp
compressor/compressor.cpp
compressor/compressorReadDrawPixels.cpp
compressor/compressorYUV.cpp
)

set(EQUALIZER_LINK_LIBRARIES
Expand Down Expand Up @@ -275,8 +267,8 @@ target_compile_definitions(Equalizer PRIVATE EQUALIZERFABRIC_SHARED_INL)
if(CMAKE_COMPILER_IS_CLANG)
target_compile_options(Equalizer PUBLIC -Wno-overloaded-virtual)
endif()
add_dependencies(Equalizer EqualizerServer) # dlopen'ed

add_subdirectory(compressor)
add_subdirectory(fabric)
add_subdirectory(server)
add_subdirectory(admin)
21 changes: 21 additions & 0 deletions eq/compressor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2017 [email protected]

include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_MX_INCLUDE_DIRS})

add_definitions(-DEQ_PLUGIN_BUILD)

set(EQUALIZERCOMPRESSOR_HEADERS
compressor.h
compressorReadDrawPixels.h
compressorYUV.h
)

set(EQUALIZERCOMPRESSOR_SOURCES
compressor.cpp
compressorReadDrawPixels.cpp
compressorYUV.cpp
)

set(EQUALIZERCOMPRESSOR_LINK_LIBRARIES PRIVATE Equalizer Pression)

common_library(EqualizerCompressor)
2 changes: 2 additions & 0 deletions eq/compressor/compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ void Compressor::registerEngine( const Compressor::Functions& functions )

size_t EqCompressorGetNumCompressors()
{
if( !eq::plugin::_functions )
return 0;
return eq::plugin::_functions->size();
}

Expand Down
14 changes: 12 additions & 2 deletions eq/compressor/compressorYUV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,23 @@ void CompressorYUV::_compress( const GLEWContext* glewContext,

if ( _fbo )
{
LBCHECK( _fbo->resize( outDims[1], outDims[3] ));
const auto error = _fbo->resize( outDims[1], outDims[3] );
if( error != ERROR_NONE )
{
LBERROR << "FBO resize failed: " << error << std::endl;
return;
}
_fbo->bind();
}
else
{
_fbo = new util::FrameBufferObject( glewContext );
LBCHECK( _fbo->init( outDims[1], outDims[3], GL_RGBA, 0, 0 ));
const auto error = _fbo->init( outDims[1], outDims[3], GL_RGBA, 0, 0 );
if( error != ERROR_NONE )
{
LBERROR << "FBO init failed: " << error << std::endl;
return;
}
}

_texture->bind();
Expand Down
21 changes: 1 addition & 20 deletions eq/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool exit()
if( --_initialized > 0 ) // not last
return true;

BOOST_FOREACH( WindowSystemIF* windowSystem, _windowSystems )
for( WindowSystemIF* windowSystem : _windowSystems )
delete windowSystem;
_windowSystems.clear();

Expand Down Expand Up @@ -296,25 +296,6 @@ void _initPlugins()
const char* home = getenv( "HOME" );
if( home )
plugins.loadDirectory( std::string( home ) + "/.eqPlugins" );

#ifdef EQUALIZER_DSO_NAME
plugins.loadFile( EQUALIZER_DSO_NAME );
std::string absDSO = std::string( EQ_BUILD_DIR ) + "lib/" +
EQUALIZER_DSO_NAME;
plugins.loadFile( absDSO );

# ifdef NDEBUG
absDSO = std::string( EQ_BUILD_DIR ) + "lib/Release/" + EQUALIZER_DSO_NAME;
# else
absDSO = std::string( EQ_BUILD_DIR ) + "lib/Debug/" + EQUALIZER_DSO_NAME;
# endif

plugins.loadFile( absDSO );
#else
# ifndef NDEBUG
# error "EQUALIZER_DSO_NAME not defined"
# endif
#endif
}

Config* getConfig( const int argc, char** argv )
Expand Down
29 changes: 17 additions & 12 deletions eq/windowSystem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2015, Stefan Eilemann <[email protected]>
/* Copyright (c) 2007-2017, Stefan Eilemann <[email protected]>
* Daniel Pfeifer <[email protected]>
* Daniel Nachbaur <[email protected]>
*
Expand Down Expand Up @@ -28,12 +28,18 @@

namespace eq
{
static WindowSystemIF* _stack = 0;
namespace
{
std::vector< WindowSystemIF* >& _getRegistry()
{
static std::vector< WindowSystemIF* > registry;
return registry;
}
}

WindowSystemIF::WindowSystemIF()
: _next( _stack )
{
_stack = this;
_getRegistry().push_back( this );
}

uint32_t WindowSystemIF::_setupLists( util::ObjectManager& gl, const void* key,
Expand All @@ -60,9 +66,9 @@ WindowSystem::WindowSystem( const std::string& type )

void WindowSystem::_chooseImpl( const std::string& name )
{
LBASSERTINFO( _stack, "no window system available" );
LBASSERTINFO( !_getRegistry().empty(), "no window system available" );

for( WindowSystemIF* ws = _stack; ws; ws = ws->_next )
for( auto ws : _getRegistry() )
{
if( ws->getName() == name )
{
Expand All @@ -71,19 +77,18 @@ void WindowSystem::_chooseImpl( const std::string& name )
}
}

for( WindowSystemIF* ws = _stack; ws; ws = ws->_next )
for( auto ws : _getRegistry() )
if( !ws->getName().empty( ))
_impl = ws;
if( !_impl )
_impl = _stack;
_impl = _getRegistry().back();

LBWARN << "Window system '" << name << "' not supported, " << "using "
<< _impl->getName() << " instead." << std::endl;
}

bool WindowSystem::supports( std::string const& type )
{
for( WindowSystemIF* ws = _stack; ws; ws = ws->_next )
for( auto ws : _getRegistry() )
{
if( ws->getName() == type )
return true;
Expand All @@ -94,13 +99,13 @@ bool WindowSystem::supports( std::string const& type )

void WindowSystem::configInit( Node* node )
{
for( WindowSystemIF* ws = _stack; ws; ws = ws->_next )
for( auto ws : _getRegistry() )
ws->configInit( node );
}

void WindowSystem::configExit( Node* node )
{
for( WindowSystemIF* ws = _stack; ws; ws = ws->_next )
for( auto ws : _getRegistry() )
ws->configExit(node );
}

Expand Down
1 change: 0 additions & 1 deletion eq/windowSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class WindowSystemIF
virtual bool hasMainThreadEvents() const { return false; }

private:
WindowSystemIF* _next;
friend class WindowSystem;
};

Expand Down