Bug 399953 - libatomic breaks compilation in MacOS
Summary: libatomic breaks compilation in MacOS
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources macOS
: NOR critical
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-18 00:58 UTC by amyspark
Modified: 2018-10-21 11:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description amyspark 2018-10-18 00:58:45 UTC
SUMMARY

Krita git master c2ea92c55535f00cf72661680e1ee8fb10116d74 cannot be compiled under MacOS, as libatomic is not available. See e.g. https://github.com/mavlink/mavros/issues/849.

STEPS TO REPRODUCE
1. Upgrade local copy to c2ea92c55535f00cf72661680e1ee8fb10116d74.
2. Issue `cmake .` on the build folder.
3. Open Xcode and try building Krita.

OBSERVED RESULT

Build target kritaimage of project krita with configuration RelWithDebInfo

Ld /Users/amalia/Desktop/krita/build/libs/image/RelWithDebInfo/libkritaimage.18.0.0.dylib normal x86_64
    cd /Users/amalia/Desktop/krita/source
    export MACOSX_DEPLOYMENT_TARGET=10.12
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/Users/amalia/Desktop/krita/build/libs/image/RelWithDebInfo -F/Users/amalia/Desktop/krita/build/libs/image/RelWithDebInfo -F/usr/local/opt/qt5/lib -filelist /Users/amalia/Desktop/krita/build/libs/image/krita.build/RelWithDebInfo/kritaimage.build/Objects-normal/x86_64/kritaimage.18.0.0.LinkFileList -install_name /libkritaimage.18.0.0.dylib -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/widgets/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/psd/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/metadata/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/flake/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/command/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/pigment/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/widgetutils/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/odf/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/store/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/version/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/global/RelWithDebInfo -Xlinker -rpath -Xlinker /Users/amalia/Desktop/krita/build/libs/koplugin/RelWithDebInfo -mmacosx-version-min=10.12 -Xlinker -object_path_lto -Xlinker /Users/amalia/Desktop/krita/build/libs/image/krita.build/RelWithDebInfo/kritaimage.build/Objects-normal/x86_64/kritaimage.18.0.0_lto.o -single_module -multiply_defined suppress -dynamiclib -Wl,-headerpad_max_install_names -install_name @rpath/libkritaimage.18.dylib /Users/amalia/Desktop/krita/build/libs/widgets/RelWithDebInfo/libkritawidgets.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/psd/RelWithDebInfo/libkritapsd.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/metadata/RelWithDebInfo/libkritametadata.18.0.0.dylib /usr/local/lib/libboost_system-mt.dylib -latomic /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib /usr/local/lib/libfftw3.dylib /usr/local/Cellar/vc/1.3.3/lib/libVc.a /usr/local/lib/libgsl.dylib /usr/local/lib/libgslcblas.dylib /Users/amalia/Desktop/krita/build/libs/flake/RelWithDebInfo/libkritaflake.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/command/RelWithDebInfo/libkritacommand.18.0.0.dylib /usr/local/opt/qt5/lib/QtSvg.framework/QtSvg /usr/local/lib/libKF5Completion.5.50.0.dylib /Users/amalia/Desktop/krita/build/libs/pigment/RelWithDebInfo/libkritapigment.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/widgetutils/RelWithDebInfo/libkritawidgetutils.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/odf/RelWithDebInfo/libkritaodf.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/store/RelWithDebInfo/libkritastore.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/version/RelWithDebInfo/libkritaversion.18.0.0.dylib /Users/amalia/Desktop/krita/build/libs/global/RelWithDebInfo/libkritaglobal.18.0.0.dylib /usr/local/opt/qt5/lib/QtConcurrent.framework/QtConcurrent /usr/local/lib/libKF5Archive.5.50.0.dylib /usr/local/opt/qt5/lib/QtPrintSupport.framework/QtPrintSupport /usr/local/lib/libKF5ConfigGui.5.50.0.dylib /usr/local/lib/libKF5GuiAddons.5.50.0.dylib /usr/local/lib/libKF5WidgetsAddons.5.50.0.dylib /usr/local/opt/qt5/lib/QtXml.framework/QtXml /usr/local/lib/libKF5ItemViews.5.50.0.dylib /usr/local/opt/qt5/lib/QtWidgets.framework/QtWidgets /usr/local/opt/qt5/lib/QtGui.framework/QtGui /Users/amalia/Desktop/krita/build/libs/koplugin/RelWithDebInfo/libkritaplugin.18.0.0.dylib /usr/local/lib/libKF5CoreAddons.5.50.0.dylib /usr/local/lib/libKF5ConfigCore.5.50.0.dylib /usr/local/lib/libKF5I18n.5.50.0.dylib /usr/local/opt/qt5/lib/QtCore.framework/QtCore /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib /usr/local/Cellar/vc/1.3.3/lib/libVc.a -single_module -compatibility_version 18.0.0 -current_version 18.0.0 -Xlinker -dependency_info -Xlinker /Users/amalia/Desktop/krita/build/libs/image/krita.build/RelWithDebInfo/kritaimage.build/Objects-normal/x86_64/kritaimage.18.0.0_dependency_info.dat -o /Users/amalia/Desktop/krita/build/libs/image/RelWithDebInfo/libkritaimage.18.0.0.dylib

ld: library not found for -latomic
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Build target krita_shape_text_autogen of project krita with configuration RelWithDebInfo


Build target krita_shape_text of project krita with configuration RelWithDebInfo



Build failed    18/10/18 00:47


EXPECTED RESULT

Krita compiled successfully.


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Comment 1 amyspark 2018-10-18 10:55:43 UTC
Please note that, according to CMake, the proper flag in x64 for detecting atomic support is HAVE_CXX_ATOMICS64_WITHOUT_LIB .
Comment 2 Halla Rempt 2018-10-20 09:32:21 UTC
I've asked the author of that patch to take a look, and I'll revert the patch for now: https://phabricator.kde.org/D16184
Comment 3 Halla Rempt 2018-10-20 09:36:14 UTC
Git commit dbe8be703a18aa858b4739d0b0537f60cac1c629 by Boudewijn Rempt.
Committed on 20/10/2018 at 09:35.
Pushed by rempt into branch 'master'.

Do not link to libatomic on macOS

M  +4    -2    libs/image/CMakeLists.txt

https://commits.kde.org/krita/dbe8be703a18aa858b4739d0b0537f60cac1c629
Comment 4 Halla Rempt 2018-10-21 11:43:01 UTC
I've reverted the patch completely, since it didn't work on freebsd either. Let's see whether the original author can come up with a better patch :-)