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

Cmake linux mac fixes #9218

Merged
merged 14 commits into from
Nov 25, 2014
Merged

Cmake linux mac fixes #9218

merged 14 commits into from
Nov 25, 2014

Conversation

vovkasm
Copy link
Contributor

@vovkasm vovkasm commented Nov 24, 2014

This should fix 3 issue with my previous path for cmake build system.

  • Compile errors in MacOS X 10.8 (yes too old, but forum post show that exists people that use it)
  • Link with static libraries determined with pkg-config --static --libs not works on almost any Linux distros. So do not try to do it ever. (Someone who needs fully static build on linux, can improve prebuilt libs in external).
  • FindFontconfig.cmake failed to find library on centos, because check FONTCONFIG_INCLUDE_DIRS, but on centos pkg-config returns empty include dirs, because package in standard search location for compiler.

All this fixed now. And tested, but not against current state. Because after commit: Merge pull request #9193 from pipu/v3_flatbuffers build fully broken as folder external not contains source code for flatbuffers (

Vladimir Timofeev and others added 4 commits November 24, 2014 17:23
…ONTCONFIG_INCLUDE_DIRS was empty (on CentOS 6.5 for example)
…tions we should declare feature-check-marco...

Define _DARWIN_C_SOURCE should enable all mac os non standard extensions.
…hat linux distros not supported this option mostly
…en build luasocket, so all types and func properly defined
@ricardoquesada
Copy link
Contributor

how can I help you with the Flatbuffer thing?
Protobuffers were replaced with Flatbuffers.

@ricardoquesada
Copy link
Contributor

[ci rebuild]

2 similar comments
@ricardoquesada
Copy link
Contributor

[ci rebuild]

@minggo
Copy link
Contributor

minggo commented Nov 25, 2014

[ci rebuild]

@minggo
Copy link
Contributor

minggo commented Nov 25, 2014

It seems that linux is still broken.

@zilongshanren
Copy link
Member

@vovkasm
The linker order is not correct for CentOS.

The correct linker order should be glfw3 X11 GL, but now it added the glfw to the end of the linker list.

I have fixed this issue at #9166

I know my fix it not perfect. But now we face the same issue again.

Thanks.

@minggo
Copy link
Contributor

minggo commented Nov 25, 2014

@AndyQue
Will you please fix it based on this PR?

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

Now this should work (still wait CI cluster to complete the buidl).

@AndyQue, thanks! Of course in static linking order is important. And now FindGLWF.cmake returns libraries in right order, because pkg-config returns information in right order.

@ricardoquesada, @minggo After the CI complete, this PR can be merged.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

Seems, that CI cluster is very slow, or something bad with windows node (

@ricardoquesada
Copy link
Contributor

[ci rebuild]

1 similar comment
@zilongshanren
Copy link
Member

[ci rebuild]

@zilongshanren
Copy link
Member

@vovkasm
Hi, Thanks for the patch.
It seems the linux linker error still exists.

Thoughts?

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue
Seems that pkg-config can't find glfw3.pc file to read link deps, in that case work fallback mechanism to find glfw library and that mechanism simple search header and library files and can't work with static linking. (
Problem can be in two places:

  1. cmake version on CI Linux very old and can't set environment variable $ENV{PKG_CONFIG_PATH} (I was testing with cmake 2.8.12 and it seems to work)
  2. /usr/local/lib/pkgconfig/glfw3.pc really wasn't installed.

It will be very helpful if I can see output of this commands executed on build box:

cmake --version
pkg-config --version
ls /usr/local/lib/pkgconfig
pkg-config --static --libs glfw3
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --static --libs glfw3

Also, if last command returns list of libraries, than may be simpler to set PKG_CONFIG_PATH in CI build script before run cmake.

For example output of these commands on my VM with centos-6.5:

[vagrant@localhost build]$ cmake --version
cmake version 2.8.12.2
[vagrant@localhost build]$ pkg-config --version
0.23
[vagrant@localhost build]$ ls /usr/local/lib/pkgconfig
glfw3.pc
[vagrant@localhost build]$ pkg-config --static --libs glfw3
Package glfw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glfw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glfw3' found
[vagrant@localhost build]$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --static --libs glfw3
-L/usr/local/lib -lglfw3 -lrt -lXrandr -lXi -lGL -lm -ldl -lXrender -ldrm -lXdamage -lX11-xcb -lxcb-glx -lxcb-dri2 -lXxf86vm -lXfixes -lXext -lX11 -lpthread -lxcb -lXau

@zilongshanren
Copy link
Member

@vovkasm
Thanks for the quick reply.

The output is as follow:

[root@localhost ~]# cmake --version
cmake version 2.8.8
[root@localhost ~]# pkg-config --version
0.23
[root@localhost ~]# pkg-config --static --libs glfw3
-lglfw -lrt -lXrandr -lXi -lGL -lm -ldl -lXrender -ldrm -lXdamage -lX11-xcb -lxcb-glx -lxcb-dri2 -lXxf86vm -lXfixes -lXext -lX11 -lpthread -lxcb -lXau  
[root@localhost ~]# ls /usr/local/lib/pkgconfig/
glfw3.pc  libglfw.pc  libpcrecpp.pc  libpcre.pc  libpcreposix.pc  yaml-0.1.pc

Is anything wrong here?

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue no, seems okay (But I wonder that pkg-config by default search in /usr/local, on my box this is not true). So bad things happens in another place. I will do some commits in this branch, that show additional debug info and allow to detect source of the problem.

@zilongshanren
Copy link
Member

@vovkasm
Thank you. If you want to know more about the Linux CI, please @me, I will be there all the time.
And I will also check the possible problems.

BTW, I must make the CI server happy today, since we depend on it heavily.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue
Thank you. Seems that windows node again stuck and freeze build process.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue , can you fix windows node, or temporarily exclude it from build? It stuck with errors like "HTTPError: HTTP Error 401: Authorization Required" in pull_request_builder.py
And prevents to get fast responses from CI Cluster.

@zilongshanren
Copy link
Member

@vovkasm
Ok, I will exclude the build.
Sorry, I have just taken supper now.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

Yea! CI show that can't find pkg-config... Bad (
I try to copy FindPkgConfig.cmake from fresh version...

@zilongshanren
Copy link
Member

@vovkasm
Good. I think the problem would be fixed soon.

@zilongshanren
Copy link
Member

@vovkasm
which pkg-config returns usr/bin/pkg-config.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue
This very, very strange... cmake should always search /usr/bin on any unix-like system.
I waiting CI results...

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

[ci rebuild]

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

In any case, then we can run cmake as cmake -DPKG_CONFIG_EXECUTABLE=/usr/bin/pkg-config . for quick fix.

@zilongshanren
Copy link
Member

@vovkasm
If this time, it's still not working, I will try to modify the CI scripts and pass -DPKG_CONFIG_EXECUTABLE=/usr/bin/pkg-config to cmake.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue, you can fist try this by hand. (On you custom checkout on build machine, only cmake, not need to run full build)

@zilongshanren
Copy link
Member

@vovkasm
I will test it and tell you the results. Thanks.

@zilongshanren
Copy link
Member

@vovkasm
Cloning... The speed is very slow. But I have seen the CI server output some debug message.
Hope it works.

@zilongshanren
Copy link
Member

@vovkasm
Success!!!!!!
Finally, thank you very much. 👍

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

It works on CI... (build not finished yet, but config seems more good: -- GLFW3 libs added to 'cocos2d': glfw3;rt;Xrandr;Xi;GL;m;dl;Xrender;drm;Xdamage;X11-xcb;xcb-glx;xcb-dri2;Xxf86vm;Xfixes;Xext;X11;pthread;xcb;Xau)

Seems, that someone make bad things with file /usr/share/cmake/Modules/FindPkgConfig.cmake

I will need to remove all debug info after (if) build success. And than this request can be merged.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue , thank you VERY MACH for help! Without you help, we wouldn't resolve this problem!

@zilongshanren
Copy link
Member

@vovkasm
LOL, you did it, haha.
Thanks.

@zilongshanren
Copy link
Member

@vovkasm
BTW, do you familiar with Jenkins? The slaves freeze and sucks sometimes.
I don't know whether it is related to the internet connection or something else.

@zilongshanren
Copy link
Member

@vovkasm
After your new patch is ready. please ask @ricardoquesada to merge this PR.
Thanks. I will leave office now.
Thanks for your help.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue
Can you enable all disabled functional in CI now?
I just remove debug info, so pull request can be merged now.

do you familiar with Jenkins? The slaves freeze and sucks sometimes.

I don't know jenkins in deep. My first install with slaves was, when I need self build-cluster for building cocos on various systems, because tests all environments by hand after change one line in CMakeLists.txt too long. Now I not finish that setup, has 2 working VMs (fresh ubuntu and centos). One slave (on windows) can run many VMs to build project.
If I will experience any problems as in you CI with stalled builds, then I'll write to you ;-)

@zilongshanren
Copy link
Member

@vovkasm
The CI salve are all enabled. So after the build is passed. I think we could merge this PR.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

@AndyQue
Cool! Thank you!

@zilongshanren
Copy link
Member

@minggo
Please merge this PR. Thanks.

minggo added a commit that referenced this pull request Nov 25, 2014
@minggo minggo merged commit 76824cd into cocos2d:v3 Nov 25, 2014
cocos-travis-mac pushed a commit to cocos-travis-mac/cocos2d-x that referenced this pull request Nov 25, 2014
@ricardoquesada
Copy link
Contributor

I'm trying to compile it in my Ubuntu machine and it can't find GLFW. I'm on Ubuntu 14.10.

any idea? what debug information should I post?
thanks.

@vovkasm
Copy link
Contributor Author

vovkasm commented Nov 25, 2014

Hi @ricardoquesada
Wait for a 15 minutes. I have ubuntu and can test.

@ricardoquesada
Copy link
Contributor

@vovkasm ok. thanks!

@zilongshanren
Copy link
Member

@ricardoquesada
My Ubuntu14.04 is ok. There are so many linux distributions out there...Bad thing for us.

@vovkasm vovkasm deleted the cmake-linux-mac-fixes branch December 13, 2014 17:18
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

5 participants