Crystal Space
Welcome, Guest. Please login or register.
December 21, 2014, 05:51:15 am

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9296 Members
Latest Member: Nicolepearce
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  OSX Snow Leopard compilation issues - bundle vs dynamiclib clash
« previous next »
Pages: [1] Print
Author Topic: OSX Snow Leopard compilation issues - bundle vs dynamiclib clash  (Read 25623 times)
T00n3
Newbie
*
Posts: 9


View Profile Email
« on: August 04, 2010, 09:24:52 pm »

Greetings,

First of all, please excuse my poor english, I hope I'll be understandable ...

I was wondering if anyone was successful at compiling CS on snow leopard, and if there was some well known issues.

I ran through a first (very common) issue with the pthread library (cannot cast from '_opaque_pthread_t*' to 'CS::Threading::ThreadID'), but simply redeclaring TheadID to an "unsigned long int" solved the problem since OSX is manipulating 64bits pointers now.

The issue I cannot solve is when linking csbundles, ie:

Code:
g++ -bundle -o cscursor.csbundle ./out/macosx/optimize/plugins/video/cursor/cursor.o  -lc -lm -lmx -ldl -L/usr/local/lib -g2 -Wl,-framework,AppKit -Wl,-framework,Foundation -shared -bundle ./out/macosx/optimize/libs/libcrystalspace-1.4.a -lz -lc -lm -lmx -ldl -L/usr/local/lib -g2 -Wl,-framework,AppKit -Wl,-framework,Foundation

i686-apple-darwin10-g++-4.2.1: -bundle not allowed with -dynamiclib

I can't see the famous "-dynamiclib" flag in the compilation lines, and a grep on the whole project didn't return anything. Just in case I changed the deployment target variable to "export MACOSX_DEPLOYMENT_TARGET=10.6" but it didn't help at all, so I guess that the error is happening when linkin against the standard framework ...

Any suggestion about this issue would be gratefully recieved !

Thanks in advance,

Tonio
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #1 on: August 04, 2010, 09:53:05 pm »

Ok, my apologies for the stupid question, and for not trying enough (if brute force didn't work ...)

Simply replacing the "-bundle" flag in macosx.jam did the trick. There is still an error when creating glosx2d.csbundle but I'll consider this tomorrow ^^

Code:
    export MACOSX_DEPLOYMENT_TARGET=10.6
    g++ -dynamiclib -o glosx2d.csbundle ./out/macosx/optimize/plugins/video/canvas/macosx/opengl/GLOSXDriver2D.o ./out/macosx/optimize/plugins/video/canvas/macosx/opengl/OSXDelegate2D_OpenGL.o  -lc -lmx -ldl -L/usr/local/lib -g2 -Wl,-framework,AppKit -Wl,-framework,Foundation -shared -dynamiclib ./out/macosx/optimize/libs/libcrystalspace_opengl-1.4.a ./out/macosx/optimize/libs/libcrystalspace_macosx-1.4.a ./out/macosx/optimize/libs/libcrystalspace-1.4.a -lz -framework OpenGL -lm -lc -lm -lmx -ldl -L/usr/local/lib -g2 -Wl,-framework,AppKit -Wl,-framework,Foundation

Undefined symbols:
  "_OBJC_IVAR_$_NSOpenGLContext._contextAuxiliary", referenced from:
      -[NSOpenGLContext(CGLContextAccess) getCGLContext] in OSXDelegate2D_OpenGL.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: August 05, 2010, 11:24:45 am »

Two new compilation issues today =)

- for the previous NSOpenGLContext error :

I replaced :
return _contextAuxiliary;
With:
return [self CGLContextObj];

In plugins/video/canvas/macosx/opengl/OSXDelegate2D_OpenGL.m
As suggested here :
http://permalink.gmane.org/gmane.comp.graphics.crystalspace.tracker/5663

- Another type error in the coreaudio driver :

Code:
/Network/Servers/hal.machinemolle/Users/nephilim/Downloads/crystalspace-src-1.4.0/plugins/sndsys/renderer/software/drivers/coreaudio/driver_coreaudio.cpp:271: error: cannot convert ‘size_t*’ to ‘UInt32*’ for argument ‘4’ to ‘OSStatus AudioConverterConvertBuffer(OpaqueAudioConverter*, UInt32, const void*, UInt32*, void*)’

I replaced :
size_t bytesWritten = outOutputData->mBuffers[0].mDataByteSize;
With:
UInt32 bytesWritten = outOutputData->mBuffers[0].mDataByteSize;

In plugins/sndsys/renderer/software/drivers/coreaudio/driver_coreaudio.cpp (#270).
_________________________________________

I can now compile cs (1.4 stable), but cannot launch the walktest, it fails when loading vfs.csplugin :

Code:
SCF_NOTIFY: loading plugin /Work/crystal/lib/crystalspace-1.4/vfs.csplugin to satisfy request for csVFS
ERROR: Failed to load plug-in module `/Work/crystal/lib/crystalspace-1.4/vfs.csplugin'.
Reason: NSCreateObjectFileImageFromFile(/Work/crystal/lib/crystalspace-1.4/vfs.csbundle) failed (error 2)
SCF_WARNING: factory returned a null instance for crystalspace.kernel.vfs
if error messages are not self explanatory, recompile CS with CS_DEBUG
WARNING: could not load plugin 'crystalspace.kernel.vfs'

The environment variable is set to the required configuration path (./configure --prefix=/Work/crystal) :
Code:
> defaults read NSGlobalDomain CrystalSpaceRoot
/Work/crystal

I will now try to make a clean compilation again with debug enabled, but just in case ... should I try to compile against the latest cvs version rather than the last stable one ?
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #3 on: August 05, 2010, 11:53:12 am »

Oooops, I am confused, I didn't even read the first post of this section ...
- CS 1.4 (last stable download link)
- OSX Snow Leopard 10.6.2
- i686-apple-darwin10-g++-4.2.1
- Old fashioned GeForce 7300 GT (and old quad core mac pro, apple integrated drivers)
- Extension libraries installed with port (libz version: 1.2.3)
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #4 on: August 05, 2010, 09:05:44 pm »

Still trying to make it run on Snow Leopard ...

I changed for the last cvs revision (34697), and had to report the "bundle -> dynamiclib" change in macosx.jam, but the compilation stopped when linkin the audio layer with OpenAL.

The port version of OpenAL (1.0) seem broken (a lot of "jam deprecated" errors), so I downloaded the official binary package since I don't want to handle a parallel fink distro. The first try failed (OpenAL still not found) so I launched a distclean/configure to restart from scratch, and it worked.

The walktest is able to launch now, but it crash (segfault) a few seconds after the context initialization Sad

Code:
crystalspace.rendermanager.unshadowed:
  Reading render layers from '/data/renderlayers/lighting_default.xml'

crystalspace.graphics3d.shadercompiler.xmlshader:
  Shader z_only: unvarying techs, 2 ms

crystalspace.graphics3d.shadercompiler.weaver:
  Shader z_only: (null) weaved in 7 ms
NOTIFY: loading plugin instance for crystalspace.graphics3d.shader.combiner.glcg

crystalspace.pluginmgr.loadplugin:
  could not load plugin 'crystalspace.graphics3d.shader.combiner.glcg'
ALERT: crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!

crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!
NOTIFY: loading plugin instance for crystalspace.graphics3d.shader.combiner.glcg

crystalspace.pluginmgr.loadplugin:
  could not load plugin 'crystalspace.graphics3d.shader.combiner.glcg'
ALERT: crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!

crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!
NOTIFY: loading plugin instance for crystalspace.graphics3d.shader.combiner.glcg

crystalspace.pluginmgr.loadplugin:
  could not load plugin 'crystalspace.graphics3d.shader.combiner.glcg'
ALERT: crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!

crystalspace.plugin.load:  Couldn't load plugin with class 'crystalspace.graphics3d.shader.combiner.glcg'!

crystalspace.graphics3d.shadercompiler.weaver:
  Invalid 'from' attribute lightOffset
  [node: shader(name=lighting_default),technique(priority=500),pass,connection]
  Invalid 'from' attribute maxLights
  [node: shader(name=lighting_default),technique(priority=500),pass,connection]
  Invalid 'from' attribute minLights
  [node: shader(name=lighting_default),technique(priority=500),pass,connection]
shader lighting_default: NOTIFY: loading plugin instance for crystalspace.graphics3d.shader.combiner.glcg
NOTIFY: loading plugin instance for crystalspace.graphics3d.shader.combiner.glcg
Segmentation fault

Tomorrow is another day ^^

No feedback on OSX SL ? Should I ask for help in the mailing list rather than posting here ?

Tonio
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #5 on: August 05, 2010, 11:06:11 pm »

Installed Nvidia Cg toolkit 3 as suggested at various places when running through issues with shaders, but it didn't solved this segfault issue.

Code:
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  8
...
Thread 8 Crashed:
0   walktest                      0x000000010000b83d csRef<iComponent>::csRef(csRef<iComponent> const&) + 29 (ref.h:196)
1   walktest                      0x00000001000b6357 csPluginManager::LoadPluginInstance(char const*, unsigned int) + 777
2   shaderweaver.csbundle          0x00000001276aac77 csPtr<CS::PluginCommon::ShaderWeaver::iCombinerLoader> csLoadPlugin<CS::PluginCommon::ShaderWeaver::iCombinerLoader>(iPluginManager*, char const*, bool, bool) + 97 (plugin.h:262)
3   shaderweaver.csbundle          0x00000001276aad42 csPtr<CS::PluginCommon::ShaderWeaver::iCombinerLoader> csLoadPluginCheck<CS::PluginCommon::ShaderWeaver::iCombinerLoader>(iPluginManager*, char const*, bool) + 123 (plugin.h:296)
4   shaderweaver.csbundle          0x00000001276aae3e csPtr<CS::PluginCommon::ShaderWeaver::iCombinerLoader> csLoadPluginCheck<CS::PluginCommon::ShaderWeaver::iCombinerLoader>(iObjectRegistry*, char const*, bool) + 167 (plugin.h:321)
5   shaderweaver.csbundle          0x00000001276cbca8 CS::Plugin::ShaderWeaver::Synthesizer::SynthesizeTechnique::operator()(CS::Plugin::ShaderWeaver::ShaderVarNodesHelper&, iDocumentNode*, CS::Plugin::ShaderWeaver::Snippet const*, CS::Plugin::ShaderWeaver::TechniqueGraph const&) + 642 (synth.cpp:390)
6   shaderweaver.csbundle          0x00000001276e32f3 CS::Plugin::ShaderWeaver::Synthesizer::SynthesizeTechnique::Run() + 71 (synth.h:192)
7   shaderweaver.csbundle          0x000000012771a62e CS::Threading::ThreadedJobQueue::QueueRunnable::Run() + 626
8   shaderweaver.csbundle          0x000000012773a535 CS::Threading::Implementation::(anonymous namespace)::proxyFunc(void*) + 129
9   libSystem.B.dylib              0x00007fff8526ef8e _pthread_start + 331
10  libSystem.B.dylib              0x00007fff8526ee41 thread_start + 13

I'll try tomorrow with a newer graphic adapter :-/
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #6 on: August 06, 2010, 01:10:16 am »

Yay, found some useful tips on the PlaneShift bug tracker for what matters, since it seems I'm the only one to read this thread ^^

http://docs.hydlaaplaza.com/flyspray/index.php?do=details&task_id=3272

I guess I should just wait for the 2.0 release ... I am definitely not skilled enough to be of any help in this domain ;p
Logged
kickvb
Global Moderator
Jr. Member
*****
Posts: 79


View Profile
« Reply #7 on: August 06, 2010, 01:55:33 am »

I'm not experienced in the compilation of CS on OSX but I know that there have been some recent changes in OSX and XCode preventing to compile CS easily.

Some problems have already been fixed, some others are currently being fixed. The fixes have been commited to the 1.4 branch, so you might try to get the CS sources from the svn ( https://crystal.svn.sourceforge.net/svnroot/crystal/CS/branches/release/V1.4) instead of from the release package.
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #8 on: August 06, 2010, 08:19:43 pm »

Hello kickvb,

A big thanks for your answer, I feel less alone now Wink

Sorry I didn't notice the 1.4 branch. I tried it this afternoon without success, the walktest fail at loading the crystalspace.kernel.vfs plugin, and a clean whole recompilation didn't solved the problem.

I guess that my "bundle vs dynamiclink" fix is not the right thing to do, so I'll give jam a try since I am currently doing things "the old way" (configure; make; make install). PlaneShift people are definitely using jam, probably for a good reason ...

Thanks again for this new sight of hope !

Tonio
Logged
T00n3
Newbie
*
Posts: 9


View Profile Email
« Reply #9 on: August 10, 2010, 06:49:59 pm »

Hi again,

Some tries, a lot of compiliations on clean and not so clean oses, with port and fink distros, but no more success with jam or make. I'll stop toying since I am doing this at work (in a professional context of course ;p), and will probably come back later for a more mature release of CS.

I would be happy to help by any way, there is a lot of (Snow) Leopard systems here to build, test and debug things, so feel free to contact me if needed !

Tonio
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #10 on: August 16, 2010, 03:58:41 pm »

Hi T00n3,

I did not see this thread since I do not check the forum very often anymore, however, kickvb pointed it out to me. Some people read the forum primarily, and some read only the mailing lists, so it can be difficult to know where to post. I usually follow only the mailing lists and the issue tracker. Also, there are several Mac OS X users subscribed to the crystal-main and crystal-develop mailing lists, so it might be useful posting there. At least one of those persons is actively extending CS (for GSoC), so he presumably has a working installation of CS on Snow Leopard. (He filed several of the bug reports mentioned below, which we have since fixed).

The CS::Threading::ThreadID problem should be addressed by commit r33845 in trunk (http://trac.crystalspace3d.org/trac/CS/changeset/33845). Unfortunately, this fix slipped through the cracks and has not yet been merged into the 1.4 branch, although I just added it to the list of patches which should be applied: http://trac.crystalspace3d.org/trac/CS/wiki/Version14Plan#Candidatesfor1.4.1

The -bundle issue has been raised several times (most recently in this thread http://thread.gmane.org/gmane.comp.graphics.crystalspace.devel/3003/). My understanding is that this flag merely needs to be dropped when building with Snow Leopard. In each case I suggested that we should automate detection of Snow Leopard and conditionally remove the -bundle flag, although there was never any follow-up to my inquiries. If you would like to work with me to resolve the issue, that would be ideal.

Setting MACOSX_DEPLOYMENT_TARGET probably should not be necessary since the project itself should still be deployable on older Mac OS X releases, so no need to restrict deployment only to Snow Leopard.

The NSOpenGLContext issue was the subject of ticket #810 (http://trac.crystalspace3d.org/trac/CS/ticket/810) and resolved in trunk by r33867 (http://trac.crystalspace3d.org/trac/CS/changeset/33867). The fix was merged into the 1.4 branch with r33868.

The size_t vs Uint32 compilation failure in driver_coreaudio.cpp was the subject of ticket #811 (http://trac.crystalspace3d.org/trac/CS/ticket/811) and resolved in trunk by r33872 (http://trac.crystalspace3d.org/trac/CS/changeset/33872). The fix was merged into the 1.4 branch with r33873.

Did you ever resolve the problem with vfs plugin not being found? Typically, this would occur if zlib was not installed or detected at CS configure time.

Regarding the build system, jam and make are equivalent in CS. They both invoke the same build commands, so there is no functional difference between the two. Whether you use "./configure; make; make install" or "./configure; jam; jam install" is a matter of personal preference.

Was the shaderweaver crash from 1.4 or pre-2.0 CS? Perhaps this problem also has been fixed in the trunk.

Generally speaking, unless there are constraints which force you to use the 1.4 release (or branch), I would recommend instead using the pre-2.0 (trunk) version directly from Subversion since it has advanced a lot from when 1.4 was released, and many bugs have been fixed in the trunk.
« Last Edit: August 17, 2010, 01:55:09 pm by sunshine » Logged
kickvb
Global Moderator
Jr. Member
*****
Posts: 79


View Profile
« Reply #11 on: August 17, 2010, 01:16:38 pm »

The branch of the GSOC of the student that was working on Snow Leopard has been merged in trunk yesterday on r34871. It includes some other fixes that you may also want to try.
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #12 on: August 17, 2010, 01:30:46 pm »

There also is a fix for CEGUI detection still pending: http://thread.gmane.org/gmane.comp.graphics.crystalspace.devel/3003/focus=3027. This is pending since I am waiting to hear if the patch actually works. (If you happen to test it, please report your results.)
« Last Edit: August 17, 2010, 01:56:57 pm by sunshine » Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #13 on: August 17, 2010, 01:50:54 pm »

The CS::Threading::ThreadID problem should be addressed by commit r33845 in trunk (http://trac.crystalspace3d.org/trac/CS/changeset/33845). Unfortunately, this fix slipped through the cracks and has not yet been merged into the 1.4 branch, although I just added it to the list of patches which should be applied:

I merged fix r33845 into the 1.4 branch via r34876.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 9.285 seconds with 15 queries.