[WIP] fix compilation on AIXtags/v0.3.11^2
| @@ -34,8 +34,11 @@ ifeq ($(USE_OPENMP), 1) | |||||
| COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp | COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp | ||||
| FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp | FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp | ||||
| else | else | ||||
| COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math | |||||
| FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math | |||||
| COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math | |||||
| FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math | |||||
| ifeq ($(OSNAME), AIX) | |||||
| FCOMMON_OPT += -O1 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math | |||||
| endif | |||||
| endif | endif | ||||
| endif | endif | ||||
| @@ -78,6 +81,9 @@ CCOMMON_OPT += -mpowerpc64 -maix64 | |||||
| ifeq ($(COMPILER_F77), g77) | ifeq ($(COMPILER_F77), g77) | ||||
| FCOMMON_OPT += -mpowerpc64 -maix64 | FCOMMON_OPT += -mpowerpc64 -maix64 | ||||
| endif | endif | ||||
| ifeq ($(F_COMPILER), GFORTRAN) | |||||
| FCOMMON_OPT += -mpowerpc64 -maix64 | |||||
| endif | |||||
| ifeq ($(COMPILER_F77), xlf) | ifeq ($(COMPILER_F77), xlf) | ||||
| FCOMMON_OPT += -q64 | FCOMMON_OPT += -q64 | ||||
| endif | endif | ||||
| @@ -109,6 +109,9 @@ endif | |||||
| ifeq ($(TARGET), ARMV8) | ifeq ($(TARGET), ARMV8) | ||||
| GETARCH_FLAGS := -DFORCE_ARMV7 | GETARCH_FLAGS := -DFORCE_ARMV7 | ||||
| endif | endif | ||||
| ifeq ($(TARGET), POWER8) | |||||
| GETARCH_FLAGS := -DFORCE_POWER6 | |||||
| endif | |||||
| endif | endif | ||||
| @@ -6,6 +6,7 @@ | |||||
| # Checking cross compile | # Checking cross compile | ||||
| $hostos = `uname -s | sed -e s/\-.*//`; chop($hostos); | $hostos = `uname -s | sed -e s/\-.*//`; chop($hostos); | ||||
| $hostarch = `uname -m | sed -e s/i.86/x86/`;chop($hostarch); | $hostarch = `uname -m | sed -e s/i.86/x86/`;chop($hostarch); | ||||
| $hostarch = `uname -p` if ($hostos eq "AIX"); | |||||
| $hostarch = "x86_64" if ($hostarch eq "amd64"); | $hostarch = "x86_64" if ($hostarch eq "amd64"); | ||||
| $hostarch = "arm" if ($hostarch =~ /^arm.*/); | $hostarch = "arm" if ($hostarch =~ /^arm.*/); | ||||
| $hostarch = "arm64" if ($hostarch eq "aarch64"); | $hostarch = "arm64" if ($hostarch eq "aarch64"); | ||||
| @@ -57,7 +57,7 @@ | |||||
| #define CPUTYPE_PPCG4 7 | #define CPUTYPE_PPCG4 7 | ||||
| #define CPUTYPE_POWER8 8 | #define CPUTYPE_POWER8 8 | ||||
| #define CPUTYPE_POWER9 9 | #define CPUTYPE_POWER9 9 | ||||
| #define CPUTYPE_POWER10 10 | |||||
| #define CPUTYPE_POWER10 10 | |||||
| char *cpuname[] = { | char *cpuname[] = { | ||||
| "UNKNOWN", | "UNKNOWN", | ||||
| @@ -83,8 +83,8 @@ char *lowercpuname[] = { | |||||
| "cell", | "cell", | ||||
| "ppcg4", | "ppcg4", | ||||
| "power8", | "power8", | ||||
| "power9", | |||||
| "power10" | |||||
| "power9", | |||||
| "power10" | |||||
| }; | }; | ||||
| char *corename[] = { | char *corename[] = { | ||||
| @@ -97,8 +97,8 @@ char *corename[] = { | |||||
| "CELL", | "CELL", | ||||
| "PPCG4", | "PPCG4", | ||||
| "POWER8", | "POWER8", | ||||
| "POWER9", | |||||
| "POWER10" | |||||
| "POWER9", | |||||
| "POWER10" | |||||
| }; | }; | ||||
| int detect(void){ | int detect(void){ | ||||
| @@ -154,17 +154,17 @@ int detect(void){ | |||||
| pclose(infile); | pclose(infile); | ||||
| if (!strncasecmp(p, "POWER3", 6)) return CPUTYPE_POWER3; | |||||
| if (!strncasecmp(p, "POWER4", 6)) return CPUTYPE_POWER4; | |||||
| if (!strncasecmp(p, "PPC970", 6)) return CPUTYPE_PPC970; | |||||
| if (!strncasecmp(p, "POWER5", 6)) return CPUTYPE_POWER5; | |||||
| if (!strncasecmp(p, "POWER6", 6)) return CPUTYPE_POWER6; | |||||
| if (!strncasecmp(p, "POWER7", 6)) return CPUTYPE_POWER6; | |||||
| if (!strncasecmp(p, "POWER8", 6)) return CPUTYPE_POWER8; | |||||
| if (!strncasecmp(p, "POWER9", 6)) return CPUTYPE_POWER9; | |||||
| if (!strncasecmp(p, "POWER10", 7)) return CPUTYPE_POWER10; | |||||
| if (!strncasecmp(p, "Cell", 4)) return CPUTYPE_CELL; | |||||
| if (!strncasecmp(p, "7447", 4)) return CPUTYPE_PPCG4; | |||||
| if (strstr(p, "POWER3")) return CPUTYPE_POWER3; | |||||
| if (strstr(p, "POWER4")) return CPUTYPE_POWER4; | |||||
| if (strstr(p, "PPC970")) return CPUTYPE_PPC970; | |||||
| if (strstr(p, "POWER5")) return CPUTYPE_POWER5; | |||||
| if (strstr(p, "POWER6")) return CPUTYPE_POWER6; | |||||
| if (strstr(p, "POWER7")) return CPUTYPE_POWER6; | |||||
| if (strstr(p, "POWER8")) return CPUTYPE_POWER8; | |||||
| if (strstr(p, "POWER9")) return CPUTYPE_POWER9; | |||||
| if (strstr(p, "POWER10")) return CPUTYPE_POWER10; | |||||
| if (strstr(p, "Cell")) return CPUTYPE_CELL; | |||||
| if (strstr(p, "7447")) return CPUTYPE_PPCG4; | |||||
| return CPUTYPE_POWER5; | return CPUTYPE_POWER5; | ||||
| #endif | #endif | ||||
| @@ -90,11 +90,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
| #include <sys/sysinfo.h> | #include <sys/sysinfo.h> | ||||
| #include <unistd.h> | #include <unistd.h> | ||||
| #endif | #endif | ||||
| #if defined(AIX) | |||||
| #include <sys/sysinfo.h> | |||||
| #endif | |||||
| #if defined(__x86_64__) || defined(_M_X64) | |||||
| #if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6)) | #if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6)) | ||||
| #else | #else | ||||
| #define NO_AVX512 | #define NO_AVX512 | ||||
| #endif | #endif | ||||
| #endif | |||||
| /* #define FORCE_P2 */ | /* #define FORCE_P2 */ | ||||
| /* #define FORCE_KATMAI */ | /* #define FORCE_KATMAI */ | ||||
| /* #define FORCE_COPPERMINE */ | /* #define FORCE_COPPERMINE */ | ||||
| @@ -1297,6 +1302,11 @@ static int get_num_cores(void) { | |||||
| sysctl(m, 2, &count, &len, NULL, 0); | sysctl(m, 2, &count, &len, NULL, 0); | ||||
| return count; | return count; | ||||
| #elif defined(AIX) | |||||
| //returns the number of processors which are currently online | |||||
| return sysconf(_SC_NPROCESSORS_ONLN); | |||||
| #else | #else | ||||
| return 2; | return 2; | ||||
| #endif | #endif | ||||
| @@ -514,7 +514,7 @@ $(KDIR)$(SGEMMONCOPYOBJ) : $(KERNELDIR)/$(SGEMMONCOPY) | |||||
| $(KDIR)$(SGEMMOTCOPYOBJ) : $(KERNELDIR)/$(SGEMMOTCOPY) | $(KDIR)$(SGEMMOTCOPYOBJ) : $(KERNELDIR)/$(SGEMMOTCOPY) | ||||
| ifeq ($(OS), AIX) | ifeq ($(OS), AIX) | ||||
| $(CC) $(CFLAGS) -S -UDOUBLE -UCOMPLEX $< -o - > sgemmotcopy.s | |||||
| $(CC) $(CFLAGS) -S -UDOUBLE -UCOMPLEX $< -o - > sgemmotcopy.s | |||||
| m4 sgemmotcopy.s > sgemmotcopy_nomacros.s | m4 sgemmotcopy.s > sgemmotcopy_nomacros.s | ||||
| $(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX sgemmotcopy_nomacros.s -o $@ | $(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX sgemmotcopy_nomacros.s -o $@ | ||||
| rm sgemmotcopy.s sgemmotcopy_nomacros.s | rm sgemmotcopy.s sgemmotcopy_nomacros.s | ||||
| @@ -530,7 +530,7 @@ $(KDIR)$(SGEMMINCOPYOBJ) : $(KERNELDIR)/$(SGEMMINCOPY) | |||||
| $(KDIR)$(SGEMMITCOPYOBJ) : $(KERNELDIR)/$(SGEMMITCOPY) | $(KDIR)$(SGEMMITCOPYOBJ) : $(KERNELDIR)/$(SGEMMITCOPY) | ||||
| ifeq ($(OS), AIX) | ifeq ($(OS), AIX) | ||||
| $(CC) $(CFLAGS) -S -UDOUBLE -UCOMPLEX $< -o - > sgemmitcopy.s | |||||
| $(CC) $(CFLAGS) -S -UDOUBLE -UCOMPLEX $< -o - > sgemmitcopy.s | |||||
| m4 sgemmitcopy.s > sgemmitcopy_nomacros.s | m4 sgemmitcopy.s > sgemmitcopy_nomacros.s | ||||
| $(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX sgemmitcopy_nomacros.s -o $@ | $(CC) $(CFLAGS) -c -UDOUBLE -UCOMPLEX sgemmitcopy_nomacros.s -o $@ | ||||
| rm sgemmitcopy.s sgemmitcopy_nomacros.s | rm sgemmitcopy.s sgemmitcopy_nomacros.s | ||||
| @@ -34,6 +34,9 @@ endif | |||||
| ifeq ($(C_COMPILER), PGI) | ifeq ($(C_COMPILER), PGI) | ||||
| OBJS = utest_main2.o | OBJS = utest_main2.o | ||||
| endif | endif | ||||
| ifeq ($(OSNAME), AIX) | |||||
| OBJS = utest_main2.o | |||||
| endif | |||||
| all : run_test | all : run_test | ||||