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

Fix $MACOSX_DEPLOYMENT_TARGET #3337

Merged
merged 4 commits into from
Nov 21, 2018
Merged

Conversation

pcmoritz
Copy link
Contributor

@pcmoritz pcmoritz commented Nov 16, 2018

This should fix the

    error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.x" during configure

error. I made sure it still compiles under 10.14 but haven't been able to test if it fixes above error (since I can't reproduce that error).

Related issue: #3315

@pcmoritz pcmoritz changed the title [WIP] Fix mac os build Fix mac os build Nov 16, 2018
@pcmoritz pcmoritz changed the title Fix mac os build Fix $MACOSX_DEPLOYMENT_TARGET Nov 16, 2018
@pcmoritz
Copy link
Contributor Author

@devin-petersohn @raulchen Can you test if this PR fixes your problem? You might need to start in a clean environment (i.e. no old build files should be present).

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/9388/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/9395/
Test PASSed.

@jovany-wang
Copy link
Contributor

It also could not work in my case.

Copy link
Contributor

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

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

In my case, I add another module which will be built into Ray.
A third-party lib need check the version of system in my adding module.
It will fail reasonably because of the fixed system version.

build.sh Outdated
@@ -106,6 +106,7 @@ pushd "$BUILD_DIR"
make clean || true
rm -rf external/arrow-install

export MACOSX_DEPLOYMENT_TARGET=10.7
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't think setting the TARGET to a fixed number is a good idea.

@raulchen
Copy link
Contributor

With this change, I'm getting the following error:

        Run Build Command:"/usr/local/bin/gmake" "cmTC_4103b/fast"                                                                                                    /usr/local/bin/gmake -f CMakeFiles/cmTC_4103b.dir/build.make CMakeFiles/cmTC_4103b.dir/build
        gmake[1]: Entering directory '/Users/haochen/code/ant_ray/build/CMakeFiles/CMakeTmp'
        Building CXX object CMakeFiles/cmTC_4103b.dir/testCXXCompiler.cxx.o
        /Library/Developer/CommandLineTools/usr/bin/c++    -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7   -o C
MakeFiles/cmTC_4103b.dir/testCXXCompiler.cxx.o -c /Users/haochen/code/ant_ray/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
        warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-
not-found]
        1 warning generated.
        Linking CXX executable cmTC_4103b
        /usr/local/Cellar/cmake/3.11.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4103b.dir/link.txt --verbose=1
        /Library/Developer/CommandLineTools/usr/bin/c++    -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -Wl,-s
earch_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTC_4103b.dir/testCXXCompiler.cxx.o  -o cmTC_4103b
        clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
        ld: library not found for -lstdc++
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        gmake[1]: *** [CMakeFiles/cmTC_4103b.dir/build.make:87: cmTC_4103b] Error 1
        gmake[1]: Leaving directory '/Users/haochen/code/ant_ray/build/CMakeFiles/CMakeTmp'
        gmake: *** [Makefile:126: cmTC_4103b/fast] Error 2

@raulchen
Copy link
Contributor

But if I only remove the set, without adding the export. It works.

@ujvl
Copy link
Contributor

ujvl commented Nov 20, 2018

+1 to @raulchen's comment; removing the set alone works for me on OSX 10.12. Adding the export results in running into linker errors:

Undefined symbols for architecture x86_64:
  "std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::string::_Rep::_S_empty_rep_storage", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::string::assign(char const*, unsigned long)", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
      boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [release/plasma_store_server] Error 1
make[4]: *** [src/plasma/CMakeFiles/plasma_store_server.dir/all] Error 2

@pcmoritz
Copy link
Contributor Author

Yeah I think you are right, I adapted the PR. The set seemed to be necessary when I added the libc++ to fix compilation on 10.14, but I just tested it there and it doesn't seem necessary.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/9495/
Test FAILed.

@pcmoritz
Copy link
Contributor Author

Hmmm, now travis doesn't like it:

-- Check for working CXX compiler: /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- broken
CMake Error at /Users/travis/miniconda/lib/python2.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):
  The C++ compiler
    "/Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++"
  is not able to compile a simple test program.
  It fails with the following output:
    Change Dir: /Users/travis/build/ray-project/ray/build/external/arrow/src/arrow_ep/python/build/temp.macosx-10.6-x86_64-2.7/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_2a718/fast"
    /Applications/Xcode-9.4.1.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_2a718.dir/build.make CMakeFiles/cmTC_2a718.dir/build
    Building CXX object CMakeFiles/cmTC_2a718.dir/testCXXCompiler.cxx.o
    /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    '-stdlib=libc++'  -isysroot /Applications/Xcode-9.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.6   -o CMakeFiles/cmTC_2a718.dir/testCXXCompiler.cxx.o -c /Users/travis/build/ray-project/ray/build/external/arrow/src/arrow_ep/python/build/temp.macosx-10.6-x86_64-2.7/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
    make[4]: *** [CMakeFiles/cmTC_2a718.dir/testCXXCompiler.cxx.o] Error 1
    make[3]: *** [cmTC_2a718/fast] Error 2

I wonder what the right solution here is.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/9506/
Test FAILed.

@robertnishihara robertnishihara merged commit 1a926c9 into ray-project:master Nov 21, 2018
@robertnishihara robertnishihara deleted the macos-build branch November 21, 2018 18:56
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.

6 participants