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

Building on OSX 10.10 #16

Closed
dalexandrov opened this issue Oct 27, 2014 · 31 comments · Fixed by #63
Closed

Building on OSX 10.10 #16

dalexandrov opened this issue Oct 27, 2014 · 31 comments · Fixed by #63
Labels
area: buildsystem Related to our cmake/python buildsystem os: macos macOS-specific issue

Comments

@dalexandrov
Copy link

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
Copy link
Member

mic-e commented Oct 27, 2014

This issue seems to be related.

@LeviSchuck
Copy link

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 😅 )

@dalexandrov
Copy link
Author

@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.

@TheJJ TheJJ added os: macos macOS-specific issue bounty and removed bounty labels Oct 27, 2014
@mic-e mic-e added question A question or clarification request about quite anything and removed question A question or clarification request about quite anything labels Oct 27, 2014
@thehydroimpulse
Copy link

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
Copy link
Contributor

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
Copy link

@svkurowski Yep, that worked perfectly. Thanks!

@dalexandrov
Copy link
Author

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
Copy link
Contributor

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

@thehydroimpulse
Copy link

@svkurowski Using the whole command does indeed work.

@dalexandrov
Copy link
Author

@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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

This issue can be closed.

@TheJJ TheJJ closed this as completed Oct 28, 2014
@TheJJ
Copy link
Member

TheJJ commented Oct 28, 2014

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

@TheJJ TheJJ reopened this Oct 28, 2014
@TheJJ TheJJ added the area: buildsystem Related to our cmake/python buildsystem label Oct 29, 2014
@thehydroimpulse
Copy link

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

@martyphee
Copy link

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
Copy link
Author

configure is ok, but then make suffers.

@martyphee
Copy link

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

@dalexandrov
Copy link
Author

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

Are you building with gcc or clang?

@martyphee
Copy link

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
Copy link
Author

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
Copy link
Member

TheJJ commented Oct 30, 2014

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

@dalexandrov
Copy link
Author

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

@martyphee
Copy link

Install fontconfig: brew install fontconfig

On Thu, Oct 30, 2014 at 9:04 AM, Dmitry Alexandrov <[email protected]

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
#16 (comment).

@janisozaur
Copy link
Contributor

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

@dalexandrov
Copy link
Author

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

@dalexandrov
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

or simply

find . -type f -executable -name openage

@svkurowski
Copy link
Contributor

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

@TheJJ TheJJ closed this as completed in #63 Oct 30, 2014
schets added a commit to schets/openage that referenced this issue Nov 12, 2014
See SFTtech#40
Additionally CMake will find Python on OS X now. Fixes SFTtech#16
inakoll added a commit to inakoll/openage that referenced this issue Nov 24, 2014
See SFTtech#40
Additionally CMake will find Python on OS X now. Fixes SFTtech#16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: buildsystem Related to our cmake/python buildsystem os: macos macOS-specific issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants