mac osx 准备 nanogui 记录

 

 

!!版权声明:本文为博主原创文章,版权归原文作者和博客园共有,谢绝任何形式的 转载!!

作者:mohist

 

 

 

mac osx : 10.14.6 Mojave.  

  之前没有配置openGL相关开发环境,自己自行下载 nanogui 的源码后, 打开cmake尝试编译并生成  nanogui 的example, 但是失败了 cmake提示如下: 

mac osx 准备 nanogui 记录

 

 提示原文: 

CMake Error at CMakeLists.txt:15 (message):
  The NanoGUI dependency repositories (GLFW, etc.) are missing! You probably
  did not clone the project with --recursive.  It is possible to recover by
  calling "git submodule update --init --recursive"

  很困扰。 不知道怎么破。 

  尝试在 Issue 中找到了答案。   点我    查看具体详情

----------> 核心代码 如下  <-----------

$ mkdir nanogui-test
$ cd nanogui-test
$ git init
$ git submodule add https://github.com/wjakob/nanogui.git lib/nanogui
$ git submodule update --init --recursive

  

  于是,自己打开终端,尝试执行上面的核心代码。 成功了。   上面的命令,我排序得到: 

A、$ mkdir nanogui-test
B、$ cd nanogui-test
C、$ git init
D、$ git submodule add https://github.com/wjakob/nanogui.git lib/nanogui
E、$ git submodule update --init --recursive

  

   当我执行到  指令D 时, 提示失败了。 

mac osx 准备 nanogui 记录

 

 

  于是自己再次执行出错的指令D。又成功了。 

mac osx 准备 nanogui 记录

 

 mac osx 准备 nanogui 记录

 

 

  指令D 成功后, 会修改 指令 A 创建的文件夹 。 再次来到 下载的文件,发现源码文件夹下的 ext 文件夹 已经 下载好了代码。 这与主动下载GitHub的nanogui源码是不一样, github源码的ext文件夹下是没有源码文件的。 

mac osx 准备 nanogui 记录

 

再看文件夹

mac osx 准备 nanogui 记录

 

 

   于是, 自己便打开了  nanogui  的文档,按照给出的教程,成功 生成了 nano对应的example。  查看编译指令,

# enter the top-level NanoGUI directory
$ cd nanogui

# make a build directory and enter that
$ mkdir build
$ cd build

# generate your Makefile
$ cmake ..

# now that you have a Makefile, use that to build
$ make -j 4

    这里, 截取 中间输出的部分结果: 

-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success





...... 省略.......


/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:1631:21: note: 
      'glClear' has been explicitly marked deprecated here
GLAPI void APIENTRY glClear (GLbitfield mask) OPENGL_DEPRECATED(10.5, 10.14);
                    ^
9 warnings generated.
[ 97%] Linking CXX executable example2
[ 97%] Built target example2
42 warnings generated.
[ 98%] Linking CXX executable example1
14 warnings generated.
[100%] Linking CXX executable example3
[100%] Built target example3
[100%] Built target example1
[100%] Built target nanogui-python

  mac osx 准备 nanogui 记录

 

   查看文件夹输出: 

  mac osx 准备 nanogui 记录

 

  于是, 自己尝试运行 生成的 结果, 发现与 nanogui 在 GitHub 上的 示例截图了;

mac osx 准备 nanogui 记录

 

-------完------

附:本次使用的源码下载地址: https://github.com/mohistH/nanogui_lib/releases/tag/1.0

 

原文链接: https://www.cnblogs.com/pandamohist/p/13345500.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    mac osx 准备 nanogui 记录

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/368805

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月2日 下午6:37
下一篇 2023年3月2日 下午6:37

相关推荐