mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.38k stars 1.32k forks source link

Mapbox GL Native on Linux-Build from Source #9614

Closed vans88 closed 7 years ago

vans88 commented 7 years ago

Hello Everyone, I wanna build mapbox-gl-native from source code. But I encountered the following error. I have cloned the code from github and the version is "5.0.2". I will show you the related dependencies as follows:

Related Dependencies:

os: unbutu 14.04.5 kernel: 4.2.0-27-generic mapbox-gl-native 5.0.2 gcc 5.4.0 cmake 3.8.2 node v5.0.0 npm 3.3.6 crul 7.54

All dependencies are meet the requirement "Installing dependencies " in article: https://github.com/mapbox/mapbox-gl-native/blob/master/INSTALL.md

My Error info

vans@ubuntu:~/mapbox-gl-native$ pwd
/home/vans/mapbox-gl-native
vans@ubuntu:~/mapbox-gl-native$ make
mkdir -p build/linux-x86_64/Debug
(cd build/linux-x86_64/Debug && cmake -G Ninja ../../.. \
                -DCMAKE_BUILD_TYPE=Debug \
                -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
                -DWITH_CXX11ABI=OFF \
                -DWITH_COVERAGE= \
                -DWITH_OSMESA= \
                -DWITH_EGL=)
-- Updating submodules...
-- Running 'npm install' for mapbox-gl-js...
-- Downloading: https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt
CMake Error at cmake/NodeJS.cmake:52 (message):
  Unable to download checksum file from
  https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt: NOTFOUND
Call Stack (most recent call first):
  cmake/NodeJS.cmake:267 (download_file)
  cmake/node.cmake:3 (nodejs_init)
  CMakeLists.txt:108 (include)

-- Configuring incomplete, errors occurred! See also "/home/vans/mapbox-gl-native/build/linux-x86_64/Debug/CMakeFiles/CMakeOutput.log". make: *** [build/linux-x86_64/Debug/build.ninja] Error 1

maybe help

At first glance it looks like curl, but at the command line execute curl https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt. The result is successfully and I can obtain the file SHASUM256.txt.

code fragment from NodeJS.cmake

# Download with a bit of nice output (without spewing progress)
 41 function(download_file DESCRIPTION URL FILE)
 42     message(STATUS "Downloading: ${URL}")
 43     file(DOWNLOAD
 44         ${URL}
 45         ${FILE}.tmp
 46         ${ARGN}
 47         STATUS RESULT
 48     )
 49     list(GET RESULT 0 STATUS)
 50     if(STATUS)
 51         list(GET result 1 MESSAGE)
 52         message(FATAL_ERROR "Unable to download ${DESCRIPTION} from ${URL}: ${MESSAGE}")
 53     else()
 54         file(RENAME ${FILE}.tmp ${FILE})
 55     endif()
 56 endfunction()

for help

Anyone can tell me some tips about my error ? Many Thanks!

source code link:

https://github.com/mapbox/mapbox-gl-native

vans88 commented 7 years ago

CMakeOutput.txt For generating Makefile again, I clone the code again. and run command "cmake ." The above error occurred again. Detailed information as follows:

Error info:

cmake .
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Updating submodules...
-- Running 'npm install' for mapbox-gl-native...
@mapbox/mapbox-gl-native@3.4.4 /home/vans/Tools/mapbox-gl-native-5.0.2
├─┬ aws-sdk@2.91.0
│ ├─┬ buffer@4.9.1
│ │ ├── base64-js@1.2.1
│ │ ├── ieee754@1.1.8
│ │ └── isarray@1.0.0
│ ├── crypto-browserify@1.0.9
│ ├── events@1.1.1
│ ├── jmespath@0.15.0
│ ├── querystring@0.2.0
│ ├── sax@1.2.1
│ ├─┬ url@0.10.3
│ │ └── punycode@1.3.2
│ ├── uuid@3.0.1
│ ├── xml2js@0.4.17
│ └── xmlbuilder@4.2.1
├── csscolorparser@1.0.3
├── ejs@2.5.6
├─┬ express@4.15.3
│ ├─┬ accepts@1.3.3
│ │ └── negotiator@0.6.1
│ ├── array-flatten@1.1.1
│ ├── content-disposition@0.5.2
│ ├── content-type@1.0.2
│ ├── cookie@0.3.1
│ ├── cookie-signature@1.0.6
│ ├─┬ debug@2.6.7
│ │ └── ms@2.0.0
│ ├── depd@1.1.0
│ ├── encodeurl@1.0.1
│ ├── escape-html@1.0.3
│ ├── etag@1.8.0
│ ├─┬ finalhandler@1.0.3
│ │ ├── debug@2.6.7
│ │ └── unpipe@1.0.0
│ ├── fresh@0.5.0
│ ├── merge-descriptors@1.0.1
│ ├── methods@1.1.2
│ ├─┬ on-finished@2.3.0
│ │ └── ee-first@1.1.1
│ ├── parseurl@1.3.1
│ ├── path-to-regexp@0.1.7
│ ├─┬ proxy-addr@1.1.5
│ │ ├── forwarded@0.1.0
│ │ └── ipaddr.js@1.4.0
│ ├── qs@6.4.0
│ ├── range-parser@1.2.0
│ ├─┬ send@0.15.3
│ │ ├── debug@2.6.7
│ │ ├── destroy@1.0.4
│ │ ├── http-errors@1.6.1
│ │ └── mime@1.3.4
│ ├── serve-static@1.12.3
│ ├── setprototypeof@1.0.3
│ ├── statuses@1.3.1
│ ├─┬ type-is@1.6.15
│ │ └── media-typer@0.3.0
│ ├── utils-merge@1.0.0
│ └── vary@1.1.1
├── lodash@4.17.4
├── nan@2.6.2
├─┬ node-pre-gyp@0.6.36
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├─┬ nopt@4.0.1
│ │ ├── abbrev@1.1.0
│ │ └─┬ osenv@0.1.4
│ │   ├── os-homedir@1.0.2
│ │   └── os-tmpdir@1.0.2
│ ├─┬ npmlog@4.1.2
│ │ ├─┬ are-we-there-yet@1.1.4
│ │ │ └── delegates@1.0.0
│ │ ├── console-control-strings@1.1.0
│ │ ├─┬ gauge@2.7.4
│ │ │ ├── aproba@1.1.2
│ │ │ ├── has-unicode@2.0.1
│ │ │ ├── object-assign@4.1.1
│ │ │ ├── signal-exit@3.0.2
│ │ │ ├─┬ string-width@1.0.2
│ │ │ │ ├── code-point-at@1.1.0
│ │ │ │ └─┬ is-fullwidth-code-point@1.0.0
│ │ │ │   └── number-is-nan@1.0.1
│ │ │ ├─┬ strip-ansi@3.0.1
│ │ │ │ └── ansi-regex@2.1.1
│ │ │ └── wide-align@1.1.2
│ │ └── set-blocking@2.0.0
│ ├─┬ rc@1.2.1
│ │ ├── deep-extend@0.4.2
│ │ ├── ini@1.3.4
│ │ ├── minimist@1.2.0
│ │ └── strip-json-comments@2.0.1
│ ├── rimraf@2.6.1
│ ├── semver@5.4.1
│ ├─┬ tar@2.2.1
│ │ ├── block-stream@0.0.9
│ │ └─┬ fstream@1.0.11
│ │   └── graceful-fs@4.1.11
│ └─┬ tar-pack@3.4.0
│   ├── debug@2.6.8
│   ├── fstream-ignore@1.0.5
│   ├─┬ once@1.4.0
│   │ └── wrappy@1.0.2
│   ├─┬ readable-stream@2.3.3
│   │ ├── core-util-is@1.0.2
│   │ ├── process-nextick-args@1.0.7
│   │ ├── string_decoder@1.0.3
│   │ └── util-deprecate@1.0.2
│   └── uid-number@0.0.6
├── pixelmatch@4.0.2
├── pngjs@3.2.0
├─┬ request@2.81.0
│ ├── aws-sign2@0.6.0
│ ├── aws4@1.6.0
│ ├── caseless@0.12.0
│ ├─┬ combined-stream@1.0.5
│ │ └── delayed-stream@1.0.0
│ ├── extend@3.0.1
│ ├── forever-agent@0.6.1
│ ├─┬ form-data@2.1.4
│ │ └── asynckit@0.4.0
│ ├─┬ har-validator@4.2.1
│ │ ├─┬ ajv@4.11.8
│ │ │ ├── co@4.6.0
│ │ │ └─┬ json-stable-stringify@1.0.1
│ │ │   └── jsonify@0.0.0
│ │ └── har-schema@1.0.5
│ ├─┬ hawk@3.1.3
│ │ ├── boom@2.10.1
│ │ ├── cryptiles@2.0.5
│ │ ├── hoek@2.16.3
│ │ └── sntp@1.0.9
│ ├─┬ http-signature@1.1.1
│ │ ├── assert-plus@0.2.0
│ │ ├─┬ jsprim@1.4.0
│ │ │ ├── assert-plus@1.0.0
│ │ │ ├── extsprintf@1.0.2
│ │ │ ├── json-schema@0.2.3
│ │ │ └── verror@1.3.6
│ │ └─┬ sshpk@1.13.1
│ │   ├── asn1@0.2.3
│ │   ├── assert-plus@1.0.0
│ │   ├── bcrypt-pbkdf@1.0.1
│ │   ├─┬ dashdash@1.14.1
│ │   │ └── assert-plus@1.0.0
│ │   ├── ecc-jsbn@0.1.1
│ │   ├─┬ getpass@0.1.7
│ │   │ └── assert-plus@1.0.0
│ │   ├── jsbn@0.1.1
│ │   └── tweetnacl@0.14.5
│ ├── is-typedarray@1.0.0
│ ├── isstream@0.1.2
│ ├── json-stringify-safe@5.0.1
│ ├─┬ mime-types@2.1.16
│ │ └── mime-db@1.29.0
│ ├── oauth-sign@0.8.2
│ ├── performance-now@0.2.0
│ ├── safe-buffer@5.1.1
│ ├── stringstream@0.0.5
│ ├─┬ tough-cookie@2.3.2
│ │ └── punycode@1.4.1
│ ├── tunnel-agent@0.6.0
│ └── uuid@3.1.0
└─┬ tape@4.7.0
  ├── deep-equal@1.0.1
  ├── defined@1.0.0
  ├─┬ for-each@0.3.2
  │ └── is-function@1.0.1
  ├── function-bind@1.1.0
  ├─┬ glob@7.1.2
  │ ├── fs.realpath@1.0.0
  │ ├── inflight@1.0.6
  │ ├─┬ minimatch@3.0.4
  │ │ └─┬ brace-expansion@1.1.8
  │ │   ├── balanced-match@1.0.0
  │ │   └── concat-map@0.0.1
  │ └── path-is-absolute@1.0.1
  ├── has@1.0.1
  ├── inherits@2.0.3
  ├── minimist@1.2.0
  ├── object-inspect@1.2.2
  ├─┬ resolve@1.3.3
  │ └── path-parse@1.0.5
  ├── resumer@0.0.0
  ├─┬ string.prototype.trim@1.1.2
  │ ├─┬ define-properties@1.1.2
  │ │ ├── foreach@2.0.5
  │ │ └── object-keys@1.0.11
  │ └─┬ es-abstract@1.7.0
  │   ├─┬ es-to-primitive@1.1.1
  │   │ ├── is-date-object@1.0.1
  │   │ └── is-symbol@1.0.1
  │   ├── is-callable@1.1.3
  │   └── is-regex@1.0.4
  └── through@2.3.8

-- Running 'npm install' for mapbox-gl-js...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/geometry/0.9.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/geometry/0.9.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/variant/1.1.4.tar.gz...
[Mason] Unpacking package to mason_packages/headers/variant/1.1.4...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/unique_resource/cba309e.tar.gz...
[Mason] Unpacking package to mason_packages/headers/unique_resource/cba309e...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/rapidjson/1.1.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/rapidjson/1.1.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/boost/1.62.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/boost/1.62.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/geojsonvt/6.2.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/geojsonvt/6.2.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/supercluster/0.2.0-1.tar.gz...
[Mason] Unpacking package to mason_packages/headers/supercluster/0.2.0-1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/kdbush/0.1.1-1.tar.gz...
[Mason] Unpacking package to mason_packages/headers/kdbush/0.1.1-1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/earcut/0.12.1.tar.gz...
[Mason] Unpacking package to mason_packages/headers/earcut/0.12.1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/protozero/1.4.2.tar.gz...
[Mason] Unpacking package to mason_packages/headers/protozero/1.4.2...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/pixelmatch/0.10.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/pixelmatch/0.10.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/geojson/0.4.0.tar.gz...
[Mason] Unpacking package to mason_packages/headers/geojson/0.4.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/headers/polylabel/1.0.2.tar.gz...
[Mason] Unpacking package to mason_packages/headers/polylabel/1.0.2...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/glfw/2017-02-09-77a8f10.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/glfw/2017-02-09-77a8f10...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/mesa/13.0.4.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/mesa/13.0.4...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/boost_libprogram_options/1.62.0.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/boost_libprogram_options/1.62.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/sqlite/3.14.2.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/sqlite/3.14.2...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/libuv/1.9.1.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/libuv/1.9.1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/nunicode/1.7.1.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/nunicode/1.7.1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/libpng/1.6.25.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/libpng/1.6.25...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/libjpeg-turbo/1.5.0.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/libjpeg-turbo/1.5.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/webp/0.5.1.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/webp/0.5.1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/gtest/1.8.0.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/gtest/1.8.0...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/benchmark/1.0.0-1.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/benchmark/1.0.0-1...
[Mason] Downloading package https://mason-binaries.s3.amazonaws.com/linux-x86_64/icu/58.1-min-size.tar.gz...
[Mason] Unpacking package to mason_packages/linux-x86_64/icu/58.1-min-size...
-- Downloading: https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt
CMake Error at cmake/NodeJS.cmake:52 (message):
  Unable to download checksum file from
  https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt: NOTFOUND
Call Stack (most recent call first):
  cmake/NodeJS.cmake:267 (download_file)
  cmake/node.cmake:3 (nodejs_init)
  CMakeLists.txt:108 (include)

-- Configuring incomplete, errors occurred!
See also "/home/vans/Tools/mapbox-gl-native-5.0.2/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

This log in attachment.

vans88 commented 7 years ago

Why I can obtain the file SHASUM256.txt? Anyone can give some suggestions about the above error? In command line I cat get this file easily. but I don't know which directory to place this file.

curl https://nodejs.org/download/release/v5.0.0/SHASUMS256.txt -o sum.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2480    0  2480    0     0   1521      0 --:--:--  0:00:01 --:--:--  1520
kkaefer commented 7 years ago

Given that you can download the SHASUM file with curl, I suspect that your version of CMake is compiled without SSL support. Please upgrade to a new version of CMake that does have SSL support.

vans88 commented 7 years ago

@kkaefer Thank you very much for your suggestion. I recompile the cmake from scratch and could download the SHASUM file this time. but There is a new error about gtest shown as follows. make.txt

Part of Error info

CMakeFiles/mbgl-test.dir/test/util/number_conversions.test.cpp.o:/home/vans/mapbox-gl-native/build/linux-x86_64/Debug/../../../mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/gtest.h:1382: more undefined references to `testing::internal::EqFailure(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)' follow
CMakeFiles/mbgl-test.dir/test/util/run_loop.test.cpp.o: In function `RunLoop_MultipleRun_Test::TestBody()':
/home/vans/mapbox-gl-native/build/linux-x86_64/Debug/../../../test/util/run_loop.test.cpp:51: undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/mbgl-test.dir/test/util/thread.test.cpp.o: In function `Thread_ExecutesAfter_Test::TestBody()':
/home/vans/mapbox-gl-native/build/linux-x86_64/Debug/../../../test/util/thread.test.cpp:160: undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
/home/vans/mapbox-gl-native/build/linux-x86_64/Debug/../../../test/util/thread.test.cpp:161: undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/mbgl-test.dir/test/util/thread.test.cpp.o: In function `Thread_WorkRequestDeletionWaitsForWorkToComplete_Test::TestBody()':

initial analysis

Why there are so many “undefined reference” Error? more detailed information in make.txt

some deb package with keywords “gtest”

vans@ubuntu:~/mapbox-gl-native$ apt-cache search gtest
autopkgtest - automatic as-installed testing for Debian packages
gtester2xunit - Helper for converting gtester xml output to xunit.
libgtest-dev - Google's framework for writing C++ tests - header files
libxorg-gtest-data - X.Org dummy testing environment for Google Test - data
libxorg-gtest-dev - X.Org dummy testing environment for Google Test - headers
libxorg-gtest-doc - X.org dummy testing environment for Google Test - documentation
autopkgtest-xenlvm - autopkgtest Xen/LVM2 based testbed snapshot system
gnome-desktop-testing - runner for GNOME installed tests
libdist-zilla-plugin-podspellingtests-perl - release tests for POD spelling
lxc-tests - Linux Containers userspace tools (test binaries)
tobrun commented 7 years ago

@vans88, gtest refers to libgtest-dev - Google's framework for writing C++ tests - header files.

tobrun commented 7 years ago

FWIW, I'm not seeing those undefined reference errors on my build. This is my output:


tvn@tvn:~/Mapbox/mapbox-gl-native$ make 
mkdir -p build/linux-x86_64/Debug
(cd build/linux-x86_64/Debug && cmake -G Ninja ../../.. \
    -DCMAKE_BUILD_TYPE=Debug \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
    -DWITH_CXX11ABI=ON \
    -DWITH_COVERAGE= \
    -DWITH_OSMESA= \
    -DWITH_EGL=)
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Updating submodules...
-- Downloading: https://nodejs.org/download/release/v4.8.3/SHASUMS256.txt
-- NodeJS: Using node, version v4.8.3
-- Downloading: https://nodejs.org/download/release/v4.8.3/node-v4.8.3-headers.tar.gz
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tvn/Mapbox/mapbox-gl-native/build/linux-x86_64/Debug
platform/linux/ninja  -j8 -C build/linux-x86_64/Debug mbgl-test
ninja: Entering directory `build/linux-x86_64/Debug'
[30/329] Building C object CMakeFiles/...l-core.dir/src/parsedate/parsedate.c.o
cc1: warning: command line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
[329/329] Linking CXX executable mbgl-test
``
vans88 commented 7 years ago

@tobrun @kkaefer Many Thanks for your tips on my compiling “mapbox-gl-native” from scratch。This morning I have installed libgtest-dev deb package. But I found there is a gtest directory which generated by compiling process in mapbox-gl-native DIR. And the directory structure here(mapbox-gl-native SOURCE dir)is almost the same as the directory structure that is generated after the package libgtest-dev is installed.

gtest directory in mapbox-gl-native

vans@ubuntu:~/mapbox-gl-native$ find . -type d -name gtest
./mason_packages/linux-x86_64/gtest
./mason_packages/linux-x86_64/gtest/1.8.0/include/gtest
./mason_packages/.binaries/linux-x86_64/gtest
vans@ubuntu:~/mapbox-gl-native/mason_packages/linux-x86_64/gtest/1.8.0$ pwd
/home/vans/mapbox-gl-native/mason_packages/linux-x86_64/gtest/1.8.0
vans@ubuntu:~/mapbox-gl-native/mason_packages/linux-x86_64/gtest/1.8.0$ ls -R
.:
include  lib  mason.ini

./include:
gtest

./include/gtest:
gtest-death-test.h  gtest-message.h     gtest-param-test.h.pump  gtest-printers.h  gtest-spi.h        gtest-typed-test.h
gtest.h             gtest-param-test.h  gtest_pred_impl.h        gtest_prod.h      gtest-test-part.h  internal

./include/gtest/internal:
custom                       gtest-linked_ptr.h                 gtest-port-arch.h  gtest-tuple.h.pump
gtest-death-test-internal.h  gtest-param-util-generated.h       gtest-port.h       gtest-type-util.h
gtest-filepath.h             gtest-param-util-generated.h.pump  gtest-string.h     gtest-type-util.h.pump
gtest-internal.h             gtest-param-util.h                 gtest-tuple.h

./include/gtest/internal/custom:
gtest.h  gtest-port.h  gtest-printers.h

./lib:
libgtest.a

libgtest-dev package info

vans@ubuntu:/usr/include/gtest$ dpkg -l | grep libgtest-dev
ii  libgtest-dev                                          1.6.0-1ubuntu6                                      all          Google's framework for writing C++ tests - header files
vans@ubuntu:/usr/include/gtest$ dpkg -L libgtest-dev
/.
/usr
/usr/include
/usr/include/gtest
/usr/include/gtest/gtest-param-test.h.pump
/usr/include/gtest/gtest-printers.h
/usr/include/gtest/gtest_prod.h
/usr/include/gtest/gtest-typed-test.h
/usr/include/gtest/internal
/usr/include/gtest/internal/gtest-port.h
/usr/include/gtest/internal/gtest-tuple.h
/usr/include/gtest/internal/gtest-string.h
/usr/include/gtest/internal/gtest-param-util-generated.h
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 

nex step

even though I add the two following in Makefile。The error in my last comment always exists. and @tobrun which version of your mapbox-gl-native? In my compiling, I use the version is v5.0.2

#For mbgl-test
export CFLAGS="-I/usr/include/gtest  -I/usr/include/gtest/internal"
export CXXFLAGS="-I/usr/include/gtest  -I/usr/include/gtest/internal"

Here I have installed package libgtest-dev. and add build flags in Makefile. I grep the keyword "GetBoolAssertionFailureMessage" and “EqFailure” and detailed info shown as follows

grep with keywords in mapbox-gl-native source DIR

/mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/internal/gtest-internal.h:226:GTEST_API_ std::string GetBoolAssertionFailureMessage(
./mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/internal/gtest-internal.h:1192:    fail(::testing::internal::GetBoolAssertionFailureMessage(\
/mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/gtest.h:1378:  return EqFailure(lhs_expression,
./mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/gtest.h:1649:  return EqFailure(lhs_expression,
./mason_packages/linux-x86_64/gtest/1.8.0/include/gtest/internal/gtest-internal.h:219:GTEST_API_ AssertionResult EqFailure(const char* expected_expression,

in dir generated by libgtest-dev package

vans@ubuntu:/usr/include/gtest$ pwd
/usr/include/gtest
vans@ubuntu:/usr/include/gtest$ grep "EqFailure" . -rn
./gtest.h:1333:  return EqFailure(expected_expression,
./gtest.h:1581:  return EqFailure(expected_expression,
./internal/gtest-internal.h:274:GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
vans@ubuntu:/usr/include/gtest$ grep "GetBoolAssertionFailureMessage" . -rn
./internal/gtest-internal.h:281:GTEST_API_ String GetBoolAssertionFailureMessage(
./internal/gtest-internal.h:1182:    fail(::testing::internal::GetBoolAssertionFailureMessage(\
vans88 commented 7 years ago

@tobrun You just said gtest refer to libgtest-dev。 This situation puzzles me deeply and there is something wrong??? Looking forward to your reply,Thank you!!!

tobrun commented 7 years ago

I can't recall having to download gtest seperatly. I assumed it was one of the dependencies being pulled in by https://github.com/mapbox/mason. I see you mention INSTALL.md but this is the one used for all platforms, have you taken a look at the one specific for Linux here?

re used version, I'm compiling from master.

vans88 commented 7 years ago

Build successfully

@kkaefer @tobrun Many thanks for suggestions. I clone the master branch of mapbox-gl-native, and run make command again. There are no warnning and errors this time. Thanks argin and I think you can close this comment. I also upload my compiling log as an attachment. make.txt

https://github.com/mapbox/mapbox-gl-native

kkaefer commented 7 years ago

Likely, you upgraded your libcxx/libstdcxx between running make the first time and subsequent runs. The first time you run it, the build system determines whether it needs to load C++11-ABI compatible dependencies, and downloads these, so upgrading the library without running make clean leads to incompatible ABIs and thus linker errors.