Building on macOS 10.14

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Building on macOS 10.14

#1 Post by human2 »

I couldn't get FreeOrion to build on macOS 10.14. I'm following the instructions here. https://github.com/freeorion/freeorion/ ... r/BUILD.md

I already had Xcode and Python 3 installed.

This is everything I did.

Code: Select all

brew install cmake
mkdir freeorion-project
cd freeorion-project.
git clone https://github.com/freeorion/freeorion.git
mkdir build
cd build
cmake -G Xcode ../freeorion
I got this error.

Code: Select all

-- Build type CMAKE_BUILD_TYPE set to Release
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:31 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:31 (project):
  No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
This fixed it.

Code: Select all

sudo xcode-select --reset
Then I got this error.

Code: Select all

-- Boost 1.60.0 found.
-- Found Boost components:
   filesystem;iostreams;locale;log;log_setup;serialization;system;thread
CMake Error at /usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_python"
  (requested version 1.75.0) with any of the following names:

    boost_pythonConfig.cmake
    boost_python-config.cmake

  Add the installation prefix of "boost_python" to CMAKE_PREFIX_PATH or set
  "boost_python_DIR" to a directory containing one of the above files.  If
  "boost_python" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake:258 (boost_find_component)
  cmake/FindBoost.cmake:266 (find_package)
  CMakeLists.txt:248 (find_package)

-- Configuring incomplete, errors occurred!
I ran this

Code: Select all

brew install boost-python
When it installed it said this.

Code: Select all

==> Pouring boost-python-1.74.0.mojave.bottle.1.tar.gz
==> Caveats
This formula provides Boost.Python for Python 2. Due to a
collision with boost-python3, the CMake Config files are not
available. Please use -DBoost_NO_BOOST_CMAKE=ON when building
with CMake or switch to Python 3.
So I ran this.

Code: Select all

cmake -G Xcode -DBoost_NO_BOOST_CMAKE=ON ../freeorion
It said this.

Code: Select all

-- Boost version: 1.70.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   system
CMake Error at /usr/local/Cellar/cmake/3.19.7/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find GLEW (missing: GLEW_LIBRARIES) (found version "2.1.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.7/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.19.7/share/cmake/Modules/FindGLEW.cmake:210 (find_package_handle_standard_args)
  GG/CMakeLists.txt:65 (find_package)

-- Configuring incomplete, errors occurred!
So I ran this.

Code: Select all

brew install glew
Building again finally created FreeOrion.xcodeproj. In Xcode I built "ALL_BUILD" and I get these errors.

Code: Select all

Undefined symbols for architecture x86_64:
  "boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)", referenced from:
      boost::filesystem::directory_iterator::directory_iterator(boost::filesystem::path const&, boost::filesystem::directory_options) in FileDlg.o
  "boost::re_detail_107500::raw_storage::insert(unsigned long, unsigned long)", referenced from:
      boost::re_detail_107500::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::insert_state(long, boost::re_detail_107500::syntax_element_type, unsigned long) in TagParser.o
  "boost::re_detail_107500::raw_storage::resize(unsigned long)", referenced from:
      boost::re_detail_107500::raw_storage::extend(unsigned long) in TagParser.o
  "boost::re_detail_107500::get_mem_block()", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack() in TagParser.o
      boost::re_detail_107500::save_state_init::save_state_init(boost::re_detail_107500::saved_state**, boost::re_detail_107500::saved_state**) in TagParser.o
  "boost::re_detail_107500::put_mem_block(void*)", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool) in TagParser.o
      boost::re_detail_107500::save_state_init::~save_state_init() in TagParser.o
  "boost::re_detail_107500::verify_options(unsigned int, boost::regex_constants::_match_flags)", referenced from:
      boost::re_detail_107500::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp() in TagParser.o
  "boost::re_detail_107500::raise_runtime_error(std::runtime_error const&)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in TagParser.o
      void boost::re_detail_107500::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type) in TagParser.o
  "boost::re_detail_107500::get_default_error_string(boost::regex_constants::error_type)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::init() in TagParser.o
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const in TagParser.o
  "boost::re_detail_107500::cpp_regex_traits_char_layer<char>::init()", referenced from:
      boost::re_detail_107500::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail_107500::cpp_regex_traits_base<char> const&) in TagParser.o
  "boost::re_detail_107500::lookup_default_collate_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      boost::re_detail_107500::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in TagParser.o
  "boost::filesystem::directory_entry::get_status(boost::system::error_code*) const", referenced from:
      boost::filesystem::directory_entry::status() const in FileDlg.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The things I searched for didn't help. I'm not exactly sure what's wrong or what to search for. So I'm stuck here.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Building on macOS 10.14

#2 Post by Geoff the Medio »

I think Vezzra would be the best help, but he only seems to check in reliably every week or so due to being rather busy. However, your list of commands doesn't seem to follow the instructions, in particular this bit:
Mac OS X

Create a build directory aside the source_directory and change into this directory. It will contain all compile FreeOrion build artifacs.

Execute cmake to generate a Xcode project file:

Code: Select all

cmake -G Xcode ../freeorion
This might be why it looks, to me, like your build isn't downloading the SDK or using its contents, which is why various dependencies aren't available until you manually install them...

But I'm not really sure what I'm talking about here...

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#3 Post by human2 »

I think it's because I added

Code: Select all

-DBoost_NO_BOOST_CMAKE=ON
to the cmake command. I believe I basically told it to skip boost, so naturally it couldn't find the boost libraries when it tried to compile. When I remove that flag, it complains with this error.

Code: Select all

-- Found PythonInterp: /Users/u0076374/freeorion-project/build/dep/Frameworks/Python.framework/Versions/3.5/bin/python3.5 (found suitable version "3.5.7", minimum required is "3.5")
-- Found PythonLibs: /Users/u0076374/freeorion-project/build/dep/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib (found suitable version "3.5.7", minimum required is "3.5")
-- Boost 1.60.0 found.
-- Found Boost components:
   filesystem;iostreams;locale;log;log_setup;serialization;system;thread
CMake Error at /usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/boost_python-1.75.0/boost_python-config.cmake

  but it set boost_python_FOUND to FALSE so package "boost_python" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_python39-mt.dylib (3.9, Boost_PYTHON_VERSION=3.5)

  * libboost_python39-mt.a (3.9, Boost_PYTHON_VERSION=3.5)

  * libboost_python39.dylib (3.9, Boost_PYTHON_VERSION=3.5)

  * libboost_python39.a (3.9, Boost_PYTHON_VERSION=3.5)

Call Stack (most recent call first):
  /usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake:258 (boost_find_component)
  cmake/FindBoost.cmake:266 (find_package)
  CMakeLists.txt:248 (find_package)


-- Configuring incomplete, errors occurred!
UGH. I just tried a ton of things including removing all of my extra python versions, installing Python 3.5 and building Boost 1.60 from source. I finally found a similar error and suggestion online. Mimicking that fix I changed freeorion/CMakeLists.txt to be like this.

set(MINIMUM_PYTHON_VERSION 3.9)
set(MINIMUM_BOOST_VERSION 1.75.0)

It finally finished running cmake, and now I've got the project in Xcode and it's building. I'll report back when it's done.

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#4 Post by human2 »

It didn't build. I'm using Xcode 11.3.1 on macOS X 10.14. I guess I wait for Vezzra.

If I have time tonight I will probably try to build this for Linux to test the Title_and_Background_Music_Options branch.

These images show the errors when I use MacOSX10.14.sdk.
Screen Shot 2021-03-16 at 11.18.42 AM.png
Screen Shot 2021-03-16 at 11.18.42 AM.png (2.93 MiB) Viewed 6678 times
Screen Shot 2021-03-16 at 11.19.06 AM.png
Screen Shot 2021-03-16 at 11.19.06 AM.png (429.45 KiB) Viewed 6678 times
Screen Shot 2021-03-16 at 11.19.29 AM.png
Screen Shot 2021-03-16 at 11.19.29 AM.png (102.64 KiB) Viewed 6678 times
This image shows the errors when I installed and used MacOSX10.9.sdk.
Screen Shot 2021-03-16 at 11.48.19 AM.png
Screen Shot 2021-03-16 at 11.48.19 AM.png (353.68 KiB) Viewed 6678 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Building on macOS 10.14

#5 Post by Geoff the Medio »

Those errors at the end about shared_mutex appear to be coming from Boost code. I suspect you're using a too-new version of Boost (1.75) for the version of the MacOS SDK that you're using. The FreeOrion CMakeLists.txt has 10.12 as the minimum supported target version, and the errors indicate that the problem is that the code is using features that the MacOS library doesn't support until 10.12.

You either need to use a newer MacOS SDK (version 10.12) or use an order version of Boost, like 1.70, which might help.

The FreeOrion SDK is probably a good starting point for versions of dependencies that all work together. If you update some of the dependencies selectively, particularly Boost, then issues like this will appear.

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#6 Post by human2 »

I tried 10.9, 10.12, and 10.14 SDK's. The boost errors were with the 10.9. I thought I saw 10.9 was the minimum version, so that's why I tried it. Anyway, it makes sense that 10.12 is the minimum version.

The other errors, "Expected function body after function declarator" aren't even in the FO code, it's in a MacOSX framework. I have no idea why that's happening. It is that "__OSX_AVAILABLE_BUT_DEPRECATED_MSG" macro. Those errors happen in 10.12 and 10.14.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Building on macOS 10.14

#7 Post by Geoff the Medio »

human2 wrote: Wed Mar 17, 2021 6:04 amI thought I saw 10.9 was the minimum version, so that's why I tried it. Anyway, it makes sense that 10.12 is the minimum version.
Possibly the version to run the program and the version to build the program are different...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Building on macOS 10.14

#8 Post by Geoff the Medio »

Geoff the Medio wrote: Wed Mar 17, 2021 9:12 am
human2 wrote: Wed Mar 17, 2021 6:04 amI thought I saw 10.9 was the minimum version, so that's why I tried it. Anyway, it makes sense that 10.12 is the minimum version.
Possibly the version to run the program and the version to build the program are different...
Googling the IconsCore.h issue gives various results of similar issues, like https://github.com/fsevents/fsevents/issues/40

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#9 Post by human2 »

I reinstalled Xcode and the Xcode Command Line Tools and still get the errors. I suppose my next step is to try a different computer.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Building on macOS 10.14

#10 Post by Vezzra »

Ok, I have to admit that the issues you ran into baffle me - the FO SDK for macOS is intended to make building FO on Mac a quick and easy thing.

After installing CMake, running the commands you quoted:

Code: Select all

mkdir freeorion-project
cd freeorion-project.
git clone https://github.com/freeorion/freeorion.git
mkdir build
cd build
cmake -G Xcode ../freeorion
...should give you a XCode project that should build FO successfully.

I'm on macOS 10.14 too, so the issue can't be the macOS version. The only things I do/did differently on my system are:
  • I didn't install cmake via brew, but downloaded it directly from the CMake homepage and installed that.
  • I don't build FO in the XCode app, but on the command line:

    Code: Select all

    xcodebuild -project FreeOrion.xcodeproj -target package -configuration Release
I use XCode 11.3 (11C29) on macOS 10.14.6, with the XCode command line tools installed.

I had to replace my old Mac two or three years ago and have been able to rebuild my FO dev environment without issues (IIRC) following the recommended procedure. So I'm a bit lost as to why this isn't working for you. Maybe try to install CMake not via brew and also build it on the command line exactly as quoted above?

If that doesn't work, we need to investigate further.

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#11 Post by human2 »

xcodebuild had the same error. I tried this on a different 10.14 computer and got the same exact error.

Code: Select all

/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h:130:5: error:
      expected function body after function declarator
    __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_5, __MAC_10_13, __IPHONE_NA, __IPHONE_NA,
    ^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Availability.h:291:57: note:
      expanded from macro '__OSX_AVAILABLE_BUT_DEPRECATED_MSG'
                                                        __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
                                                        ^
<scratch space>:10:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_13_MSG
^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:45:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:663:70: error:
      expected function body after function declarator
  SInt16 *                 outLabel)               /* can be NULL */ __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_1, __MAC_10_13, __IPHO...
                                                                     ^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Availability.h:291:57: note:
      expanded from macro '__OSX_AVAILABLE_BUT_DEPRECATED_MSG'
                                                        __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
                                                        ^
<scratch space>:10:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_13_MSG
^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:45:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:899:63: error:
      expected function body after function declarator
  IconRef *      theIconRef)                                  __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_1, __MAC_10_13, __IPHONE_NA, ...
                                                              ^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Availability.h:291:57: note:
      expanded from macro '__OSX_AVAILABLE_BUT_DEPRECATED_MSG'
                                                        __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
                                                        ^
<scratch space>:18:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_13_MSG
^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:45:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:1385:63: error:
      expected function body after function declarator
  IconFamilyHandle *  iconFamily)                             __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_1, __MAC_10_13, __IPHONE_NA, ...
                                                              ^
In file included from /Users/u0076374/freeorion-project/freeorion/client/human/GUIController.mm:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Availability.h:291:57: note:
      expanded from macro '__OSX_AVAILABLE_BUT_DEPRECATED_MSG'
                                                        __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
                                                        ^
This is what I did on the 2nd computer.

Code: Select all

sudo xcode-select --reset
sudo xcodebuild -license
brew install cmake boost-python3 glew
mkdir freeorion-project
cd freeorion-project
git clone https://github.com/freeorion/freeorion.git
#edit CMakeList.txt (see below)
mkdir build
cd build
cmake -G Xcode ../freeorion
xcodebuild -project FreeOrion.xcodeproj -target package -configuration Release
This is what I changed in CMakeList.txt:

Code: Select all

set(MINIMUM_PYTHON_VERSION 3.9)
set(MINIMUM_BOOST_VERSION 1.75.0)
I have a macOS 11 computer I can try this on also.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Building on macOS 10.14

#12 Post by Vezzra »

human2 wrote: Mon Mar 22, 2021 6:08 pmThis is what I did on the 2nd computer.

Code: Select all

sudo xcode-select --reset
sudo xcodebuild -license
I have to admit I don't know what these commands do. IMO they shouldn't be necessary - why do you run them?

Code: Select all

brew install cmake boost-python3 glew
Installing boost-phyton3 and glew should not be necessary (and might even cause issues). Also, as I already mentioned above, instead of installing cmake via brew try downloading and installing cmake directly from cmake.org.
This is what I changed in CMakeList.txt:

Code: Select all

set(MINIMUM_PYTHON_VERSION 3.9)
set(MINIMUM_BOOST_VERSION 1.75.0)
Why these changes? These can very well introduce issues too.

Judging by what you tell me here, it looks like you still deviate from the recommended standard procedure. I strongly advice against that, unless you really know what you're doing (and know how to deal with issues that might turn up because of that). The problem is simply that I/we can't help you much once you do your own thing, because we lack the necessary Mac platform specific know-how. The recommended standard procedure we provide is something patched together I don't dare to touch unless absolutely necessary, because I don't want to break something I might not be able to fix.

(We simply lack sufficiently competent Mac devs. Our Mac playerbase is almost non-existent, meaning the odds of getting a decently competent Mac dev on the FO team are, well, not exactly great. Hence, we have none... ;))

The recommended standard procedure works perfectly fine on my system. I can't reproduce your issues. Which is the reason why you need to try to build FO the exact same way, so if you still encounter issues, we can at least rule out the possibility that these issues are caused by you doing things a bit differently, and then start trying to narrow down what might be different in our setups...

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#13 Post by human2 »

Sorry for taking so long to get back. Basically, I followed the directions and got errors. Each thing I did was to fix an error. There was a long list of errors. The first post of this thread was a journal of what I did. I haven't installed cmake directly from cmake.org yet. I'll try to get around to it. I've been pretty busy lately.
Vezzra wrote: Fri Mar 26, 2021 1:07 pm
human2 wrote: Mon Mar 22, 2021 6:08 pmThis is what I did on the 2nd computer.

Code: Select all

sudo xcode-select --reset
sudo xcodebuild -license
I have to admit I don't know what these commands do. IMO they shouldn't be necessary - why do you run them?
They reset the license agreement and which Xcode to use. It's a common fix for Xcode problems.
Vezzra wrote: Fri Mar 26, 2021 1:07 pm The problem is simply that I/we can't help you much once you do your own thing, because we lack the necessary Mac platform specific know-how. The recommended standard procedure we provide is something patched together I don't dare to touch unless absolutely necessary, because I don't want to break something I might not be able to fix.

(We simply lack sufficiently competent Mac devs. Our Mac playerbase is almost non-existent, meaning the odds of getting a decently competent Mac dev on the FO team are, well, not exactly great. Hence, we have none... ;))
Am I your only Mac playerbase? LOL. I'm really grateful you guys have done this. I'm not a developer, but I've done enough development and Mac hacking in the past that I'm fairly familiar with how everything Mac works. I once debugged the kernel and compiled a custom Mach kernel when it was still open source, so I know a few things. But I was just following instructions and didn't really know exactly what I was doing. About 10 years ago I wrote some small games for iOS but it was pretty unprofitable and so I didn't keep up and now it's all different.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Building on macOS 10.14

#14 Post by Vezzra »

human2 wrote: Sat Apr 03, 2021 3:45 amI haven't installed cmake directly from cmake.org yet. I'll try to get around to it.
Much appreciated. I just want to rule out cmake installed via brew as possible cause for these issues. Please make sure to uninstall the cmake version you installed via brew before installing it directly from cmake.org.
I've been pretty busy lately.
Take your time, there is no hurry. As you can see, I'm pretty busy myself and only get around to FO stuff roughly once per week... (not counting producing the weekly test builds).
Am I your only Mac playerbase?
Maybe not literally, but probably close. At least judging by the download stats for the weekly test builds - it looks like you can count the Mac playerbase on the fingers of one hand. Makes me wonder if providing weekly builds for macOS is really worth the effort... but I've decided to stick to it, so at least as long as I'm with the project, there will be builds for Mac... ;)
I'm not a developer, but I've done enough development and Mac hacking in the past that I'm fairly familiar with how everything Mac works. I once debugged the kernel and compiled a custom Mach kernel when it was still open source, so I know a few things.
Then you're lightyears ahead of me, and probably much more capable to fix this than I am. Mac is my primary platform, but mostly as user, not as developer (when it comes to actual programming, I've probably done far more of that on Windows than Mac).

Hence why I'm mostly lost when it comes to the issues you posted in your OP. From what I can see it looks like when you try to build FO, cmake doesn't find the prebuilt dependencies contained in the SDK. Instead it pulls all kind of other versions it finds on your system, or comes up empty if it doesn't. This is strange, and I have no idea why. My only guess is that for some bizarre reason the brew installed cmake goes haywire, and doesn't look where it is supposed to look... :?

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Building on macOS 10.14

#15 Post by human2 »

I don't actually play that much because the games take hours. But I'll start playing the weekly builds. I had no idea the game was changing as much as it is. I should probably go find the place in the forum to comment about the changes. Some of them I don't understand.

Post Reply