This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Building on Mac OS X / MacPorts

Tags: None
(comma "," separated)
RJVB
Registered Member
Posts
79
Karma
0
OS

Building on Mac OS X / MacPorts

Thu Mar 13, 2014 10:12 pm
I've been spending the last couple of days getting Calligra (git master) to build on OS X 10.6.8 using the KDE and other dependencies installed through MacPorts.

Code: Select all
cmake -DCMAKE_VERBOSE_MAKEFILE:STRING=TRUE -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DPRODUCTSET=osx -DCMAKE_C_COMPILER=/opt/local/bin/clang -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++ -Wno-dev ../calligra


The clang compilers are symlinks to clang-mp-3.3 and clang++-mp-3.3 respectively. I use those to avoid the clang-3.0 compiler provided by Apple, and not g++-mp-4.7 (or 4.8) to avoid conflicts with libc++/libstdc++ on recent versions of OS X. I uninstalled Vc before building to avoid issues with the incomplete AVX support on 10.6, I've had to tweak the CMakeCache to force the use of libiconv in /opt/local/ instead of /usr/lib, the cmake script to find GLEW (so it finds the GLEW dylib in /opt/local/lib) and cmake's internals so that the CMAKE_MODULE_CREATE formulas emit -dynamiclib instead of -bundle. It took about 9 iterations to figure everything out (and at least 19Gb of virtual memory to compile gmic.cpp ...), but most features seem to work in the end.

Note that before adapting the FindCLEW.cmake script I stumbled across an omission in the GLEW-less conditional code in krita/ui/opengl/kis_opengl_canvas2_p.h

Code: Select all
 * This file is effectively a bit of copy-paste from qgl_x11.cpp
 */

// RJVB: add a definition for the GLsync type if GLEW is not available
#ifndef HAVE_GLEW
     typedef void* GLsync;
#endif

#if defined Q_OS_LINUX


So I decided to see if I could get the build to complete with Vc installed. And that got me stuck on the following error:

Code: Select all
/opt/local/bin/clang++   -fno-common -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -Woverloaded-virtual -fno-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -Wno-return-type-c-linkage -O2 -g -DNDEBUG -DQT_NO_DEBUG -dynamiclib -Wl,-headerpad_max_install_names -single_module -multiply_defined suppress   -compatibility_version 14.0.0 -current_version 14.0.0 -o ../../lib/libpigmentcms.14.0.0.dylib -install_name /Volumes/Debian/Users/bertin/work/src/new/calligra-build/lib/libpigmentcms.14.dylib CMakeFiles/pigmentcms.dir/pigmentcms_automoc.cpp.o CMakeFiles/pigmentcms.dir/KoBasicHistogramProducers.cpp.o CMakeFiles/pigmentcms.dir/KoColor.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversionAlphaTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversionCache.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversions.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversionSystem.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversionTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoColorConversionTransformationFactory.cpp.o CMakeFiles/pigmentcms.dir/KoColorModelStandardIds.cpp.o CMakeFiles/pigmentcms.dir/KoColorProfile.cpp.o CMakeFiles/pigmentcms.dir/KoColorSpace.cpp.o CMakeFiles/pigmentcms.dir/KoColorSpaceEngine.cpp.o CMakeFiles/pigmentcms.dir/KoColorSpaceFactory.cpp.o CMakeFiles/pigmentcms.dir/KoColorSpaceMaths.cpp.o CMakeFiles/pigmentcms.dir/KoColorSpaceRegistry.cpp.o CMakeFiles/pigmentcms.dir/KoColorTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoColorTransformationFactory.cpp.o CMakeFiles/pigmentcms.dir/KoColorTransformationFactoryRegistry.cpp.o CMakeFiles/pigmentcms.dir/KoCompositeOp.cpp.o CMakeFiles/pigmentcms.dir/KoCompositeOpRegistry.cpp.o CMakeFiles/pigmentcms.dir/KoCopyColorConversionTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoFallBackColorTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoHistogramProducer.cpp.o CMakeFiles/pigmentcms.dir/KoMultipleColorConversionTransformation.cpp.o CMakeFiles/pigmentcms.dir/KoUniqueNumberForIdServer.cpp.o CMakeFiles/pigmentcms.dir/colorspaces/KoAlphaColorSpace.cpp.o CMakeFiles/pigmentcms.dir/colorspaces/KoLabColorSpace.cpp.o CMakeFiles/pigmentcms.dir/colorspaces/KoRgbU16ColorSpace.cpp.o CMakeFiles/pigmentcms.dir/colorspaces/KoRgbU8ColorSpace.cpp.o CMakeFiles/pigmentcms.dir/colorspaces/KoSimpleColorSpaceEngine.cpp.o CMakeFiles/pigmentcms.dir/compositeops/KoOptimizedCompositeOpFactory.cpp.o CMakeFiles/pigmentcms.dir/compositeops/KoOptimizedCompositeOpFactoryPerArch_Scalar.cpp.o CMakeFiles/pigmentcms.dir/colorprofiles/KoDummyColorProfile.cpp.o CMakeFiles/pigmentcms.dir/resources/KoAbstractGradient.cpp.o CMakeFiles/pigmentcms.dir/resources/KoColorSet.cpp.o CMakeFiles/pigmentcms.dir/resources/KoPattern.cpp.o CMakeFiles/pigmentcms.dir/resources/KoResource.cpp.o CMakeFiles/pigmentcms.dir/resources/KoStopGradient.cpp.o CMakeFiles/pigmentcms.dir/resources/KoSegmentGradient.cpp.o CMakeFiles/pigmentcms.dir/resources/KoCachedGradient.cpp.o KoOptimizedCompositeOpFactoryPerArch_SSE2.cpp.o KoOptimizedCompositeOpFactoryPerArch_SSSE3.cpp.o KoOptimizedCompositeOpFactoryPerArch_SSE4_1.cpp.o ../../lib/libkoplugin.14.0.0.dylib /opt/local/lib/libImath.dylib /opt/local/lib/libIlmImf.dylib /opt/local/lib/libIex.dylib /opt/local/lib/libHalf.dylib /opt/local/lib/libIlmThread.dylib /opt/local/lib/libVc.a /opt/local/lib/libQtGui.dylib /opt/local/lib/libQtXml.dylib /Volumes/Debian/MacPorts/lib/libkdecore.5.12.2.dylib /opt/local/lib/libQtDBus.dylib /opt/local/lib/libQtCore.dylib -framework Carbon
Undefined symbols for architecture x86_64:
  "void KoReportCurrentArch::create<(Vc::Implementation)6>(void*)", referenced from:
      KoReportCurrentArch::ReturnType createOptimizedClass<KoReportCurrentArch>(KoReportCurrentArch::ParamType) in KoOptimizedCompositeOpFactory.cpp.o
  "KoCompositeOp* KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpOver32>::create<(Vc::Implementation)6>(KoColorSpace const*)", referenced from:
      KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpOver32>::ReturnType createOptimizedClass<KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpOver32> >(KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpOver32>::ParamType) in KoOptimizedCompositeOpFactory.cpp.o
  "KoCompositeOp* KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpAlphaDarken32>::create<(Vc::Implementation)6>(KoColorSpace const*)", referenced from:
      KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpAlphaDarken32>::ReturnType createOptimizedClass<KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpAlphaDarken32> >(KoOptimizedCompositeOpFactoryPerArch<KoOptimizedCompositeOpAlphaDarken32>::ParamType) in KoOptimizedCompositeOpFactory.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I checked, even with KoOptimizedCompositeOpFactory.cpp and libpigmentcms.14.dylib compiled/built with g++-4.7 the error is there. I'm not fluent enough in STL to dive into a huge body of code like this and figure out what goes wrong. Can anyone give me some pointers?
For the sake of being exhaustive: I don't recall asking for it, but the PACKAGERS_BUILD got activated in my case. From what I understand this is probably not a bad idea to avoid issues like the one above?

BTW, it'd be useful to mention that dependencies like libetonyek, libodfgen and (apparently also) Vc should not be the latest versions (0.x for the former, 0.6.x for Vc)!
RJVB
Registered Member
Posts
79
Karma
0
OS

Re: Building on Mac OS X / MacPorts

Fri Mar 14, 2014 4:04 pm
Curiously the non-packagers' build just completed without the issue reported above.

I personally usually build with -march=core2 instead of -march=corei7-avx (no difference if you don't use an AVX-aware compiler, except in compatibility) but I guess that most if not all Apple hardware more recent than my mid 2011 MBP will run the binaries I just built.
mkae
Registered Member
Posts
77
Karma
0
OS

Re: Building on Mac OS X / MacPorts

Sat Mar 15, 2014 7:51 pm
Would be great to see Calligra on MacPorts once you've solved this... :-)


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell