CMake build issues Linux

dermont

05-06-2013 10:08:08

Ogre 1.9 latest hg revsion.

1) Trying a local installation fails, the build attempts to install FindOgreProcedural.cmake to the CMake root dir.


"/media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/CMake/Packages/FindOgreProcedural.cmake"
to "/usr/share/cmake-2.8/Modules/FindOgreProcedural.cmake".


I'm not sure why this is needed since it is already installed to ${CMAKE_INSTALL_PREFIX}/lib/OgreProcedural/cmake


CMake/CmakeLitst.txt
install(FILES Packages/FindOgreProcedural.cmake DESTINATION ${CMAKE_ROOT}/Modules)


2) Running Illustrations fails when building or running from the bin dir.

*-*-* OGRE Initialising
*-*-* Version 1.9.0unstable (Ghadamon)
Creating resource group Essential
Added resource location '/media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/samples/media' of type 'FileSystem' to resource group 'Essential'
Added resource location '/media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/samples/media/SdkTrays.zip' of type 'Zip' to resource group 'Essential'
Added resource location '/media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/samples/media/RTShaderLib.zip' of type 'Zip' to resource group 'Essential'
Creating resource group Scripts
Added resource location '/media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/samples/media' of type 'FileSystem' to resource group 'Scripts'
Segmentation fault
make[2]: *** [bin/Illustrations] Error 139
make[1]: *** [docs/manual/illustrations/CMakeFiles/Illustrations.dir/all] Error 2
make: *** [all] Error 2


It appears that all plugins in plugins.cfg are commented out. I think the problem is in ProceduralMacros.cmake, e.g:


//if(NOT EXISTS ${OGRE_RenderSystem_GL_REL})
if(NOT EXISTS ${OGRE_RenderSystem_GL_LIBRARY_REL})
set(OgreProcedural_COMMENT_RENDERSYSTEM_GL "#")
endif()


3) For later versions of boost Ogre doesn't include linking to library to boost_system in its pkg-config file, so I had to fudge the CMake file to link against it.

4) After the above updates running illustrations fails creating the following image. I don't have a back trace. Any ideas where to start looking.

Texture: road.png: Loading 1 faces(PF_R8G8B8,128x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x256x1.
An exception has occured: OGRE EXCEPTION(7:InternalErrorException): FreeType ERROR: FT_New_Face - 1 in Procedural::TextShape::realizeShapes() at /media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/library/src/ProceduralMultiShapeGenerators.cpp (line 64)


5) There appears to be no pkg-config file for Linux. Is this intended or someone hasn't just got round to updating the build to create one?

dermont

06-06-2013 01:00:03



4) After the above updates running illustrations fails creating the following image. I don't have a back trace. Any ideas where to start looking.

Texture: road.png: Loading 1 faces(PF_R8G8B8,128x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x256x1.
An exception has occured: OGRE EXCEPTION(7:InternalErrorException): FreeType ERROR: FT_New_Face - 1 in Procedural::TextShape::realizeShapes() at /media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/library/src/ProceduralMultiShapeGenerators.cpp (line 64)




It appears the problem is with the font name "Arial". On Linux freetype also expects the filepath and file extension. Why not use one of the fonts from the media that ships with OgreProcedural.

Transporter

06-06-2013 08:41:34

Thank you for your feedback!

4) After the above updates running illustrations fails creating the following image. I don't have a back trace. Any ideas where to start looking.

Texture: road.png: Loading 1 faces(PF_R8G8B8,128x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x256x1.
An exception has occured: OGRE EXCEPTION(7:InternalErrorException): FreeType ERROR: FT_New_Face - 1 in Procedural::TextShape::realizeShapes() at /media/sda1/Libraries/OGRE/ogre-addons/ogre-procedural-default/library/src/ProceduralMultiShapeGenerators.cpp (line 64)

It appears the problem is with the font name "Arial". On Linux freetype also expects the filepath and file extension. Why not use one of the fonts from the media that ships with OgreProcedural.
How can I load a font from Ogre resource manager to FreeType? I'll change the code.

It appears that all plugins in plugins.cfg are commented out. I think the problem is in ProceduralMacros.cmake, e.g:


//if(NOT EXISTS ${OGRE_RenderSystem_GL_REL})
if(NOT EXISTS ${OGRE_RenderSystem_GL_LIBRARY_REL})
set(OgreProcedural_COMMENT_RENDERSYSTEM_GL "#")
endif()

In this case Ogre detection is not working correct or this file detection is not working under linux.

3) For later versions of boost Ogre doesn't include linking to library to boost_system in its pkg-config file, so I had to fudge the CMake file to link against it.

5) There appears to be no pkg-config file for Linux. Is this intended or someone hasn't just got round to updating the build to create one?

I'm sorry. I'm working with windows. It would be nice if you can create the pkg-config file.

dermont

06-06-2013 15:40:08


How can I load a font from Ogre resource manager to FreeType? I'll change the code.

Not sure of the correct way but you could maybe get the path/filename and/or set the font FileSystem path via CMake.

Ogre::FileInfoListPtr pFileInfo = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo("FONT", "*.ttf");
for (Ogre::FileInfoList::iterator fi = pFileInfo->begin();
fi != pFileInfo->end(); ++fi ) {
std::cout << fi->filename << " " << fi->archive->getName() << std::endl;
}


resources.cfg


//FileSystem=/usr/share/fonts/truetype/msttcorefonts
FileSystem=./FONT

Sorry I don't know a cross distro way to access the default font paths.



In this case Ogre detection is not working correct or this file detection is not working under Linux.


Ok I'll take your word for it, I don't use FindOgre* since I'm on Linux and should know where my libs are installed.

I haven't seen OGRE_RenderSystem_*_REL in the gui when building other libs only OGRE_RenderSystem_*_LIBRARY_REL.


find_package(OGRE REQUIRED)
set (PLUGINS "Direct3D9;Direct3D11;GL;GL3Plus")
foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_LIBRARY_REL})
endforeach(p)

>>Plugin OGRE_RenderSystem_Direct3D9_LIBRARY_REL-NOTFOUND
>> Plugin OGRE_RenderSystem_Direct3D11_LIBRARY_REL-NOTFOUND
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL.so
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL3Plus.so

foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_REL})
endforeach(p)

>> Plugin
>> Plugin
>> Plugin
>> Plugin

Transporter

07-06-2013 14:12:50


In this case Ogre detection is not working correct or this file detection is not working under Linux.


Ok I'll take your word for it, I don't use FindOgre* since I'm on Linux and should know where my libs are installed.

I haven't seen OGRE_RenderSystem_*_REL in the gui when building other libs only OGRE_RenderSystem_*_LIBRARY_REL.


find_package(OGRE REQUIRED)
set (PLUGINS "Direct3D9;Direct3D11;GL;GL3Plus")
foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_LIBRARY_REL})
endforeach(p)

>>Plugin OGRE_RenderSystem_Direct3D9_LIBRARY_REL-NOTFOUND
>> Plugin OGRE_RenderSystem_Direct3D11_LIBRARY_REL-NOTFOUND
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL.so
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL3Plus.so

foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_REL})
endforeach(p)

>> Plugin
>> Plugin
>> Plugin
>> Plugin

I'll have a look at this point. Now, I fixed the font stuff here.

mikachu

07-06-2013 22:38:17

@dermont :
1) done, I also think it was a pain..
5) I don't know anything about pkg-config, but if you can help, don't hesitate to contribute..

For the rest, I applied Transporter's patch

dermont

08-06-2013 11:19:29


1) done, I also think it was a pain..

Thanks.


5) I don't know anything about pkg-config, but if you can help, don't hesitate to contribute..

Will do.


For the rest, I applied Transporter's patch

Transporter's patch resolves the issue with the font name (4), kudos to him. All of the above issues are minor and just related to subtle differences with Linux which I believe Transporter doesn't develop with.

One last thing I noticed was that the GL3 doesn't work properly. It probably just needs implementation( as per the SampleBrowser) of RTSS to emulate the fixed function pipeline. This would mean linking the demos against the OgreRTShaderSystem if GL3/DX11 plugins are enabled.

dermont

22-10-2013 09:21:54


In this case Ogre detection is not working correct or this file detection is not working under Linux.


Ok I'll take your word for it, I don't use FindOgre* since I'm on Linux and should know where my libs are installed.

I haven't seen OGRE_RenderSystem_*_REL in the gui when building other libs only OGRE_RenderSystem_*_LIBRARY_REL.


find_package(OGRE REQUIRED)
set (PLUGINS "Direct3D9;Direct3D11;GL;GL3Plus")
foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_LIBRARY_REL})
endforeach(p)

>>Plugin OGRE_RenderSystem_Direct3D9_LIBRARY_REL-NOTFOUND
>> Plugin OGRE_RenderSystem_Direct3D11_LIBRARY_REL-NOTFOUND
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL.so
>>Plugin /home/dermont/TEST/sdk/v1-9/lib/OGRE/RenderSystem_GL3Plus.so

foreach(p ${PLUGINS})
MESSAGE(STATUS "Plugin " ${OGRE_RenderSystem_${p}_REL})
endforeach(p)

>> Plugin
>> Plugin
>> Plugin
>> Plugin

I'll have a look at this point. Now, I fixed the font stuff here.


This is till an issue for me on Linux. I still have to edit ProceduralMacros.cmake to set the render library paths. Also RTShaderLib.zip appears to be missing DualQuaternion_Common.glsl. I had to manually add it to the media before the the images (docs/manual/illustrations) would run.

Also what's the reason behind the weird target name "OgreProceduralDoc" for doxygen/api? Normally, on Linux at least, it would be something like make doc/api/html.