MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Split MengeCore.dll/a into two libraries #39

Closed curds01 closed 7 years ago

curds01 commented 7 years ago

This PR does several things:

1) Creates the MengeVis and MengeCore libraries. The MengeCore library has no external dependencies. The MengeVis library has various external dependencies to handle images, fonts, etc., The core library can be embedded in other systems without dragging along a lot of additional (and possibly unnecessary) libraries. 2) Add an initial c-style API to facilitate integration. 3) Remove VS 2005 project. 4) Advance version to 0.9.0 5) Scrub coding style into a more consistent style.

Fixes #34

curds01 commented 7 years ago

@chraibi Please take a look and see if this builds in OSX.

curds01 commented 7 years ago

If you look to the right of the "Merge pull request" button, there is a link for command line instructions. It will give you precise instructions for creating a local branch and checking out from my branch into that local branch.

chraibi commented 7 years ago

After having to fix two small "errors"

In this line

endt --> end

and two places in CorePluginEngine.cpp where >> should be replaced by > > (space inbetween)

-BasePluginEngine<CorePluginEngine, Plugin<CorePluginEngine>>(), _simDB( simDB ) {                    
+BasePluginEngine<CorePluginEngine, Plugin<CorePluginEngine> >(), _simDB( simDB ) {     

and

class MENGE_API CorePluginEngine : public BasePluginEngine<CorePluginEngine,                                 
-  Plugin<CorePluginEngine>> {   
+  Plugin<CorePluginEngine> > {

I get now link errors

screen shot 2017-02-12 at 16 34 21

I can investigate this next days. Now we have Sunday here. (and a new president!)

You changed something in CMakelist?

curds01 commented 7 years ago

I just submitted a new commit that addresses several issues. I have high hopes it might alleviate your linker problem. Although, to be perfectly frank, your linker issue is a bit mysterious. I compiled against both g++ and clang++. I had what appeared to be a related linker problem. I addressed that. So, fingers crossed.

(Wanna trade presidents? :D)

chraibi commented 7 years ago

Good news! The error is solved. Here are other new errors:

modified   src/Menge/MengeVis/PluginEngine/VisPluginEngine.cpp                                                                 
@@ -24,7 +24,7 @@ namespace MengeVis {                                                                                         
                /////////////////////////////////////////////////////////////////////                                          

                VisPluginEngine::VisPluginEngine() :                
- BasePluginEngine<VisPluginEngine, Plugin<VisPluginEngine>>() {                                         
+ BasePluginEngine<VisPluginEngine, Plugin<VisPluginEngine> >() {                                        
modified   src/Menge/MengeVis/PluginEngine/VisPluginEngine.h                                                                   
@@ -28,7 +28,7 @@ namespace MengeVis {                                                                                         
                 */                                                                                                            
  class MENGEVIS_API VisPluginEngine :   public Menge::PluginEngine::BasePluginEngine<VisPluginEngine,   
-Menge::PluginEngine::Plugin<VisPluginEngine>> {         
+Menge::PluginEngine::Plugin<VisPluginEngine> > {              

Sorry I don't know how to push to a merge request, so I ll just paste here the diffs.

Now we have a new Linker error.

screen shot 2017-02-12 at 21 32 36

See also this log for the complete error. log_Menge.txt

This MengeVis is something new, right?

curds01 commented 7 years ago

So, I've addressed the diff.

The linker errors are killing me. I'd hoped that by using clang on Ubuntu, I could reasonably approximate what you're experiencing. But I don't get any of these artifacts. Can you remind me what version of clang you're using?

chraibi commented 7 years ago
screen shot 2017-02-12 at 23 28 39
curds01 commented 7 years ago

Apple is killing me.

Now I have to figure out how to compare arbitrarily different version codes: Apple LLVM 8.0.0 vs Ubuntu's 3.8.0. Siiiiiigh.

curds01 commented 7 years ago

I think I've solved the linker issue. (At least, I hope.)

chraibi commented 7 years ago

Ok Sean. You are doing well. Problem solved.

Now we are at 87%

screen shot 2017-02-13 at 09 34 21

curds01 commented 7 years ago

The most obvious guess, based on this message, is that the linking is missing a reference to mengeVis. I've added the link dependency (to this as well as AgtZanlungo.) The terrain plug-in already had it and I don't think any of the other plug ins require it.

It's insane how inconsistent build systems are. Clearly, on your mac, the build system is being very picky about build-time consistencies; it wants to know that the hanging symbols can actually be dereferenced into libraries. So, by omitting the library dependency, it can't confirm that it's a valid binary. The other systems appear to have decided that it's a run-time problem. Check the libraries if available, but don't worry about it. And that's g++ and clang++ on ubuntu.

chraibi commented 7 years ago

Just to say that compiling using a fresh Ubuntu Image works fine! So, as you said the different systems the building process is different.

curds01 commented 7 years ago

So, does this version build on your mac. Are we good to go?

chraibi commented 7 years ago

Negative. The above mentioned linker error persists. Sorry I did not manage to check why. Maybe in the week end.

curds01 commented 7 years ago

It persists since my comment indicating that I thought I fixed it? You'll have to pull again.

chraibi commented 7 years ago
HEAD is now at 70e182c... Another round of mac osx build fixes

and we are at 87%.

[ 87%] Linking CXX shared library /Users/chraibi/Workspace/Menge/Exe/plugins/libhelbingPed.dylib
Undefined symbols for architecture x86_64:
  "MengeVis::SceneGraph::SelectContext::selectGL(MengeVis::SceneGraph::GLScene const*, MengeVis::SceneGraph::GLCamera const&,
int, int, int*)", referenced from:
chraibi commented 7 years ago

Ok my dear here is the solution screen shot 2017-02-16 at 13 30 41

screen shot 2017-02-16 at 13 31 21

😎

curds01 commented 7 years ago

Stupidly, that's exactly the fix I'd done several days ago. I thought I'd commited and pushed it, but apparently not. Sorry for wasting your time.

chraibi commented 7 years ago

👍