Undefined Symbols when building Blender as Python Module

I’m trying to build Blender as a python module and am running into Undefined Symbol issues on both mac OS 10.13.6 and Ubuntu 18.04. Any help on this would be greatly appreciated. On both systems I’m able to make the full version of blender (i.e. not as a Python module) and I have successfully built older versions of Blender as a python module successfully on both systems. Here’s whats going on:

Ubuntu:
Following the general build instructions from the offical blender wiki:

mkdir ~/blender-git
cd ~/blender-git
git clone https://git.blender.org/blender.git
cd blender
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master
make update
cd ~/blender-git
./blender/build_files/build_environment/install_deps.sh

I then run ‘make bpy’ instead of the usual ‘make’ which should set make options for building as a python module. Blender seems to compile successfully but when I find the bpy.so file and the 2.80 folder this creates, and enter into a python shell, i get the following errors:

mport bpy
Traceback (most recent call last):
File “”, line 1, in
ImportError: /home/skadmin/.virtualenvs/p1env/lib/python3.7/site-packages/2.80/bpy.so: undefined symbol: UI_icons_reload_internal_textures

I have tried installing into my python site packages folder both inside and outside of my virtual environment. The bpy.so file is always in the same directory as the 2.80 file the make bpy creates. I have even adding:

export PYTHONPATH=/path/to/bpy.so:$PYTHONPATH

to my .bashrc, which worked with past versions of blender. Nothing seems to get rid of this undefined symbol import error.

mac OS
I follow similar steps on mac OS:

mkdir ~/blender-build
cd ~/blender-build
git clone http://git.blender.org/blender.git
cd blender
make update
import bpy

I get to just about the last step of the build process and get hit with the following error which also references undefined symbols to UI_icons_reload_internal_textures. The Ubuntu build is much more important to me, but I thought I’d post the mac error because it seems related. Error message is below. Any help with this would be huge. Thanks!

100%] Linking CXX shared module ../../bin/bpy.so
Undefined symbols for architecture x86_64:
  "_UI_icons_reload_internal_textures", referenced from:
      _rna_userdef_theme_update_icons in libbf_rna.a(rna_userdef_gen.c.o)
  "___kmpc_barrier", referenced from:
      _.omp_outlined. in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined..3 in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined. in libbf_intern_smoke.a(FLUID_3D.cpp.o)
      _.omp_outlined. in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..53 in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..55 in libbf_intern_elbeem.a(solver_main.cpp.o)
  "___kmpc_critical", referenced from:
      messageOutputFunc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long) in libbf_intern_elbeem.a(utilities.cpp.o)
      _.omp_outlined. in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..53 in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..55 in libbf_intern_elbeem.a(solver_main.cpp.o)
  "___kmpc_dispatch_init_4", referenced from:
      _.omp_outlined. in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..1 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..2 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..3 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined. in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      _.omp_outlined..6 in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      _.omp_outlined..7 in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      ...
  "___kmpc_dispatch_next_4", referenced from:
      _.omp_outlined. in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..1 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..2 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..3 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined. in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      _.omp_outlined..6 in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      _.omp_outlined..7 in libextern_ceres.a(schur_eliminator_d_d_d.cc.o)
      ...
  "___kmpc_end_critical", referenced from:
      messageOutputFunc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long) in libbf_intern_elbeem.a(utilities.cpp.o)
      _.omp_outlined. in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..53 in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..55 in libbf_intern_elbeem.a(solver_main.cpp.o)
  "___kmpc_end_reduce_nowait", referenced from:
      _.omp_outlined. in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..53 in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..55 in libbf_intern_elbeem.a(solver_main.cpp.o)
  "___kmpc_end_serialized_parallel", referenced from:
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::ApplyIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<unsigned char>(unsigned char const*, int, int, int, unsigned char*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<float>(float const*, int, int, int, float*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::InvertIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _BPH_mass_spring_solve_velocities in libbf_physics.a(implicit_blender.c.o)
  "___kmpc_end_single", referenced from:
      _.omp_outlined. in libbf_intern_smoke.a(FLUID_3D.cpp.o)
  "___kmpc_flush", referenced from:
      _.omp_outlined. in libextern_ceres.a(evaluator.cc.o)
      _.omp_outlined..9 in libextern_ceres.a(evaluator.cc.o)
      _.omp_outlined..10 in libextern_ceres.a(evaluator.cc.o)
      _.omp_outlined..11 in libextern_ceres.a(evaluator.cc.o)
  "___kmpc_for_static_fini", referenced from:
      _.omp_outlined. in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined..3 in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined..4 in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined. in libbf_physics.a(implicit_blender.c.o)
      _.omp_outlined. in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined..3 in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined. in libbf_intern_smoke.a(FLUID_3D.cpp.o)
      ...
  "___kmpc_for_static_init_4", referenced from:
      _.omp_outlined. in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined..3 in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined..4 in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      _.omp_outlined. in libbf_physics.a(implicit_blender.c.o)
      _.omp_outlined. in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined..3 in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined. in libbf_intern_smoke.a(FLUID_3D.cpp.o)
      ...
  "___kmpc_fork_call", referenced from:
      _ccgSubSurf__sync_opensubdiv in libbf_blenkernel.a(CCGSubSurf_opensubdiv.c.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::ApplyIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<unsigned char>(unsigned char const*, int, int, int, unsigned char*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<float>(float const*, int, int, int, float*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::InvertIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _BPH_mass_spring_solve_velocities in libbf_physics.a(implicit_blender.c.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_eigen.a(linear_solver.cc.o)
      ...
  "___kmpc_global_thread_num", referenced from:
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::ApplyIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<unsigned char>(unsigned char const*, int, int, int, unsigned char*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined. in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..1 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<float>(float const*, int, int, int, float*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _.omp_outlined..2 in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::InvertIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      ...
  "___kmpc_push_num_threads", referenced from:
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::ApplyIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<unsigned char>(unsigned char const*, int, int, int, unsigned char*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<float>(float const*, int, int, int, float*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::InvertIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_eigen.a(linear_solver.cc.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WSDLSSolver.cpp.o)
      ...
  "___kmpc_reduce_nowait", referenced from:
      _.omp_outlined. in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..53 in libbf_intern_elbeem.a(solver_main.cpp.o)
      _.omp_outlined..55 in libbf_intern_elbeem.a(solver_main.cpp.o)
  "___kmpc_serialized_parallel", referenced from:
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::ApplyIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<unsigned char>(unsigned char const*, int, int, int, unsigned char*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Apply<float>(float const*, int, int, int, float*) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      void libmv::internal::LookupWarpGrid::Update<libmv::(anonymous namespace)::InvertIntrinsicsFunction>(libmv::CameraIntrinsics const&, int, int, double) in libbf_intern_libmv.a(camera_intrinsics.cc.o)
      _BPH_mass_spring_solve_velocities in libbf_physics.a(implicit_blender.c.o)
  "___kmpc_single", referenced from:
      _.omp_outlined. in libbf_intern_smoke.a(FLUID_3D.cpp.o)
  "_omp_get_max_threads", referenced from:
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_eigen.a(linear_solver.cc.o)
      WTURBULENCE::stepTurbulenceFull(float, float*, float*, float*, unsigned char*) in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      FLUID_3D::step(float, float*) in libbf_intern_smoke.a(FLUID_3D.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WSDLSSolver.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(Scene.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Block<Eigen::Matrix<double, -1, 8, 0, -1, 8> const, -1, 8, false>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, 8, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Block<Eigen::Matrix<double, -1, 8, 0, -1, 8> const, -1, 8, false>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, 8, 1, false> > const&, long, long, bool) in libbf_intern_libmv.a(homography.cc.o)
      ...
  "_omp_get_num_threads", referenced from:
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 0, Eigen::OuterStride<-1> >, Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_eigen.a(linear_solver.cc.o)
      _.omp_outlined. in libbf_intern_eigen.a(linear_solver.cc.o)
      Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>::run(long, long, long, double const*, long, double const*, long, double*, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libbf_intern_eigen.a(linear_solver.cc.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      _.omp_outlined. in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>::run(long, long, long, double const*, long, double const*, long, double*, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, double, double, -1, -1, -1, 1, false> > const&, long, long, bool) in libbf_intern_itasc.a(WSDLSSolver.cpp.o)
      ...
  "_omp_get_thread_num", referenced from:
      _.omp_outlined. in libbf_intern_eigen.a(linear_solver.cc.o)
      Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>::run(long, long, long, double const*, long, double const*, long, double*, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libbf_intern_eigen.a(linear_solver.cc.o)
      _.omp_outlined. in libbf_intern_smoke.a(WTURBULENCE.cpp.o)
      _.omp_outlined. in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>::run(long, long, long, double const*, long, double const*, long, double*, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libbf_intern_itasc.a(WDLSSolver.cpp.o)
      _.omp_outlined. in libbf_intern_itasc.a(WSDLSSolver.cpp.o)
      Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 0, false, 0>::run(long, long, long, double const*, long, double const*, long, double*, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libbf_intern_itasc.a(WSDLSSolver.cpp.o)
      ...
  "_omp_get_wtime", referenced from:
      ceres::internal::WallTimeInSeconds() in libextern_ceres.a(wall_time.cc.o)
      ceres::internal::EventLogger::EventLogger(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextern_ceres.a(wall_time.cc.o)
      ceres::internal::EventLogger::EventLogger(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextern_ceres.a(wall_time.cc.o)
      ceres::internal::EventLogger::~EventLogger() in libextern_ceres.a(wall_time.cc.o)
      ceres::internal::EventLogger::AddEvent(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextern_ceres.a(wall_time.cc.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[3]: *** [bin/bpy.so] Error 1
make[2]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

I am getting exactly the same error. Did you ever find a solution to this problem?

I was able to build blender as a python module successfully on Ubuntu 18.04. I did not try again on Mac.

It’s been a while, but I believe the error was somewhere in the blender source code and should be fixed at this point. You should be able to pull the latest blender version from the git repo and successfully build blender as a python module using the steps in my original post.

Best of luck!

Thanks for the input. I seem to be getting the same error for multiple versions of the code on mac. (I tried building it for Blender 2.8, 2.81and the master branch with code from the git repo.).

I switched to Ubuntu 18.04 now, did you get the import buy to work on Ubuntu?

I was successful with Ubuntu 18.04. I followed the steps in my first post to pull the repo and install the dependencies, and then I built with “make bpy”.

This creates a bpy.so file and 2.XX (whatever version you’re building) directory. Mine was located in:

~/usr/local/PYTHON_SITE_PACKAGES-NOTFOUND

I’m installing to a virtual environment, so I moved that file and directory to the python site packages directory of my virtual environment.

That is what worked for me.