@@ -1,8 +1,5 @@ | |||||
## | ## | ||||
## Author: Hank Anderson <hank@statease.com> | ## Author: Hank Anderson <hank@statease.com> | ||||
## Copyright: (c) Stat-Ease, Inc. | |||||
## Created: 12/23/14 | |||||
## Last Modified: 12/23/14 | |||||
## | ## | ||||
cmake_minimum_required(VERSION 2.8.4) | cmake_minimum_required(VERSION 2.8.4) | ||||
@@ -0,0 +1,115 @@ | |||||
## | |||||
## Author: Hank Anderson <hank@statease.com> | |||||
## Description: Ported from portion of OpenBLAS/Makefile.system | |||||
## Sets various variables based on architecture. | |||||
if (${ARCH} STREQUAL "x86" OR ${ARCH} STREQUAL "x86_64") | |||||
if (${ARCH} STREQUAL "x86") | |||||
if (NOT BINARY) | |||||
set(NO_BINARY_MODE 1) | |||||
endif () | |||||
endif () | |||||
if (NOT NO_EXPRECISION) | |||||
if (${Fortran_COMPILER_NAME} MATCHES "gfortran.*") | |||||
# N.B. I'm not sure if CMake differentiates between GCC and LSB -hpa | |||||
if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB") | |||||
set(EXPRECISION 1) | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DEXPRECISION -m128bit-long-double") | |||||
set(FCOMMON_OPT "${FCOMMON_OPT} -m128bit-long-double") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "Clang") | |||||
set(EXPRECISION 1) | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DEXPRECISION") | |||||
set(FCOMMON_OPT "${FCOMMON_OPT} -m128bit-long-double") | |||||
endif () | |||||
endif () | |||||
endif () | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "Intel") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -wd981") | |||||
endif () | |||||
if (USE_OPENMP) | |||||
if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -fopenmp") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "Clang") | |||||
message(WARNING "Clang doesn't support OpenMP yet.") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -fopenmp") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "Intel") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -openmp") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "PGI") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -mp") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "OPEN64") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -mp") | |||||
set(CEXTRALIB "${CEXTRALIB} -lstdc++") | |||||
endif () | |||||
if (${CMAKE_C_COMPILER} STREQUAL "PATHSCALE") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -mp") | |||||
endif () | |||||
endif () | |||||
if (DYNAMIC_ARCH) | |||||
if (${ARCH} STREQUAL "x86") | |||||
set(DYNAMIC_CORE "KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO") | |||||
endif () | |||||
if (${ARCH} STREQUAL "x86_64") | |||||
set(DYNAMIC_CORE "PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO") | |||||
if (NOT NO_AVX) | |||||
set(DYNAMIC_CORE "${DYNAMIC_CORE} SANDYBRIDGE BULLDOZER PILEDRIVER STEAMROLLER") | |||||
endif () | |||||
if (NOT NO_AVX2) | |||||
set(DYNAMIC_CORE "${DYNAMIC_CORE} HASWELL") | |||||
endif () | |||||
endif () | |||||
if (NOT DYNAMIC_CORE) | |||||
unset(DYNAMIC_ARCH) | |||||
endif () | |||||
endif () | |||||
if (${ARCH} STREQUAL "ia64") | |||||
set(NO_BINARY_MODE 1) | |||||
set(BINARY_DEFINED 1) | |||||
if (${Fortran_COMPILER_NAME} MATCHES "gfortran.*") | |||||
if (${CMAKE_C_COMPILER} STREQUAL "GNU") | |||||
# EXPRECISION = 1 | |||||
# CCOMMON_OPT += -DEXPRECISION | |||||
endif | |||||
endif | |||||
endif | |||||
if (${ARCH} STREQUAL "mips64") | |||||
set(NO_BINARY_MODE 1) | |||||
endif | |||||
if (${ARCH} STREQUAL "alpha") | |||||
set(NO_BINARY_MODE 1) | |||||
set(BINARY_DEFINED 1) | |||||
endif () | |||||
if (${ARCH} STREQUAL "arm") | |||||
set(NO_BINARY_MODE 1) | |||||
set(BINARY_DEFINED 1) | |||||
endif () | |||||
if (${ARCH} STREQUAL "arm64") | |||||
set(NO_BINARY_MODE 1) | |||||
set(BINARY_DEFINED 1) | |||||
endif () | |||||
@@ -1,8 +1,5 @@ | |||||
## | ## | ||||
## Author: Hank Anderson <hank@statease.com> | ## Author: Hank Anderson <hank@statease.com> | ||||
## Copyright: (c) Stat-Ease, Inc. | |||||
## Created: 12/29/14 | |||||
## Last Modified: 12/29/14 | |||||
## Description: Ported from the OpenBLAS/c_check perl script. | ## Description: Ported from the OpenBLAS/c_check perl script. | ||||
## This is triggered by prebuild.cmake and runs before any of the code is built. | ## This is triggered by prebuild.cmake and runs before any of the code is built. | ||||
## Creates config.h and Makefile.conf. | ## Creates config.h and Makefile.conf. | ||||
@@ -1,7 +1,5 @@ | |||||
## | ## | ||||
## Author: Hank Anderson <hank@statease.com> | ## Author: Hank Anderson <hank@statease.com> | ||||
## Created: 12/29/14 | |||||
## Last Modified: 12/29/14 | |||||
## Description: Ported from portion of OpenBLAS/Makefile.system | ## Description: Ported from portion of OpenBLAS/Makefile.system | ||||
## Detects the OS and sets appropriate variables. | ## Detects the OS and sets appropriate variables. | ||||
@@ -58,7 +56,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |||||
# Ensure the correct stack alignment on Win32 | # Ensure the correct stack alignment on Win32 | ||||
# http://permalink.gmane.org/gmane.comp.lib.openblas.general/97 | # http://permalink.gmane.org/gmane.comp.lib.openblas.general/97 | ||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") | |||||
if (${ARCH} STREQUAL "x86") | |||||
set(CCOMMON_OPT "${CCOMMON_OPT} -mincoming-stack-boundary=2") | set(CCOMMON_OPT "${CCOMMON_OPT} -mincoming-stack-boundary=2") | ||||
set(FCOMMON_OPT "${FCOMMON_OPT} -mincoming-stack-boundary=2") | set(FCOMMON_OPT "${FCOMMON_OPT} -mincoming-stack-boundary=2") | ||||
endif () | endif () | ||||
@@ -88,7 +86,7 @@ if (QUAD_PRECISION) | |||||
set(NO_EXPRECISION 1) | set(NO_EXPRECISION 1) | ||||
endif () | endif () | ||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") | |||||
if (${ARCH} STREQUAL "x86") | |||||
set(NO_EXPRECISION 1) | set(NO_EXPRECISION 1) | ||||
endif () | endif () | ||||
@@ -1,8 +1,5 @@ | |||||
## | ## | ||||
## Author: Hank Anderson <hank@statease.com> | ## Author: Hank Anderson <hank@statease.com> | ||||
## Copyright: (c) Stat-Ease, Inc. | |||||
## Created: 12/29/14 | |||||
## Last Modified: 12/29/14 | |||||
## Description: Ported from OpenBLAS/Makefile.prebuild | ## Description: Ported from OpenBLAS/Makefile.prebuild | ||||
## This is triggered by system.cmake and runs before any of the code is built. | ## This is triggered by system.cmake and runs before any of the code is built. | ||||
## Creates config.h and Makefile.conf by first running the c_check perl script (which creates those files). | ## Creates config.h and Makefile.conf by first running the c_check perl script (which creates those files). | ||||
@@ -1,8 +1,5 @@ | |||||
## | ## | ||||
## Author: Hank Anderson <hank@statease.com> | ## Author: Hank Anderson <hank@statease.com> | ||||
## Copyright: (c) Stat-Ease, Inc. | |||||
## Created: 12/29/14 | |||||
## Last Modified: 12/29/14 | |||||
## Description: Ported from OpenBLAS/Makefile.system | ## Description: Ported from OpenBLAS/Makefile.system | ||||
## | ## | ||||
@@ -134,3 +131,8 @@ set(OBJCONV "$(CROSS_SUFFIX)objconv") | |||||
# | # | ||||
include("${CMAKE_SOURCE_DIR}/cmake/os.cmake") | include("${CMAKE_SOURCE_DIR}/cmake/os.cmake") | ||||
# | |||||
# Architecture dependent settings | |||||
# | |||||
include("${CMAKE_SOURCE_DIR}/cmake/arch.cmake") | |||||