Skip to content

Building appleseed on Linux with static libraries

LZaw edited this page May 10, 2020 · 7 revisions

This page describes how to build appleseed with static libraries. Since most of the instructions are exactly the same as building it with the shared ones, this page will only highlight the differences. You can find the instructions on how to build appleseed with shared libraries here.

Building appleseed with static libraries is not the recommended way. You should only do it if you know what you are doing. If you just want to develop/build appleseed, please refer to the standard build instructions.

Building appleseed

  • Everything up to the Building appleseed step is exactly the same as with shared libraries.

  • Instead of the shared ones, you need to download the static libraries: https://github.com/appleseedhq/linux-deps/releases/download/v2.1.1/appleseed-deps-static-2.1.1.tgz

  • You don't need the environment variable LD_LIBRARY_PATH, all the others stay the same.

  • The main difference is the cmake command. You need to set a few more library paths (also *.a instead of *.so) by hand and also add quite some additional linking instructions:

    cmake \
      -Wno-dev \
      -DCMAKE_PREFIX_PATH=/usr/include/x86_64-linux-gnu/qt5 \
      -DWITH_DISNEY_MATERIAL=OFF \
      -DWITH_EMBREE=ON \
      -DUSE_SSE42=ON \
      -DUSE_STATIC_BOOST=ON \
      -DBOOST_INCLUDEDIR=$APPLESEED_DEPENDENCIES/include/boost_1_61_0 \
      -DBOOST_LIBRARYDIR=$APPLESEED_DEPENDENCIES/lib/ \
      -DBoost_NO_SYSTEM_PATHS=ON \
      -DBoost_ATOMIC_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_atomic-gcc63-mt-1_61.a \
      -DBoost_CHRONO_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_chrono-gcc63-mt-1_61.a \
      -DBoost_DATE_TIME_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_date_time-gcc63-mt-1_61.a \
      -DBoost_FILESYSTEM_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_filesystem-gcc63-mt-1_61.a \
      -DBoost_PYTHON_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libboost_python-gcc63-mt-1_61.a \
      -DBoost_PYTHON_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_python-gcc63-mt-1_61.a \
      -DBoost_REGEX_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_regex-gcc63-mt-1_61.a \
      -DBoost_SYSTEM_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_system-gcc63-mt-1_61.a \
      -DBoost_THREAD_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_thread-gcc63-mt-1_61.a \
      -DBoost_WAVE_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_wave-gcc63-mt-1_61.a \
      -DBoost_SERIALIZATION_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_serialization-gcc63-mt-1_61.a \
      -DEMBREE_INCLUDE_DIR=$APPLESEED_DEPENDENCIES/include \
      -DEMBREE_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libembree3.a \
      -DIMATH_HALF_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libHalf-2_3_s.a \
      -DIMATH_IEX_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libIex-2_3_s.a \
      -DIMATH_MATH_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libImath-2_3_s.a \
      -DOPENEXR_IMF_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libIlmImf-2_3_s.a \
      -DOPENEXR_THREADS_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libIlmThread-2_3_s.a \
      -DXERCES_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libxerces-c-3.2.a \
      -DLZ4_INCLUDE_DIR=$APPLESEED_DEPENDENCIES/include \
      -DLZ4_LIBRARY=$APPLESEED_DEPENDENCIES/lib/liblz4.a \
      -DOPENIMAGEIO_OIIOTOOL=$APPLESEED_DEPENDENCIES/bin/oiiotool \
      -DOPENIMAGEIO_IDIFF=$APPLESEED_DEPENDENCIES/bin/idiff \
      -DOSL_COMPILER=$APPLESEED_DEPENDENCIES/bin/oslc \
      -DOSL_MAKETX=$APPLESEED_DEPENDENCIES/bin/maketx \
      -DOSL_QUERY_INFO=$APPLESEED_DEPENDENCIES/bin/oslinfo \
      -DAPPLESEED_DENOISER_LINK_EXTRA_LIBRARIES:STRING="-Wl,--exclude-libs,ALL -L${APPLESEED_DEPENDENCIES}/lib -l:libIlmImf-2_3_s.a -l:libIlmThread-2_3_s.a -l:libImath-2_3_s.a -l:libIexMath-2_3_s.a -l:libIex-2_3_s.a -l:libHalf-2_3_s.a -l:libIex-2_3_s.a -l:libz.a" \
      -DAPPLESEED_LINK_EXTRA_LIBRARIES:STRING="-Wl,--exclude-libs,ALL -L${APPLESEED_DEPENDENCIES}/lib -l:libembree3.a -l:libembree_avx2.a -l:libembree_avx.a -l:libembree_sse42.a -l:libsimd.a -l:libmath.a -l:libtasking.a -l:liblexers.a -l:libsys.a -ltbb -l:liboslexec.a -l:libOpenImageIO.a -l:libOpenColorIO.a -l:libyaml-cpp.a -l:libtinyxml.a -l:libtiff.a -l:libjpeg.a -l:libIlmImf-2_3_s.a -l:libIlmThread-2_3_s.a -l:libImath-2_3_s.a -l:libIexMath-2_3_s.a -l:libIex-2_3_s.a -l:libHalf-2_3_s.a -l:libIex-2_3_s.a -l:libpng16.a -l:libLLVMLTO.a -l:libLLVMPasses.a -l:libLLVMObjCARCOpts.a -l:libLLVMSymbolize.a -l:libLLVMDebugInfoPDB.a -l:libLLVMDebugInfoDWARF.a -l:libLLVMTableGen.a -l:libLLVMDlltoolDriver.a -l:libLLVMLineEditor.a -l:libLLVMOrcJIT.a -l:libLLVMCoverage.a -l:libLLVMMIRParser.a -l:libLLVMNVPTXCodeGen.a -l:libLLVMNVPTXDesc.a -l:libLLVMNVPTXInfo.a -l:libLLVMNVPTXAsmPrinter.a -l:libLLVMObjectYAML.a -l:libLLVMLibDriver.a -l:libLLVMOption.a -l:libLLVMX86Disassembler.a -l:libLLVMX86AsmParser.a -l:libLLVMX86CodeGen.a -l:libLLVMGlobalISel.a -l:libLLVMSelectionDAG.a -l:libLLVMAsmPrinter.a -l:libLLVMDebugInfoCodeView.a -l:libLLVMDebugInfoMSF.a -l:libLLVMX86Desc.a -l:libLLVMMCDisassembler.a -l:libLLVMX86Info.a -l:libLLVMX86AsmPrinter.a -l:libLLVMX86Utils.a -l:libLLVMMCJIT.a -l:libLLVMInterpreter.a -l:libLLVMExecutionEngine.a -l:libLLVMRuntimeDyld.a -l:libLLVMCodeGen.a -l:libLLVMTarget.a -l:libLLVMCoroutines.a -l:libLLVMipo.a -l:libLLVMInstrumentation.a -l:libLLVMVectorize.a -l:libLLVMScalarOpts.a -l:libLLVMLinker.a -l:libLLVMIRReader.a -l:libLLVMAsmParser.a -l:libLLVMInstCombine.a -l:libLLVMTransformUtils.a -l:libLLVMBitWriter.a -l:libLLVMAnalysis.a -l:libLLVMProfileData.a -l:libLLVMObject.a -l:libLLVMMCParser.a -l:libLLVMMC.a -l:libLLVMBitReader.a -l:libLLVMCore.a -l:libLLVMBinaryFormat.a -l:libLLVMSupport.a -l:libLLVMDemangle.a -l:libz.a" \
      ..
    
  • As with the shared libraries, you need to make use of -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 if you are using a different compiler version than the Red Hat Developer Toolset 6 gcc.

  • Also, you may need to specify a different -DCMAKE_PREFIX_PATH, depending on the location of Qt on your system.

  • The rest of the pipeline stays the same.

Clone this wiki locally