Stubborn Linker Error? (linear_solver.cc)

I am experiencing difficulties trying to compile Blender on a Linux computer. I am following the instructions listed on:
https://wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu

I tried using both GCC versions 9 and 10, by running the make command as follows:

make CC=gcc-10 CXX=g++-10

I also tried building both the blender-v2.91-release and blender-v2.92-release branches (code pulled from GitHub), although they both fail with the same error:

[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX executable ../../bin/blender
../../lib/libbf_intern_eigen.a(linear_solver.cc.o):linear_solver.cc:function Eigen::internal::sparse_time_dense_product_impl<Eigen::Transpose<Eigen::SparseMatrix<double, 0, int> >, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, 1, true>::run(Eigen::Transpose<Eigen::SparseM
atrix<double, 0, int> > const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1>&, double const&) [clone ._omp_fn.0]: error: undefined reference to 'GOMP_loop_nonmonotonic_dynamic_start'
../../lib/libbf_intern_eigen.a(linear_solver.cc.o):linear_solver.cc:function Eigen::internal::sparse_time_dense_product_impl<Eigen::Transpose<Eigen::SparseMatrix<double, 0, int> >, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, 1, true>::run(Eigen::Transpose<Eigen::SparseMatrix<double, 0, int> > const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1>&, double const&) [clone ._omp_fn.0]: er
ror: undefined reference to 'GOMP_loop_nonmonotonic_dynamic_next'
collect2: error: ld returned 1 exit status
source/creator/CMakeFiles/blender.dir/build.make:537: recipe for target 'bin/blender' failed
make[3]: *** [bin/blender] Error 1
CMakeFiles/Makefile2:8490: recipe for target 'source/creator/CMakeFiles/blender.dir/all' failed
make[2]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make[1]: *** [all] Error 2
GNUmakefile:316: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas on what to do to resolve this situation?

Thank you in advance.

You may want to ask @isolin who had solved the same error

Thanks for your suggestion. I have already tried this solution but unfortunately it had no effect and we are still getting the same error.

I would guess it’s linking to the wrong OpenMP library, one that is not compatible with GCC 10.

With GCC 9 for example this is in my CMakeCache.txt.

//Path to a library.
OpenMP_LIBRARIES:FILEPATH=/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.a

//Path to the gomp library for OpenMP
OpenMP_gomp_LIBRARY:FILEPATH=/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so

Those files come from the libgcc-9-dev package.

I would check what those values are for you and if you have installed the package. Maybe there is something that needs to be fixed in the build instructions or OpenMP library detection.

I did a clean build of Blender 3.2 at Ubuntu 20.04 yesterday. Still using a combination of gcc9 and gcc8. It worked perfectly.