SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.63k stars 1.11k forks source link

Building on OSX 10.10 #16

Closed dalexandrov closed 9 years ago

dalexandrov commented 9 years ago

Just tried to build on Mac OS X 10.10 and always getting this:

CMake Error at /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message): Could NOT find PythonLibs: Found unsuitable version "2.7.6", but required is at least "3.3" (found /usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4.dylib) Call Stack (most recent call first): /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:341 (_FPHSA_FAILURE_MESSAGE) /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPythonLibs.cmake:276 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cpp/CMakeLists.txt:74 (find_package)

The cmake from brew (3.0.2) didn't work. I've installed 3.0.0 from https://raw.githubusercontent.com/NikolausDemmel/homebrew-devel/master/cmake.rb (with some sha1 manipulation), still no results.

Will be thankful for any support, and will be glad to help with Mac testings.

mic-e commented 9 years ago

This issue seems to be related.

LeviSchuck commented 9 years ago

I upgraded to 10.10 with brew and had problems with python. I removed brew and reinstalled it, as well as packages I regularly use.

Perhaps you can try that. (I have not tried to build this yet, as I only started watching yesterday :sweat_smile: )

dalexandrov commented 9 years ago

@kloplop321 I've reinstalled brew yesterday. Did not help.

@mic-e I've tried to find fix in the issue specified, still the same stuff.

thehydroimpulse commented 9 years ago

Same issue for me. Tried a bunch of workarounds, trying to overwrite which version of python cmake uses with -DPYTHON_EXECUTABLE with no luck.

svkurowski commented 9 years ago

Install python3 via homebrew and then pass the following to the configure script. You may need to change the python version.

  --raw-cmake-args \
  -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/include/python3.4m/ \
  -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4.dylib \
  -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework

This is the whole command I use to configure right now. Compilation will fail due to this llvm bug. @fr3akout is working on that after we discussed it in the irc channel.

thehydroimpulse commented 9 years ago

@svkurowski Yep, that worked perfectly. Thanks!

dalexandrov commented 9 years ago

The only thing left:

openage v2.2-285-gf7268cc

  compiler | GNU 4.9.1
  cxxflags | -O2 -Wall -Wextra -pedantic -std=c++11

install prefix | /usr/local build dir | /Users/mitia/openage/openage/.bin/gcc-release-O2

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: OPUSFILE_INCLUDE_DIR used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp OPUSFILE_LIB linked by target "openage" in directory /Users/mitia/openage/openage/cpp SDL2IMAGE_INCLUDE_DIRS used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp SDL2IMAGE_LIBRARIES linked by target "openage" in directory /Users/mitia/openage/openage/cpp

Whats wrong?

Thank you!

svkurowski commented 9 years ago

Did you install opus,opusfile,sdl2andsdl2_image` using Homebrew? If so, did you use the whole command I posted above?

thehydroimpulse commented 9 years ago

@svkurowski Using the whole command does indeed work.

dalexandrov commented 9 years ago

@svkurowski yep, installed, still got:

OPUSFILE_INCLUDE_DIR used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp SDL2IMAGE_INCLUDE_DIRS used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp used as include directory in directory /Users/mitia/openage/openage/cpp

svkurowski commented 9 years ago

Well, the corresponding lines in my command are:

-DOPUSFILE_INCLUDE_DIR=/usr/local/Cellar/opusfile/0.6/include/ \
-DSDL2IMAGE_INCLUDE_DIRS=/usr/local/Cellar/sdl2_image/2.0.0_1/include/

Could you do

ls /usr/local/Cellar/opusfile/0.6/include/
ls /usr/local/Cellar/sdl2_image/2.0.0_1/include/

and check if the header files are there?

dalexandrov commented 9 years ago

Ok, fixed. Configure now works, but the make fails. In my case: /usr/local/Cellar/opusfile/0.6/include/opusfile.h:110:11: fatal error: 'opus_multistream.h' file not found

svkurowski commented 9 years ago

~~Yeah I had that too, that is an upstream bug in homebrews' opus/opus_file in my opinion. I will investigate upon it and maybe post an issue to the homebrew repo. Setup the following symlinks to fix it for now: [..]~~

This got fixed in this pullrequest. The Python problem persists and will be discussed in #40 .

svkurowski commented 9 years ago

This issue can be closed.

TheJJ commented 9 years ago

hm actually i'd leave this open until the mac build really succeeds for all mac users that still have problems.

thehydroimpulse commented 9 years ago

You might have to add the -lstdc++ ldflag for it to build python in correctly.

martyphee commented 9 years ago

This worked for me on 10.9.4.

./configure \
  --flags="-stdlib=libc++  -I/usr/local/Cellar/fontconfig/2.11.1/include/ -I/usr/local/include/SDL2 -I/usr/local/Cellar/opus/1.1/include/opus -I/usr/local/Cellar/opusfile/0.6/include/opus -I/usr/local/Cellar/opus/1.1/include/opus" \
  --ldflags="-stdlib=libc++ -lSDL2_Image -lSDL2main" \
  --raw-cmake-args \
  -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.2/Frameworks/Python.framework/Versions/3.4/include/python3.4m/ \
  -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.4.2/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4.dylib \
  -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.4.2/Frameworks/Python.framework \
  -DSDL2IMAGE_INCLUDE_DIRS=/usr/local/Cellar/sdl2_image/2.0.0_1/include \
  -DSDL2IMAGE_LIBRARIES=/usr/local/Cellar/sdl2_image/2.0.0_1/lib/libSDL2_image-2.0.0.dylib
dalexandrov commented 9 years ago

configure is ok, but then make suffers.

martyphee commented 9 years ago

So was mine until I did configure like above. Had a number of linking issues because it wasn't finding libraries.

dalexandrov commented 9 years ago

gcc: error: unrecognized command line option '-stdlib=libc++'

Are you building with gcc or clang?

martyphee commented 9 years ago

Looks like clang. I'm very rusty with my C/C++ and build tools. Too much java/python....

openage v2.2-357-ge850274

      compiler | Clang 6.0.0.6000051
      cxxflags | -stdlib=libc++ -I/usr/local/Cellar/fontconfig/2.11.1/include/ -I/usr/local/include/SDL2 -I/usr/local/Cellar/opus/1.1/include/opus -I/usr/local/Cellar/opusfile/0.6/include/opus -I/usr/local/Cellar/opus/1.1/include/opus -Wall -Wextra -pedantic -std=c++11
install prefix | /usr/local
     build dir | /Users/martinphee/develop/openage/.bin/gcc-release-stdlib=libc++-I-usr-local-Cellar-fontconfig-2-11-1-include-I-usr-local-include-SDL2-I-usr-local-Cellar-opus-1-1-include-opus-I-usr-local-Cellar-opusfile-0-6-include-opus-I-usr-local-Cellar-opus-1-1-include-opus
dalexandrov commented 9 years ago

switched to clang: /Users/mitia/openage/openage/cpp/texture.h:5:10: fatal error: 'GL/gl.h' file not found

include <GL/gl.h>

TheJJ commented 9 years ago

This should have been fixed in 1de94e49f72cd6c118cc279d88a229a2f091ba03, make sure you are using the latest version.

dalexandrov commented 9 years ago

nice but.. openage/cpp/font.cpp:3:10: fatal error: 'fontconfig/fontconfig.h' file not found

include <fontconfig/fontconfig.h>

martyphee commented 9 years ago

Install fontconfig: brew install fontconfig

On Thu, Oct 30, 2014 at 9:04 AM, Dmitry Alexandrov <notifications@github.com

wrote:

nice but.. openage/cpp/font.cpp:3:10: fatal error: 'fontconfig/fontconfig.h' file not found

include

— Reply to this email directly or view it on GitHub https://github.com/SFTtech/openage/issues/16#issuecomment-61096140.

janisozaur commented 9 years ago

errors like missing libstdc++ usually mean you're trying to use C compiler (gcc, clang) instead of C++ compiler (g++, clang++)

dalexandrov commented 9 years ago

OK! Build completed. Now.. any chance to run it? ..openage/bin/cpp/openage is this the correct path?

dalexandrov commented 9 years ago

Just for info, my config was kind of this:

 ./configure   --flags="-stdlib=libc++  -I/usr/local/Cellar/fontconfig/2.11.1/include/ -I/usr/local/include/SDL2 -I/usr/local/Cellar/opus/1.1/include/opus -I/usr/local/Cellar/opusfile/0.6/include/opus -I/usr/local/Cellar/opus/1.1/include/opus"   --ldflags="-stdlib=libc++ -lSDL2_Image -lSDL2main"   --raw-cmake-args   -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4.2/include/python3.4/   -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4m.dylib   -DPython_FRAMEWORKS=/usr/local/Cellar/python3/3.4.2/Frameworks/Python.framework   -DSDL2IMAGE_INCLUDE_DIRS=/usr/local/Cellar/sdl2_image/2.0.0_1/include   -DSDL2IMAGE_LIBRARIES=/usr/local/Cellar/sdl2_image/2.0.0_1/lib/libSDL2_image-2.0.0.dylib
janisozaur commented 9 years ago

from your configure script output:

build dir | /Users/martinphee/develop/openage/.bin/gcc-release-stdlib=libc++-I-usr-local-Cellar-fontconfig-2-11-1-include-I-usr-local-include-SDL2-I-usr-local-Cellar-opus-1-1-include-opus-I-usr-local-Cellar-opusfile-0-6-include-opus-I-usr-local-Cellar-opus-1-1-include-opus

I would look in there

janisozaur commented 9 years ago

or simply

find . -type f -executable -name openage
svkurowski commented 9 years ago

You run it by executing make run. Make sure to convert the media files first though. See the building documentation.