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

Addresses crash issue #3340 and build standalone app via Xcode #3397

Closed
wants to merge 16 commits into from

Conversation

SilkyPants
Copy link

Builds against latest source - which seems to have already addressed issue #3340

Also requires third party pull request (pioneerspacesim/pioneer-thirdparty#15) to build with, and have updated COMPILING.txt instructions.

libvorbis
autoconf
automake


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: Looks like your editor has inserted tabs (or changed indentation for some reason). Could you please untabify it?

@SilkyPants
Copy link
Author

No problems, I have recopied the lines and edited out the ones that were not needed. Let me know if I need to find a better Text editor :)

@haxys
Copy link

haxys commented Jun 9, 2015

I attempted to compile with XCode using this branch, and it would not work. I also attempted to compile this branch using the tutorial I wrote for #3401 (which compiles perfectly with the master branch) and it would not compile this branch. I get this error:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
     (maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pioneer] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

So as it stands, this doesn't work on my Mac, which is a fresh installation of OSX 10.10.3. XCode can't find the libraries it needs in order to compile the project (and the COMPILING.txt doesn't tell how to fix that problem) and the changes made in this branch break the command-line compilation as per #3401.

@haxys
Copy link

haxys commented Jun 9, 2015

SilkyPantsDan, please get in touch with me as soon as you can so we can get all this stuff working! You can find me on IRC with the name eloquentmess. Drop me a line! Let's work together to get the XCode build working on my end, so that I can write proper instructions for how to make everything work together.

At the moment I've got instructions written for command-line compilation and app-bundle assembly which do not require the pioneer-thirdparty repository. (See #3401.) I'd like to also write instructions for how to compile using XCode, but unfortunately I haven't been able to get your changes to work with XCode.

I am hoping that the third-party repo will only be necessary to compile with XCode, as they are currently unnecessary for building with command-line tools.

@SilkyPants
Copy link
Author

@eloquentmess Will try follow up tonight with you - which libraries is it complaining about?

As far as setting it up, I had compiled this on 3 different Macs I had at home which hadn't had anything setup as well - I hope it's just a simple case that I missed a step :s

@SilkyPants
Copy link
Author

@eloquentmess I cleaned my Macbook and checked out a clean repository as well as cleaned my MacPorts. I installed the required ports with the following command

sudo port install assimp freetype libsigcxx2

Which installed the following ports

The following ports are currently installed:
  assimp @3.0.1270_1 (active)
  boost @1.58.0_3+no_single+no_static+python27 (active)
  bzip2 @1.0.6_0 (active)
  db48 @4.8.30_4 (active)
  db_select @0.1_2 (active)
  expat @2.1.0_0 (active)
  freetype @2.5.5_0 (active)
  gettext @0.19.4_0 (active)
  icu @55.1_0 (active)
  libedit @20140620-3.1_0 (active)
  libiconv @1.14_0 (active)
  libpng @1.6.17_0 (active)
  libsigcxx2 @2.4.1_0 (active)
  ncurses @5.9_2 (active)
  openssl @1.0.2a_0 (active)
  python2_select @0.0_1 (active)
  python27 @2.7.10_2 (active)
  python_select @0.3_5 (active)
  sqlite3 @3.8.10.1_0 (active)
  zlib @1.2.8_0 (active)

I then cloned the pioneer and third party repositories to the same root folder

Development
    |
    +--- pioneer
    +--- pioneer-thirdparty

After that I open pioneer/osx/pioneer.xcworkspace and compile the pioneer target. This should compile the app bundle.

Let me know if you have any missing dependencies or errors, and I'll get to them asap. Will also update the instructions with any additional information :)

@haxys
Copy link

haxys commented Jun 12, 2015

Much clearer instructions. So you merge the two into the same directory tree? I need to learn Git better.

@SilkyPants
Copy link
Author

Sort of - they are still two separate git repositories. I'm still learning the ins-and-outs of git myself :) Is it compiling OK for you now? If so I'll update the instructions with the above.

Just a thought - if all the platforms need access to the third party repository, would adding it as a submodule be a good idea?

@impaktor
Copy link
Member

So you merge the two into the same directory tree? I need to learn Git better.

Just to clarify the above, since there might be slight confuson regarding the two git repositories in the same root folder. No git stuff is going on here except cloning two repositories from the same folder, thus:

I then cloned the pioneer and third party repositories to the same root folder

Development
    |
    +--- pioneer
    +--- pioneer-thirdparty

is just two stand alone git clones, and no "merging"/"git magic" of the two repositories is done. Don't be confused by them having the same root name. So it's no different than having this setup:

~/src/
  |
  +-emacs
  +-vim

I think the ball is in @eloquentmess court now.

@haxys
Copy link

haxys commented Jul 11, 2015

So you just have to have the pioneer and pioneer-thirdparty folders in the same folder? I'll try again...

Sorry this is taking me forever, guys. I'm in the process of packing to move across the country.

@haxys
Copy link

haxys commented Jul 11, 2015

Okay I checked out a clean copy of pioneer and pioneer-thirdparty and opened the xcworkspace file and it seems to be compiling just fine. The problem I had before was that I was opening the xcodeproj file and not the xcworkspace file.

So it's compiling OK with xcode (so far), but let me see if it will still compile with the cli instructions I wrote...

@haxys
Copy link

haxys commented Jul 11, 2015

Alright, it compiled fine from xcode, but it crashes to desktop when I try to run it. Let me try compiling it from the cli...

@haxys
Copy link

haxys commented Jul 11, 2015

The code failed to compile from the command-line:

29 warnings generated.
30 warnings generated.
29 warnings generated.
  CXXLD    modelcompiler
30 warnings generated.
  CXXLD    pioneer
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
     (maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pioneer] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Apparently this build cannot be compiled from command-line anymore.

The pioneer main branch compiles fine in cli without requiring pioneer-thirdparty. Meanwhile, this branch won't compile in cli anymore and will only compile in xcode with pioneer-thirdparty. This seems like a problem to me. If the code wasn't dependent on pioneer-thirdparty before, why should it be dependent now?

@fluffyfreak
Copy link
Contributor

It seems to be building the 64bit version?

Undefined symbols for architecture x86_64:

Is that normal for OSX?

@haxys
Copy link

haxys commented Jul 14, 2015

I don't know. It's compiling for my platform, which is Mac, which are all 64-bit systems these days, so it would make sense that it would try to compile for 64 bit if that's a possibility. That being said, I've had zero problems compiling the current main branch, without the need for the third-party repo. I don't know what could be causing this to break between the main branch and this pull request, but the pull request makes it where I can only compile using xcode. I personally prefer the cli method, since I can automate it using whatever tools I want on the command-line. I had a script that would automatically compile and package an app bundle and upload it to the pioneer website, all from the command-line. This pull request will render that whole system ineffective.

What can we do?

@haxys
Copy link

haxys commented Jul 14, 2015

Obviously I'd like to optimize it so that users have a choice of whether to use xcode or the command-line. I don't see why the code can't allow for both to be an option.

@fluffyfreak
Copy link
Contributor

I believe that undefined symbol is due to the change in src/main.cpp line 23.

It might be worth removing that code and trying it again in both XCode and from the CLI to see if they both still work. Or to find another symbol so that instead of __APPLE__ there might be something like __XCODE__

That way you'll have both Xcode and CLI working, hopefully.

@SilkyPants
Copy link
Author

Sorry for the late reply - been getting smashed at work. I had never been able to get the CLI build chain to work on my end, but as @fluffyfreak has mentioned the change in line 23 could be the problem. I had to make the change as there were then multiple definitions of main in the project, but the Xcode build main was looking for a SDL_main function (pioneer/osx/SDLMain.m line 23). I'm unsure if the CLI build uses this as well.

Will try changing the #define to be specific to the Xcode build and commit something later today.

@haxys
Copy link

haxys commented Jul 16, 2015

Hey! Look at that! It compiled in the command-line as well as with XCode! And the command-line build doesn't require the third-party repository! 👍

This code gets my seal of approval.

I am a happy camper.

@haxys
Copy link

haxys commented Jul 16, 2015

Now we just need to get the COMPILING.txt in better order. I think it could do with a revision, and it would be helpful to create separate documents for each platform. The compilation instructions I created are a little lengthy because they outline the entire process, starting with setting up the build environment and finishing with the creation of a Mac App Bundle. I can easily add a section for XCode into the Mac instructions so that users have a clear choice.

At the moment I'm in the process of moving to Texas so I might not be able to do the COMPILING.txt revisions just yet, but I would like to work on this in the future. In the meanwhile, let's get this pull request rolling!

@impaktor
Copy link
Member

I'd like to see a rebase on this first, perhaps @SilkyPantsDan could squash all these commits and fo a force push to update this PR/branch?

@fluffyfreak
Copy link
Contributor

@impaktor #3430 is another report of this so I'm less bothered about rebasing and more about if it all works and we can get a new OSX build released. Will it cause the repo' any problems merging now?

@impaktor
Copy link
Member

Will it cause the repo' any problems merging now?

I see my self sitting in the back seat on this one, as I have zero Mac knowledge. But building a new release falls on @eloquentmess, no?

@haxys
Copy link

haxys commented Jul 29, 2015

I'll be happy to build a new release soon, but I'm currently without adequate internet due to the fact that I'm in the process of moving halfway across the United States. I'll touch base when I'm able. Sorry for the delay!

@haxys
Copy link

haxys commented Sep 5, 2015

Still living at Grandma's house with dial-up internet. :-P Sorry I'm taking forever on this.

@fluffyfreak
Copy link
Contributor

That's ok @eloquentmess these things happen with real-life :)

@SilkyPantsDan & @eloquentmess I might be able to help a little with testing as I have a Mac Mini for basic compilation and compatibility testing. If I could build it using XCode on the Mini what would I actually end up with and how would I package it up for release?

My Mac knowledge is limited.

@fluffyfreak
Copy link
Contributor

Ok, well I've tried this on my Mac Mini and get some mixed results.

Firstly SDL2_image fails to build due to the path to the pioneer-thirdparty/sdl2/include not being on the user search path. Then when I fix that by manually adding it the link fails due to the Ogg framework not being found.

Honestly I don't know how anyone gets work done with XCode it's a piece of shit that makes the command line look friendly :/ so I've just spent an hour trying to work all this out but I'm stumped again.

Getting this working would be superb.

I can do a command line build but I don't know how to package it all up from that once I have it built.

People have mentioned that they have scripts to do this packaging from cmd-line builds, there seems to be several of them, so can we have those committed in separate PR's?

@fluffyfreak
Copy link
Contributor

Also the only conflict here is the .gitignore

@impaktor
Copy link
Member

impaktor commented Oct 4, 2015

Also the only conflict here is the .gitignore

COMPILING.txt changed some a few hours ago, so I would not be surprised at conflicts in there as well.

I wonder what's the go-to standard method for installing software on OS X? We have Homebrew support now for at least the latest release. I guess we still want XCode to build current master, though?

@fluffyfreak
Copy link
Contributor

Well I can build on the command line but I don't know how to package things into an app for distribution with the relevant frameworks. The XCode workspace seems like it should just do all of that for you and create an easily distributable package.

The whole ways OSXs file system works seems bizarre to me so just figuring out what what folder to zip up is confusing. Wilfully obtuse is probably an apt description :(

If we can just get it so there's a simple, repeatable process that I can follow then a few times a month I can fire up the Mac and upload a build. Right now I have 90% of each possible option working.

@haxys
Copy link

haxys commented Oct 30, 2015

I posted a script to automatically build and compile in a different issue thread. I don't have time to seek it at the moment, but it might have been linked to/from this one.

In other news, my wife and I (we got married!) have finally moved into our new home (we bought a house!) in Texas (we moved!), and we have high-speed internet (finally!), so I can participate once again in the development and compilation and distribution of Pioneer.

@fluffyfreak
Copy link
Contributor

@eloquentmess congratulations!!! On the getting married, the house and the high-speed internet :D

I found the scripts in #3401 and will try them out today if I can.

@fluffyfreak
Copy link
Contributor

Ok, I've tried to build and follow the instructions @eloquentmess provided and have produced the following zip for testing pioneer-20151031-osx.zip

@haxys
Copy link

haxys commented Nov 1, 2015

Works just great on my system! Congratulations, we are now equally capable of building and uploading new releases of Pioneer for Mac.

@fluffyfreak
Copy link
Contributor

Closing as superceded by #3540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants