-##\r
-## Author: Hank Anderson <hank@statease.com>\r
-## Description: Ported from portion of OpenBLAS/Makefile.system\r
-## Sets various variables based on architecture.\r
-\r
-if (${ARCH} STREQUAL "x86" OR ${ARCH} STREQUAL "x86_64")\r
-\r
- if (${ARCH} STREQUAL "x86")\r
- if (NOT BINARY)\r
- set(NO_BINARY_MODE 1)\r
- endif ()\r
- endif ()\r
-\r
- if (NOT NO_EXPRECISION)\r
- if (${F_COMPILER} MATCHES "GFORTRAN")\r
- # N.B. I'm not sure if CMake differentiates between GCC and LSB -hpa\r
- if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB")\r
- set(EXPRECISION 1)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DEXPRECISION -m128bit-long-double")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m128bit-long-double")\r
- endif ()\r
- if (${CMAKE_C_COMPILER} STREQUAL "Clang")\r
- set(EXPRECISION 1)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DEXPRECISION")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m128bit-long-double")\r
- endif ()\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "Intel")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -wd981")\r
-endif ()\r
-\r
-if (USE_OPENMP)\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -fopenmp")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "Clang")\r
- message(WARNING "Clang doesn't support OpenMP yet.")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -fopenmp")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "Intel")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -openmp")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "PGI")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mp")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "OPEN64")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mp")\r
- set(CEXTRALIB "${CEXTRALIB} -lstdc++")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER} STREQUAL "PATHSCALE")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mp")\r
- endif ()\r
-endif ()\r
-\r
-\r
-if (DYNAMIC_ARCH)\r
- if (${ARCH} STREQUAL "x86")\r
- set(DYNAMIC_CORE "KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO")\r
- endif ()\r
-\r
- if (${ARCH} STREQUAL "x86_64")\r
- set(DYNAMIC_CORE "PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO")\r
- if (NOT NO_AVX)\r
- set(DYNAMIC_CORE "${DYNAMIC_CORE} SANDYBRIDGE BULLDOZER PILEDRIVER STEAMROLLER")\r
- endif ()\r
- if (NOT NO_AVX2)\r
- set(DYNAMIC_CORE "${DYNAMIC_CORE} HASWELL")\r
- endif ()\r
- endif ()\r
-\r
- if (NOT DYNAMIC_CORE)\r
- unset(DYNAMIC_ARCH)\r
- endif ()\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "ia64")\r
- set(NO_BINARY_MODE 1)\r
- set(BINARY_DEFINED 1)\r
-\r
- if (${F_COMPILER} MATCHES "GFORTRAN")\r
- if (${CMAKE_C_COMPILER} STREQUAL "GNU")\r
- # EXPRECISION = 1\r
- # CCOMMON_OPT += -DEXPRECISION\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "mips64")\r
- set(NO_BINARY_MODE 1)\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "alpha")\r
- set(NO_BINARY_MODE 1)\r
- set(BINARY_DEFINED 1)\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "arm")\r
- set(NO_BINARY_MODE 1)\r
- set(BINARY_DEFINED 1)\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "arm64")\r
- set(NO_BINARY_MODE 1)\r
- set(BINARY_DEFINED 1)\r
-endif ()\r
-\r
+##
+## 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 (${F_COMPILER} 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 (${F_COMPILER} 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 ()
+
-##\r
-## Author: Hank Anderson <hank@statease.com>\r
-## Description: Ported from portion of OpenBLAS/Makefile.system\r
-## Sets C related variables.\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB" OR ${CMAKE_C_COMPILER} STREQUAL "Clang")\r
-\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -Wall")\r
- set(COMMON_PROF "${COMMON_PROF} -fno-inline")\r
- set(NO_UNINITIALIZED_WARN "-Wno-uninitialized")\r
-\r
- if (QUIET_MAKE)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} ${NO_UNINITIALIZED_WARN} -Wno-unused")\r
- endif ()\r
-\r
- if (NO_BINARY_MODE)\r
-\r
- if (${ARCH} STREQUAL "mips64")\r
- if (BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mabi=64")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mabi=n32")\r
- endif ()\r
- set(BINARY_DEFINED 1)\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3A")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -march=mips64")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -march=mips64")\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3B")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -march=mips64")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -march=mips64")\r
- endif ()\r
-\r
- if (${OSNAME} STREQUAL "AIX")\r
- set(BINARY_DEFINED 1)\r
- endif ()\r
- endif ()\r
-\r
- if (NOT BINARY_DEFINED)\r
- if (BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m64")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m32")\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "PGI")\r
- if (BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -tp p7-64")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -tp p7")\r
- endif ()\r
-endif ()\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "PATHSCALE")\r
- if (BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m64")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m32")\r
- endif ()\r
-endif ()\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "OPEN64")\r
-\r
- if (${ARCH} STREQUAL "mips64")\r
-\r
- if (NOT BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -n32")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -n64")\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3A")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -loongson3 -static")\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3B")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -loongson3 -static")\r
- endif ()\r
-\r
- else ()\r
-\r
- if (BINARY64)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m32")\r
- else ()\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m64")\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${CMAKE_C_COMPILER} STREQUAL "SUN")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -w")\r
- if (${ARCH} STREQUAL "x86")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -m32")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- endif ()\r
-endif ()\r
-\r
+##
+## Author: Hank Anderson <hank@statease.com>
+## Description: Ported from portion of OpenBLAS/Makefile.system
+## Sets C related variables.
+
+if (${CMAKE_C_COMPILER} STREQUAL "GNU" OR ${CMAKE_C_COMPILER} STREQUAL "LSB" OR ${CMAKE_C_COMPILER} STREQUAL "Clang")
+
+ set(CCOMMON_OPT "${CCOMMON_OPT} -Wall")
+ set(COMMON_PROF "${COMMON_PROF} -fno-inline")
+ set(NO_UNINITIALIZED_WARN "-Wno-uninitialized")
+
+ if (QUIET_MAKE)
+ set(CCOMMON_OPT "${CCOMMON_OPT} ${NO_UNINITIALIZED_WARN} -Wno-unused")
+ endif ()
+
+ if (NO_BINARY_MODE)
+
+ if (${ARCH} STREQUAL "mips64")
+ if (BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -mabi=64")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -mabi=n32")
+ endif ()
+ set(BINARY_DEFINED 1)
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3A")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -march=mips64")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -march=mips64")
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3B")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -march=mips64")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -march=mips64")
+ endif ()
+
+ if (${OSNAME} STREQUAL "AIX")
+ set(BINARY_DEFINED 1)
+ endif ()
+ endif ()
+
+ if (NOT BINARY_DEFINED)
+ if (BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m64")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m32")
+ endif ()
+ endif ()
+endif ()
+
+if (${CMAKE_C_COMPILER} STREQUAL "PGI")
+ if (BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -tp p7-64")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -tp p7")
+ endif ()
+endif ()
+
+if (${CMAKE_C_COMPILER} STREQUAL "PATHSCALE")
+ if (BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m64")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m32")
+ endif ()
+endif ()
+
+if (${CMAKE_C_COMPILER} STREQUAL "OPEN64")
+
+ if (${ARCH} STREQUAL "mips64")
+
+ if (NOT BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -n32")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -n64")
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3A")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -loongson3 -static")
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3B")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -loongson3 -static")
+ endif ()
+
+ else ()
+
+ if (BINARY64)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m32")
+ else ()
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m64")
+ endif ()
+ endif ()
+endif ()
+
+if (${CMAKE_C_COMPILER} STREQUAL "SUN")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -w")
+ if (${ARCH} STREQUAL "x86")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -m32")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ endif ()
+endif ()
+
-##\r
-## Author: Hank Anderson <hank@statease.com>\r
-## Description: Ported from portion of OpenBLAS/Makefile.system\r
-## Sets Fortran related variables.\r
-\r
-if (${F_COMPILER} STREQUAL "G77")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_G77")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")\r
- if (NOT NO_BINARY_MODE)\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "G95")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_G95")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")\r
- if (NOT NO_BINARY_MODE)\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- endif ()\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "GFORTRAN")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_GFORT")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")\r
- #Don't include -lgfortran, when NO_LAPACK=1 or lsbcc\r
- if (NOT NO_LAPACK)\r
- set(EXTRALIB "{EXTRALIB} -lgfortran")\r
- endif ()\r
- if (NO_BINARY_MODE)\r
- if (${ARCH} STREQUAL "mips64")\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=64")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=n32")\r
- endif ()\r
- endif ()\r
- else ()\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -fdefault-integer-8")\r
- endif ()\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- endif ()\r
- endif ()\r
-\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "INTEL")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL")\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -i8")\r
- endif ()\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "FUJITSU")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_FUJITSU")\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "IBM")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_IBM")\r
- # FCOMMON_OPT += -qarch=440\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -q64")\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -qintsize=8")\r
- endif ()\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -q32")\r
- endif ()\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "PGI")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_PGI")\r
- set(COMMON_PROF "${COMMON_PROF} -DPGICOMPILER")\r
- if (BINARY64)\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -i8")\r
- endif ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -tp p7-64")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -tp p7")\r
- endif ()\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "PATHSCALE")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_PATHSCALE")\r
- if (BINARY64)\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -i8")\r
- endif ()\r
- endif ()\r
-\r
- if (NOT ${ARCH} STREQUAL "mips64")\r
- if (NOT BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- endif ()\r
- else ()\r
- if (BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=64")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=n32")\r
- endif ()\r
- endif ()\r
-\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "OPEN64")\r
-\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_OPEN64")\r
- if (BINARY64)\r
- if (INTERFACE64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -i8")\r
- endif ()\r
- endif ()\r
-\r
- if (${ARCH} STREQUAL "mips64")\r
-\r
- if (NOT BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -n32")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -n64")\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3A")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -loongson3 -static")\r
- endif ()\r
-\r
- if (${CORE} STREQUAL "LOONGSON3B")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -loongson3 -static")\r
- endif ()\r
- else ()\r
- if (NOT BINARY64)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- endif ()\r
- endif ()\r
-\r
- if (USE_OPENMP)\r
- set(FEXTRALIB "${FEXTRALIB} -lstdc++")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mp")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "SUN")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_SUN")\r
- if (${ARCH} STREQUAL "x86")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m32")\r
- else ()\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -m64")\r
- endif ()\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -xopenmp=parallel")\r
- endif ()\r
-endif ()\r
-\r
-if (${F_COMPILER} STREQUAL "COMPAQ")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_COMPAQ")\r
- if (USE_OPENMP)\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")\r
- endif ()\r
-endif ()\r
-\r
+##
+## Author: Hank Anderson <hank@statease.com>
+## Description: Ported from portion of OpenBLAS/Makefile.system
+## Sets Fortran related variables.
+
+if (${F_COMPILER} STREQUAL "G77")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_G77")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
+ if (NOT NO_BINARY_MODE)
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ endif ()
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "G95")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_G95")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
+ if (NOT NO_BINARY_MODE)
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ endif ()
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "GFORTRAN")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_GFORT")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
+ #Don't include -lgfortran, when NO_LAPACK=1 or lsbcc
+ if (NOT NO_LAPACK)
+ set(EXTRALIB "{EXTRALIB} -lgfortran")
+ endif ()
+ if (NO_BINARY_MODE)
+ if (${ARCH} STREQUAL "mips64")
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=64")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=n32")
+ endif ()
+ endif ()
+ else ()
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -fdefault-integer-8")
+ endif ()
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ endif ()
+ endif ()
+
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "INTEL")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_INTEL")
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
+ endif ()
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "FUJITSU")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_FUJITSU")
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "IBM")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_IBM")
+ # FCOMMON_OPT += -qarch=440
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -q64")
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -qintsize=8")
+ endif ()
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -q32")
+ endif ()
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "PGI")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_PGI")
+ set(COMMON_PROF "${COMMON_PROF} -DPGICOMPILER")
+ if (BINARY64)
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
+ endif ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -tp p7-64")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -tp p7")
+ endif ()
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "PATHSCALE")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_PATHSCALE")
+ if (BINARY64)
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
+ endif ()
+ endif ()
+
+ if (NOT ${ARCH} STREQUAL "mips64")
+ if (NOT BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ endif ()
+ else ()
+ if (BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=64")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=n32")
+ endif ()
+ endif ()
+
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "OPEN64")
+
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_OPEN64")
+ if (BINARY64)
+ if (INTERFACE64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
+ endif ()
+ endif ()
+
+ if (${ARCH} STREQUAL "mips64")
+
+ if (NOT BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -n32")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -n64")
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3A")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -loongson3 -static")
+ endif ()
+
+ if (${CORE} STREQUAL "LOONGSON3B")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -loongson3 -static")
+ endif ()
+ else ()
+ if (NOT BINARY64)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ endif ()
+ endif ()
+
+ if (USE_OPENMP)
+ set(FEXTRALIB "${FEXTRALIB} -lstdc++")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mp")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "SUN")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_SUN")
+ if (${ARCH} STREQUAL "x86")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m32")
+ else ()
+ set(FCOMMON_OPT "${FCOMMON_OPT} -m64")
+ endif ()
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -xopenmp=parallel")
+ endif ()
+endif ()
+
+if (${F_COMPILER} STREQUAL "COMPAQ")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_COMPAQ")
+ if (USE_OPENMP)
+ set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")
+ endif ()
+endif ()
+
-##\r
-## Author: Hank Anderson <hank@statease.com>\r
-## Description: Ported from portion of OpenBLAS/Makefile.system\r
-## Detects the OS and sets appropriate variables.\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")\r
- set(ENV{MACOSX_DEPLOYMENT_TARGET} "10.2") # TODO: should be exported as an env var\r
- set(MD5SUM "md5 -r")\r
-endif ()\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")\r
- set(MD5SUM "md5 -r")\r
-endif ()\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")\r
- set(MD5SUM "md5 -n")\r
-endif ()\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")\r
- set(EXTRALIB "${EXTRALIB} -lm")\r
- set(NO_EXPRECISION 1)\r
-endif ()\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")\r
- set(EXTRALIB "${EXTRALIB} -lm")\r
-endif ()\r
-\r
-# TODO: this is probably meant for mingw, not other windows compilers\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")\r
-\r
- set(NEED_PIC 0)\r
- set(NO_EXPRECISION 1)\r
-\r
- set(EXTRALIB "${EXTRALIB} -defaultlib:advapi32")\r
-\r
- # probably not going to use these\r
- set(SUFFIX "obj")\r
- set(PSUFFIX "pobj")\r
- set(LIBSUFFIX "a")\r
-\r
- if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DMS_ABI")\r
- endif ()\r
-\r
- if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")\r
-\r
- # Test for supporting MS_ABI\r
- # removed string parsing in favor of CMake's version comparison -hpa\r
- execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)\r
- if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7)\r
- # GCC Version >=4.7\r
- # It is compatible with MSVC ABI.\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DMS_ABI")\r
- endif ()\r
- endif ()\r
-\r
- # Ensure the correct stack alignment on Win32\r
- # http://permalink.gmane.org/gmane.comp.lib.openblas.general/97\r
- if (${ARCH} STREQUAL "x86")\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -mincoming-stack-boundary=2")\r
- set(FCOMMON_OPT "${FCOMMON_OPT} -mincoming-stack-boundary=2")\r
- endif ()\r
- \r
-endif ()\r
-\r
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Interix")\r
- set(NEED_PIC 0)\r
- set(NO_EXPRECISION 1)\r
- \r
- set(INTERIX_TOOL_DIR STREQUAL "/opt/gcc.3.3/i586-pc-interix3/bin")\r
-endif ()\r
-\r
-if (CYGWIN)\r
- set(NEED_PIC 0)\r
- set(NO_EXPRECISION 1)\r
-endif ()\r
-\r
-if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Interix")\r
- if (SMP)\r
- set(EXTRALIB "${EXTRALIB} -lpthread")\r
- endif ()\r
-endif ()\r
-\r
-if (QUAD_PRECISION)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DQUAD_PRECISION")\r
- set(NO_EXPRECISION 1)\r
-endif ()\r
-\r
-if (${ARCH} STREQUAL "x86")\r
- set(NO_EXPRECISION 1)\r
-endif ()\r
-\r
-if (UTEST_CHECK)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DUTEST_CHECK")\r
- set(SANITY_CHECK 1)\r
-endif ()\r
-\r
-if (SANITY_CHECK)\r
- # TODO: need some way to get $(*F) (target filename)\r
- set(CCOMMON_OPT "${CCOMMON_OPT} -DSANITY_CHECK -DREFNAME=$(*F)f${BU}")\r
-endif ()\r
-\r
+##
+## Author: Hank Anderson <hank@statease.com>
+## Description: Ported from portion of OpenBLAS/Makefile.system
+## Detects the OS and sets appropriate variables.
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+ set(ENV{MACOSX_DEPLOYMENT_TARGET} "10.2") # TODO: should be exported as an env var
+ set(MD5SUM "md5 -r")
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ set(MD5SUM "md5 -r")
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
+ set(MD5SUM "md5 -n")
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+ set(EXTRALIB "${EXTRALIB} -lm")
+ set(NO_EXPRECISION 1)
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
+ set(EXTRALIB "${EXTRALIB} -lm")
+endif ()
+
+# TODO: this is probably meant for mingw, not other windows compilers
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+
+ set(NEED_PIC 0)
+ set(NO_EXPRECISION 1)
+
+ set(EXTRALIB "${EXTRALIB} -defaultlib:advapi32")
+
+ # probably not going to use these
+ set(SUFFIX "obj")
+ set(PSUFFIX "pobj")
+ set(LIBSUFFIX "a")
+
+ if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DMS_ABI")
+ endif ()
+
+ if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
+
+ # Test for supporting MS_ABI
+ # removed string parsing in favor of CMake's version comparison -hpa
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+ if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7)
+ # GCC Version >=4.7
+ # It is compatible with MSVC ABI.
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DMS_ABI")
+ endif ()
+ endif ()
+
+ # Ensure the correct stack alignment on Win32
+ # http://permalink.gmane.org/gmane.comp.lib.openblas.general/97
+ if (${ARCH} STREQUAL "x86")
+ set(CCOMMON_OPT "${CCOMMON_OPT} -mincoming-stack-boundary=2")
+ set(FCOMMON_OPT "${FCOMMON_OPT} -mincoming-stack-boundary=2")
+ endif ()
+
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Interix")
+ set(NEED_PIC 0)
+ set(NO_EXPRECISION 1)
+
+ set(INTERIX_TOOL_DIR STREQUAL "/opt/gcc.3.3/i586-pc-interix3/bin")
+endif ()
+
+if (CYGWIN)
+ set(NEED_PIC 0)
+ set(NO_EXPRECISION 1)
+endif ()
+
+if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Interix")
+ if (SMP)
+ set(EXTRALIB "${EXTRALIB} -lpthread")
+ endif ()
+endif ()
+
+if (QUAD_PRECISION)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DQUAD_PRECISION")
+ set(NO_EXPRECISION 1)
+endif ()
+
+if (${ARCH} STREQUAL "x86")
+ set(NO_EXPRECISION 1)
+endif ()
+
+if (UTEST_CHECK)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DUTEST_CHECK")
+ set(SANITY_CHECK 1)
+endif ()
+
+if (SANITY_CHECK)
+ # TODO: need some way to get $(*F) (target filename)
+ set(CCOMMON_OPT "${CCOMMON_OPT} -DSANITY_CHECK -DREFNAME=$(*F)f${BU}")
+endif ()
+