Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
74eb3093
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
74eb3093
编写于
8月 11, 2023
作者:
张
张春乔
提交者:
GitHub
8月 11, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cmake] add ginac third_party cache (#56165)
* Update ginac.cmake * Update ginac.cmake * Update ginac.cmake
上级
8cf4b1c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
17 deletion
+53
-17
cmake/cinn/external/ginac.cmake
cmake/cinn/external/ginac.cmake
+53
-17
未找到文件。
cmake/cinn/external/ginac.cmake
浏览文件 @
74eb3093
...
@@ -5,32 +5,68 @@ include(ExternalProject)
...
@@ -5,32 +5,68 @@ include(ExternalProject)
# ginac-1.8.1 https://www.ginac.de/ginac-1.8.1.tar.bz2
# ginac-1.8.1 https://www.ginac.de/ginac-1.8.1.tar.bz2
# all build with CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" --enable-static=yes
# all build with CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" --enable-static=yes
set
(
GINAC_FILE
"ginac-1.8.1_cln-1.3.6_gmp-6.2.1.tar.gz"
CACHE STRING
""
FORCE
)
set
(
GINAC_DOWNLOAD_URL
set
(
GINAC_DOWNLOAD_URL
https://paddle-inference-dist.bj.bcebos.com/CINN/ginac-1.8.1_cln-1.3.6_gmp-6.2.1.tar.gz
"https://paddle-inference-dist.bj.bcebos.com/CINN/
${
GINAC_FILE
}
"
)
)
set
(
GINAC_URL_MD5 ebc3e4b7770dd604777ac3f01bfc8b06
)
set
(
GINAC_MD5 ebc3e4b7770dd604777ac3f01bfc8b06
)
set
(
GINAC_DOWNLOAD_DIR
${
PADDLE_SOURCE_DIR
}
/third_party/ginac
)
set
(
GINAC_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/ginac
)
set
(
GINAC_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/ginac
)
function
(
download_ginac
)
message
(
STATUS
"Downloading
${
GINAC_DOWNLOAD_URL
}
to
${
GINAC_DOWNLOAD_DIR
}
/
${
GINAC_FILE
}
"
)
file
(
DOWNLOAD
${
GINAC_DOWNLOAD_URL
}
${
GINAC_DOWNLOAD_DIR
}
/
${
GINAC_FILE
}
EXPECTED_MD5
${
GINAC_URL_MD5
}
STATUS ERR
)
if
(
ERR EQUAL 0
)
message
(
STATUS
"Download
${
GINAC_FILE
}
success"
)
else
()
message
(
FATAL_ERROR
"Download failed, error:
${
ERR
}
\n
You can try downloading
${
GINAC_FILE
}
again"
)
endif
()
endfunction
()
# Download and check ginac.
if
(
EXISTS
${
GINAC_DOWNLOAD_DIR
}
/
${
GINAC_FILE
}
)
file
(
MD5
${
GINAC_DOWNLOAD_DIR
}
/
${
GINAC_FILE
}
GINAC_MD5
)
if
(
NOT GINAC_MD5 STREQUAL GINAC_URL_MD5
)
# clean build file
file
(
REMOVE_RECURSE
${
GINAC_PREFIX_DIR
}
)
file
(
REMOVE_RECURSE
${
GINAC_INSTALL_DIR
}
)
download_ginac
()
endif
()
else
()
download_ginac
()
endif
()
ExternalProject_Add
(
ExternalProject_Add
(
external_ginac
external_ginac
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
URL
${
GINAC_DOWNLOAD_URL
}
URL
${
GINAC_DOWNLOAD_DIR
}
/
${
GINAC_FILE
}
URL_MD5
${
GINAC_MD5
}
URL_MD5
${
GINAC_URL_MD5
}
PREFIX
${
THIRD_PARTY_PATH
}
/ginac
DOWNLOAD_DIR
${
GINAC_DOWNLOAD_DIR
}
SOURCE_DIR
${
THIRD_PARTY_PATH
}
/install/ginac
PREFIX
${
GINAC_PREFIX_DIR
}
SOURCE_DIR
${
GINAC_INSTALL_DIR
}
CONFIGURE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
BUILD_COMMAND
""
UPDATE_COMMAND
""
UPDATE_COMMAND
""
INSTALL_COMMAND
""
INSTALL_COMMAND
""
BUILD_BYPRODUCTS
${
THIRD_PARTY_PATH
}
/install/ginac
/lib/libginac.a
BUILD_BYPRODUCTS
${
GINAC_INSTALL_DIR
}
/lib/libginac.a
BUILD_BYPRODUCTS
${
THIRD_PARTY_PATH
}
/install/ginac
/lib/libcln.a
BUILD_BYPRODUCTS
${
GINAC_INSTALL_DIR
}
/lib/libcln.a
BUILD_BYPRODUCTS
${
THIRD_PARTY_PATH
}
/install/ginac
/lib/libgmp.a
)
BUILD_BYPRODUCTS
${
GINAC_INSTALL_DIR
}
/lib/libgmp.a
)
add_library
(
ginac STATIC IMPORTED GLOBAL
)
add_library
(
ginac STATIC IMPORTED GLOBAL
)
add_dependencies
(
ginac external_ginac
)
add_dependencies
(
ginac external_ginac
)
set_property
(
set_property
(
TARGET ginac PROPERTY IMPORTED_LOCATION
TARGET ginac PROPERTY IMPORTED_LOCATION
${
GINAC_INSTALL_DIR
}
/lib/libginac.a
)
${
THIRD_PARTY_PATH
}
/install/ginac/lib/libginac.a
)
target_link_libraries
(
ginac INTERFACE
${
GINAC_INSTALL_DIR
}
/lib/libcln.a
target_link_libraries
(
${
GINAC_INSTALL_DIR
}
/lib/libgmp.a
)
ginac INTERFACE
${
THIRD_PARTY_PATH
}
/install/ginac/lib/libcln.a
include_directories
(
${
GINAC_INSTALL_DIR
}
/include
)
${
THIRD_PARTY_PATH
}
/install/ginac/lib/libgmp.a
)
include_directories
(
${
THIRD_PARTY_PATH
}
/install/ginac/include
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录