13 Star 0 Fork 2

ocs-bot/scalapack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
scalapack-2.2-set-CMAKE_POSITION_INDEPENDENT_CODE.patch 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
nilusyi 提交于 2023-05-26 15:21 . OCS package init
diff -up scalapack-2.2.0/scalapack-2.2.0/BLACS/INSTALL/CMakeLists.txt.picfix scalapack-2.2.0/scalapack-2.2.0/BLACS/INSTALL/CMakeLists.txt
--- scalapack-2.2.0/scalapack-2.2.0/BLACS/INSTALL/CMakeLists.txt.picfix 2022-03-19 09:36:24.691840631 -0400
+++ scalapack-2.2.0/scalapack-2.2.0/BLACS/INSTALL/CMakeLists.txt 2022-03-19 09:36:33.501891327 -0400
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8)
project(INSTALL C Fortran)
add_executable(xintface Fintface.f Cintface.c)
+set_property(TARGET xintface PROPERTY POSITION_INDEPENDENT_CODE TRUE)
diff -up scalapack-2.2.0/scalapack-2.2.0/CMakeLists.txt.picfix scalapack-2.2.0/scalapack-2.2.0/CMakeLists.txt
--- scalapack-2.2.0/scalapack-2.2.0/CMakeLists.txt.picfix 2022-03-19 09:36:42.285941877 -0400
+++ scalapack-2.2.0/scalapack-2.2.0/CMakeLists.txt 2022-03-19 09:37:25.964193237 -0400
@@ -110,6 +110,21 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCA
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
# --------------------------------------------------
+# By default static library
+function (invertBoolean varName varValue)
+ if (${varValue})
+ set(${varName} false PARENT_SCOPE)
+ else ()
+ set(${varName} true PARENT_SCOPE)
+ endif ()
+endfunction ()
+option(BUILD_SHARED_LIBS "Build shared libraries" OFF )
+invertBoolean("BUILD_STATIC_LIBS" ${BUILD_SHARED_LIBS})
+if ((${BUILD_SHARED_LIBS} EQUAL ON) AND NOT CMAKE_POSITION_INDEPENDENT_CODE)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif ()
+
+# --------------------------------------------------
# Check for any necessary platform specific compiler flags
include( CheckBLACSCompilerFlags )
CheckBLACSCompilerFlags()
@@ -183,11 +198,6 @@ message(STATUS "LAPACK library: ${LAPACK
MESSAGE(STATUS "=========")
# --------------------------------------------------
-# By default static library
-OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
-OPTION(BUILD_STATIC_LIBS "Build static libraries" ON )
-
-# --------------------------------------------------
# Subdirectories that need to be processed
macro(append_subdir_files variable dirname)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-bot/scalapack.git
[email protected]:ocs-bot/scalapack.git
ocs-bot
scalapack
scalapack
master

搜索帮助