Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
8110bb21
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8110bb21
编写于
9月 06, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(cmake/env): fix a bug about env set in cmake build mode
GitOrigin-RevId: 492eaf428a1ab1f8c671730af139fa12cedae3f7
上级
0a665ea4
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
32 addition
and
40 deletion
+32
-40
CMakeLists.txt
CMakeLists.txt
+12
-0
cmake/aclrt.cmake
cmake/aclrt.cmake
+2
-6
cmake/cndev.cmake
cmake/cndev.cmake
+2
-6
cmake/cnml.cmake
cmake/cnml.cmake
+2
-6
cmake/cnrt.cmake
cmake/cnrt.cmake
+2
-6
cmake/cudnn.cmake
cmake/cudnn.cmake
+4
-8
cmake/tensorrt.cmake
cmake/tensorrt.cmake
+4
-8
scripts/cmake-build/BUILD_README.md
scripts/cmake-build/BUILD_README.md
+4
-0
未找到文件。
CMakeLists.txt
浏览文件 @
8110bb21
...
...
@@ -34,6 +34,18 @@ set_property(CACHE MGE_ARCH PROPERTY STRINGS AUTO
)
set
(
MGE_EXPORT_TARGETS MegEngine-targets
)
if
(
NOT
"$ENV{LD_LIBRARY_PATH}"
STREQUAL
""
)
string
(
REPLACE
":"
";"
ALTER_LD_LIBRARY_PATHS $ENV{LD_LIBRARY_PATH}
)
else
()
set
(
ALTER_LD_LIBRARY_PATHS
""
)
endif
()
if
(
NOT
"$ENV{LIBRARY_PATH}"
STREQUAL
""
)
string
(
REPLACE
":"
";"
ALTER_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
else
()
set
(
ALTER_LIBRARY_PATHS
""
)
endif
()
option
(
MGE_WITH_JIT
"Build MegEngine with JIT."
ON
)
option
(
MGE_WITH_JIT_MLIR
"Build MegEngine with MLIR JIT."
OFF
)
option
(
MGE_WITH_HALIDE
"Build MegEngine with Halide JIT"
OFF
)
...
...
cmake/aclrt.cmake
浏览文件 @
8110bb21
if
(
$ENV{LIBRARY_PATH}
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
find_library
(
ACLRT_LIBRARY
NAMES libascendcl.so
PATHS $
ENV{LD_LIBRARY_PATH
}
"$ENV{ACLRT_HOME}/lib64/stub"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
"$ENV{ACLRT_HOME}/lib64/stub"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES stub
DOC
"ACL library."
)
...
...
cmake/cndev.cmake
浏览文件 @
8110bb21
if
(
$ENV{LIBRARY_PATH}
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
find_library
(
CNDEV_LIBRARY
NAMES libcndev.so
PATHS $
ENV{LD_LIBRARY_PATH
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"CNDEV library."
)
...
...
cmake/cnml.cmake
浏览文件 @
8110bb21
if
(
$ENV{LIBRARY_PATH}
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
find_library
(
CNML_LIBRARY
NAMES libcnml.so
PATHS $
ENV{LD_LIBRARY_PATH
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"CNML library."
)
...
...
cmake/cnrt.cmake
浏览文件 @
8110bb21
if
(
$ENV{LIBRARY_PATH}
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
find_library
(
CNRT_LIBRARY
NAMES libcnrt.so
PATHS $
ENV{LD_LIBRARY_PATH
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
"$ENV{NEUWARE_HOME}/lib64"
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"CNRT library."
)
...
...
cmake/cudnn.cmake
浏览文件 @
8110bb21
...
...
@@ -3,10 +3,6 @@ if(${PkgConfig_FOUND})
pkg_check_modules
(
PC_CUDNN QUIET CUDNN
)
endif
()
if
(
NOT
"$ENV{LIBRARY_PATH}"
STREQUAL
""
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
if
(
"
${
CUDNN_ROOT_DIR
}
"
STREQUAL
""
AND NOT
"$ENV{CUDNN_ROOT_DIR}"
STREQUAL
""
)
set
(
CUDNN_ROOT_DIR $ENV{CUDNN_ROOT_DIR}
)
endif
()
...
...
@@ -14,15 +10,15 @@ endif()
if
(
MGE_CUDA_USE_STATIC AND NOT MGE_WITH_CUDNN_SHARED
)
find_library
(
CUDNN_LIBRARY
NAMES libcudnn_static.a cudnn.lib
PATHS $
ENV{LD_LIBRARY_PATH
}
${
CUDNN_ROOT_DIR
}
${
PC_CUDNN_LIBRARY_DIRS
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
${
CUDNN_ROOT_DIR
}
${
PC_CUDNN_LIBRARY_DIRS
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"CUDNN library."
)
else
()
find_library
(
CUDNN_LIBRARY
NAMES libcudnn.so libcudnn.dylib cudnn64.dll
PATHS $
ENV{LD_LIBRARY_PATH
}
${
CUDNN_ROOT_DIR
}
${
PC_CUDNN_LIBRARY_DIRS
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
${
CUDNN_ROOT_DIR
}
${
PC_CUDNN_LIBRARY_DIRS
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"CUDNN library."
)
endif
()
...
...
cmake/tensorrt.cmake
浏览文件 @
8110bb21
if
(
NOT
"$ENV{LIBRARY_PATH}"
STREQUAL
""
)
string
(
REPLACE
":"
";"
SYSTEM_LIBRARY_PATHS $ENV{LIBRARY_PATH}
)
endif
()
if
(
"
${
TRT_ROOT_DIR
}
"
STREQUAL
""
AND NOT
"$ENV{TRT_ROOT_DIR}"
STREQUAL
""
)
set
(
TRT_ROOT_DIR $ENV{TRT_ROOT_DIR}
)
endif
()
...
...
@@ -9,15 +5,15 @@ endif()
if
(
MGE_CUDA_USE_STATIC
)
find_library
(
TRT_LIBRARY
NAMES libnvinfer_static.a nvinfer.lib
PATHS $
ENV{LD_LIBRARY_PATH
}
${
TRT_ROOT_DIR
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
${
TRT_ROOT_DIR
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"TRT library."
)
else
()
find_library
(
TRT_LIBRARY
NAMES libnvinfer.so libnvinfer.dylib nvinfer.dll
PATHS $
ENV{LD_LIBRARY_PATH
}
${
TRT_ROOT_DIR
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
SYSTEM
_LIBRARY_PATHS
}
PATHS
$
{
ALTER_LD_LIBRARY_PATHS
}
${
TRT_ROOT_DIR
}
${
CMAKE_INSTALL_PREFIX
}
HINTS
${
ALTER
_LIBRARY_PATHS
}
PATH_SUFFIXES lib lib64
DOC
"TRT library."
)
endif
()
...
...
scripts/cmake-build/BUILD_README.md
浏览文件 @
8110bb21
...
...
@@ -75,6 +75,10 @@
2: install gcc/g++, which version >= 6, (gcc/g++ >= 7, if need build training mode)
3: install build-essential git git-lfs gfortran libgfortran-6-dev autoconf gnupg flex bison gperf curl zlib1g-dev gcc-multilib g++-multilib lib32ncurses5-dev libxml2-utils xsltproc unzip libtool librdmacm-dev rdmacm-utils python3-dev python3-numpy texinfo
4: CUDA env(if enable CUDA), version detail refer to README.md
recommend set env about cuda/cudnn/tensorrt as followed:
export CUDA_ROOT_DIR=/path/to/cuda/lib
export CUDNN_ROOT_DIR=/path/to/cudnn/lib
export TRT_ROOT_DIR=/path/to/tensorrt/lib
```
### MacOS host build
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录