Cannot build blender from source on ubuntu 16.04 (Error at CMake Compile) I'm asking the same question at https://blenderartists.org/t/cannot-build-blender-from-source-on-ubuntu-16-04-error-at-cmake-compile/1111985

What I tried to do

I'm trying to build blender for the first time and ran into some errors during compiling. I use ubuntu 16.04.

Following the manual, I've ran:

mkdir /media/allosteric/Data/PF/BlenderBuild
cd /media/allosteric/Data//-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
sudo apt-get update; sudo apt-get install git build-essential
cd ..
./blender/build_files/build_environment/install_deps.sh
cd blender
make


However, this raises errors. Logs are described below. (I ran make clean;make for the second and later runs.)

Logs

Every time the log started with:

Configuring Blender in "/media/allosteric/Data/PF/BlenderBuild/build_linux" ...
-- Could NOT find Spacenav (missing:  SPACENAV_LIBRARY SPACENAV_INCLUDE_DIR) 
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   thread
--   date_time
--   locale
--   system
--   chrono
--   atomic
-- Unsupported CFLAG: -Wrestrict
-- Unsupported CXXFLAG: -Wrestrict
-- Blender Skipping: (bf_alembic;bf_collada;bf_intern_ctr;bf_intern_opencl;bf_intern_utfconv;extern_sdlew)
-- Disabling Cycles tests because tests folder does not exist


after so, the compile halts raising errors with some varieties. The followings are some examples.

[ 42%] Building C object source/blender/blenkernel/CMakeFiles/bf_blenkernel.dir/intern/navmesh_conversion.c.o
[ 42%] Linking C static library ../../../lib/libbf_blenkernel.a
[ 42%] Built target bf_blenkernel
Makefile:160: recipe for target 'all' failed
make[1]: *** [all] Error 2
GNUmakefile:128: recipe for target 'all' failed
make: *** [all] Error 2


or

[ 35%] Building C object source/blender/windowmanager/CMakeFiles/bf_windowmanager.dir/intern/wm_stereo.c.o
[ 35%] Linking C static library ../../../lib/libbf_windowmanager.a
[ 35%] Built target bf_windowmanager
Makefile:160: recipe for target 'all' failed
make[1]: *** [all] Error 2


or

[ 35%] Building C object source/blender/windowmanager/CMakeFiles/bf_windowmanager.dir/intern/wm_stereo.c.o
[ 35%] Linking C static library ../../../lib/libbf_windowmanager.a
[ 35%] Built target bf_windowmanager
Makefile:160: recipe for target 'all' failed
make[1]: *** [all] Error 2
GNUmakefile:128: recipe for target 'all' failed
make: *** [all] Error 2


and others that I haven't kept track of.

About my PC

The OS I currently use is ubuntu 16.04 LTS. However, this is a dual-boot with a Windows 10.

The /media/allosteric/Data/PF/BlenderBuild, which is the directory I'm currently tring to build blender, is a mount of a Data Driver originally for the Windows.

My CPU is an Intel® Core™ i5-4210H CPU @ 2.90GHz × 4, which is 64-bit and GPU is GeForce GTX 950M.
Thanks.
I ran sudo apt install libpng16-dev and sudo apt install libjpeg9-dev and blend was successfully compiled.