DigitalSlideArchive / HistomicsTK

A Python toolkit for pathology image analysis algorithms.
https://digitalslidearchive.github.io/HistomicsTK/
Apache License 2.0
389 stars 114 forks source link

build failure on Macos 10.14 #571

Closed renexu closed 1 year ago

renexu commented 5 years ago

I was trying to install histomicsTK as a python lib I am using macos 10.14.2 and xcode 10

pip install -e .

Run Build Command:"/usr/bin/make" "cmTC_f3830/fast"
        /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_f3830.dir/build.make CMakeFiles/cmTC_f3830.dir/build
        Building CXX object CMakeFiles/cmTC_f3830.dir/testCXXCompiler.cxx.o
        /Library/Developer/CommandLineTools/usr/bin/c++    -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.6   -o CMakeFiles/cmTC_f3830.dir/testCXXCompiler.cxx.o -c /Users/renex/Generationse/HistomicsTK/_cmake_test_compile/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_f3830
manthey commented 5 years ago

I think this is an XCode configuration issue. See this note from Apple: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes (and this thread https://forums.developer.apple.com/thread/104296) Are the appropriate command line tools install so that the standard headers available?

renexu commented 5 years ago

I think this is an XCode configuration issue. See this note from Apple: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes (and this thread https://forums.developer.apple.com/thread/104296) Are the appropriate command line tools install so that the standard headers available?

yes, this is caused by new Xcode 10 with stdlibc get removed

As I tried to use libc as CXXFLAGS="-std=c++11"; pip install -e .

another error shows

 /Library/Developer/CommandLineTools/usr/bin/c++  -std=c++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTC_0a64e.dir/testCXXCompiler.cxx.o  -o cmTC_0a64e
        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)

I don't see -lstdc++ in the command line, looks like it is from link.txt, do you know how to remove it? I may also need to change -mmacosx-version-min=10.6 to 10.7 or higher, and I don't know how

manthey commented 5 years ago

@cdeepakroy Since you've built on OSX, do you have any advice?

cdeepakroy commented 5 years ago

@renexu We are using CMake to build all cython code in the toolkit. Can you try this fix? I am on an old Xcode so i couldn't reproduce the error. I will try to update the debug.

cdeepakroy commented 5 years ago

@jcfr Have you encountered this error in other scikit-build scenarios?

renexu commented 5 years ago

@renexu We are using CMake to build all cython code in the toolkit. Can you try this fix? I am on an old Xcode so i couldn't reproduce the error. I will try to update the debug.

no luck, but as my second post, I can add -std=c++11 but it requires minimum deployment target to be 10.9, I don't know how to change that, so I am stuck here.

PaiShoIroh commented 5 years ago

OK! This was totally frustrating and kept me up all night, but it turns out there is a very simple solution to install it.

The main problem is /Library/Developer/CommandLineTools/usr/bin/c++ -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_330a0.dir/testCXXCompiler.cxx.o -o cmTC_330a0 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++

Solution: Download and install 'Command Line Tools (MacOS 10.13) for Xcode 9.4.1' 13June'18 Version ALONG with your current installation.

Once that is done just run pip install -e . again and everything will be as smooth as butter.

AgrawalAman commented 5 years ago

I am still facing the same issue even after installing the command line tools as @Ellusionists mentioned. Can you please help?

cooperlab commented 1 year ago

@manthey install is successful on all my Macs where Xcode command line tools are installed. I suggest we close this.

manthey commented 1 year ago

Will do. I think should eventually build binary wheels for more platforms.