diff options
Diffstat (limited to 'openmp')
| -rw-r--r-- | openmp/runtime/Makefile | 3 | ||||
| -rw-r--r-- | openmp/runtime/src/defs.mk | 4 | ||||
| -rw-r--r-- | openmp/runtime/src/makefile.mk | 131 | ||||
| -rwxr-xr-x | openmp/runtime/tools/build.pl | 36 | ||||
| -rwxr-xr-x | openmp/runtime/tools/check-depends.pl | 10 | ||||
| -rwxr-xr-x | openmp/runtime/tools/check-execstack.pl | 10 | ||||
| -rwxr-xr-x | openmp/runtime/tools/check-instruction-set.pl | 62 | ||||
| -rwxr-xr-x | openmp/runtime/tools/check-tools.pl | 3 | ||||
| -rw-r--r-- | openmp/runtime/tools/common.inc | 22 | ||||
| -rwxr-xr-x | openmp/runtime/tools/extract-objects.pl | 2 | ||||
| -rw-r--r-- | openmp/runtime/tools/lib/Platform.pm | 75 | ||||
| -rwxr-xr-x | openmp/runtime/tools/message-converter.pl | 2 | ||||
| -rwxr-xr-x | openmp/runtime/tools/required-objects.pl | 19 | ||||
| -rw-r--r-- | openmp/runtime/tools/src/common-defs.mk | 18 | ||||
| -rw-r--r-- | openmp/runtime/tools/src/common-rules.mk | 12 | ||||
| -rw-r--r-- | openmp/runtime/tools/src/common-tools.mk | 10 |
16 files changed, 234 insertions, 185 deletions
diff --git a/openmp/runtime/Makefile b/openmp/runtime/Makefile index ac95298f770..b1697e4f190 100644 --- a/openmp/runtime/Makefile +++ b/openmp/runtime/Makefile @@ -39,6 +39,9 @@ info: @echo omp_root=$(omp_root) @echo omp_os=$(omp_os) @echo arch=$(arch) +ifeq "$(arch)" "mic" + @echo mic_arch=$(mic_arch) +endif @echo compiler=$(compiler) @echo mic=$(mic) @echo mode=$(mode) diff --git a/openmp/runtime/src/defs.mk b/openmp/runtime/src/defs.mk index 14a0e90ff80..1337abbff4d 100644 --- a/openmp/runtime/src/defs.mk +++ b/openmp/runtime/src/defs.mk @@ -41,7 +41,11 @@ out_cmn_dir = $(out_dir)common$(suffix)/ out_ptf_dir = $(out_dir)$(platform)$(suffix)/ _out_lib_dir = $(out_dir)$(1)$(suffix)/lib$(if $(filter mac_%,$(1)),.thin)/ out_lib_dir = $(call _out_lib_dir,$(platform)) +ifneq "$(arch)" "mic" out_l10n_dir = $(out_lib_dir)$(if $(filter lin mac,$(os)),locale/) +else +out_l10n_dir = $(out_lib_dir) +endif ifeq "$(os)" "mac" _out_lib_fat_dir = $(out_dir)$(1)$(suffix)/lib/ out_lib_fat_dir = $(call _out_lib_fat_dir,$(platform)) diff --git a/openmp/runtime/src/makefile.mk b/openmp/runtime/src/makefile.mk index 64654be99ff..2426c8e88fe 100644 --- a/openmp/runtime/src/makefile.mk +++ b/openmp/runtime/src/makefile.mk @@ -69,8 +69,6 @@ LINK_TYPE := $(call check_variable,LINK_TYPE,dyna stat) OMP_VERSION := $(call check_variable,OMP_VERSION,40 30 25) # Generate optimized code. OPTIMIZATION := $(call check_variable,OPTIMIZATION,off on) -# Target compiler. -TARGET_COMPILER := $(call check_variable,TARGET_COMPILER,12 11) # Library version: 4 -- legacy, 5 -- compat. VERSION := $(call check_variable,VERSION,5 4) # quad precision floating point @@ -92,7 +90,6 @@ define curr_config LINK_TYPE=$(LINK_TYPE) OMP_VERSION=$(OMP_VERSION) OPTIMIZATION=$(OPTIMIZATION) - TARGET_COMPILER=$(TARGET_COMPILER) VERSION=$(VERSION) CPPFLAGS=$(subst $(space),_,$(CPPFLAGS)) CFLAGS=$(subst $(space),_,$(CFLAGS)) @@ -111,16 +108,6 @@ ifeq "$(os)" "mac" mac_os_new := $(shell /bin/sh -c 'if [[ `sw_vers -productVersion` > 10.6 ]]; then echo "1"; else echo "0"; fi') endif -# Form target directory name for MIC platforms -ifeq "$(MIC_ARCH)" "knc" - mic-postf1 = .knc -endif -ifeq "$(MIC_OS)" "lin" - mic-postfix = $(mic-postf1).lin -else - mic-postfix = $(mic-postf1) -endif - # -------------------------------------------------------------------------------------------------- # Dev tools and general options (like -fpic, -O2 or -g). @@ -213,7 +200,7 @@ ifeq "$(filter gcc clang,$(c))" "" fort-flags += -Qsox else # For unknown reason, icc and ifort on mac does not accept this option. - ifneq "$(filter lin lrb,$(os))" "" + ifneq "$(filter lin,$(os))" "" c-flags += -sox cxx-flags += -sox fort-flags += -sox @@ -233,7 +220,7 @@ ifeq "$(fort)" "ifort" endif endif -ifeq "$(os)" "lrb" +ifeq "$(arch)" "mic" c-flags += -mmic cxx-flags += -mmic fort-flags += -mmic @@ -264,6 +251,7 @@ ifeq "$(os)" "win" endif ifeq "$(os)" "lin" + ifneq "$(arch)" "mic" c-flags += -Wsign-compare cxx-flags += -Wsign-compare ld-flags += -Wsign-compare @@ -273,13 +261,14 @@ ifeq "$(os)" "lin" ld-flags += -Werror endif endif +endif ifeq "$(os)" "win" c-flags += -WX cxx-flags += -WX ld-flags += -WX:NO endif -ifeq "$(os)" "lrb" +ifeq "$(arch)" "mic" # With "-ftls-model=initial-exec" the compiler generates faster code for static TLS # accesses, it generates slower calls to glibc otherwise. We don't use this # feature on Linux because it prevents dynamic loading (use of dlopen) of the library. @@ -340,6 +329,7 @@ endif # --- Linker options --- ifeq "$(os)" "lin" + ifneq "$(arch)" "mic" ifneq "$(LIB_TYPE)" "stub" ifeq "$(ld)" "ld" # Warn about non-PIC code presence @@ -398,9 +388,7 @@ ifeq "$(os)" "lin" ld-flags += -Bstatic -L/usr/lib64 -lc_nonshared -Bdynamic endif endif -endif - -ifeq "$(os)" "lrb" + else # Below are Intel(R) Many Integrated Core Architecture linker flags ifeq "$(ld)" "ld" ifneq "$(LIB_TYPE)" "stub" ld-flags += -lthr @@ -426,16 +414,16 @@ ifeq "$(os)" "lrb" # ld-flags += -lintlc ifneq "$(LIB_TYPE)" "stub" ld-flags += -pthread - ifeq "$(MIC_OS)" "lin" ld-flags += -ldl endif - endif # include the c++ library for stats-gathering code ifeq "$(stats)" "on" ld-flags-extra += -Wl,-lstdc++ endif endif endif +endif + ifeq "$(os)" "mac" ifeq "$(ld)" "icc" @@ -463,7 +451,7 @@ ifeq "$(os)" "win" ifeq "$(LINK_TYPE)" "dyna" cpp-flags += -D _USRDLL endif -else # lin, lrb or mac +else # lin, mic or mac cpp-flags += -D _GNU_SOURCE cpp-flags += -D _REENTRANT endif @@ -510,12 +498,12 @@ cpp-flags += -D BUILD_PARALLEL_ORDERED cpp-flags += -D KMP_ASM_INTRINS cpp-flags += -D KMP_USE_INTERNODE_ALIGNMENT=0 # Linux and MIC compile with version symbols -ifneq "$(filter lin lrb,$(os))" "" +ifneq "$(filter lin,$(os))" "" ifeq "$(filter ppc64,$(arch))" "" cpp-flags += -D KMP_USE_VERSION_SYMBOLS endif endif -ifneq "$(os)" "lrb" +ifneq "$(arch)" "mic" cpp-flags += -D USE_LOAD_BALANCE endif ifneq "$(os)" "win" @@ -539,13 +527,13 @@ else # 5 endif endif cpp-flags += -D KMP_NESTED_HOT_TEAMS -ifneq "$(filter 32 32e,$(arch))" "" +ifneq "$(filter 32 32e mic,$(arch))" "" cpp-flags += -D KMP_USE_ADAPTIVE_LOCKS=1 -D KMP_DEBUG_ADAPTIVE_LOCKS=0 endif # is the std c++ library needed? (for stats-gathering, it is) std_cpp_lib=0 -ifneq "$(filter lin lrb,$(os))" "" +ifneq "$(filter lin,$(os))" "" ifeq "$(stats)" "on" cpp-flags += -D KMP_STATS_ENABLED=1 std_cpp_lib=1 @@ -612,7 +600,7 @@ cpp-flags += -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_ # Windows* OS: This define causes problems with LoadLibrary + declspec(thread) on Windows* OS. See CQ50564, # tests kmp_load_library_lib*.c, and the following MSDN reference: # http://support.microsoft.com/kb/118816 -ifneq "$(filter lin lrb,$(os))" "" +ifneq "$(filter lin ,$(os))" "" ifeq "$(LINK_TYPE)" "dyna" cpp-flags += -D KMP_TDATA_GTID else @@ -643,7 +631,7 @@ ifneq "$(os)" "win" cpp-flags += -D KMP_ARCH_AARCH64 else z_Linux_asm$(obj) : \ - cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64) + cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e mic,$(arch)),_64) endif endif @@ -682,7 +670,6 @@ ev-flags += -D Revision="\$$Revision" -D Date="\$$Date" ev-flags += -D KMP_TYPE="$(call legal_type,$(LIB_TYPE))" -D KMP_ARCH="$(call legal_arch,$(arch))" ev-flags += -D KMP_VERSION_MAJOR=$(VERSION) -D KMP_VERSION_MINOR=0 -D KMP_VERSION_BUILD=$(build) ev-flags += -D KMP_BUILD_DATE="$(date)" -ev-flags += -D KMP_TARGET_COMPILER=$(TARGET_COMPILER) ev-flags += -D KMP_DIAG=$(if $(filter on,$(DIAG)),1,0) ev-flags += -D KMP_DEBUG_INFO=$(if $(filter on,$(DEBUG_INFO)),1,0) ifeq "$(OMP_VERSION)" "40" @@ -791,16 +778,14 @@ endif endif endif endif - else # lin, lrb or mac + else # lin, mic or mac lib_c_items += z_Linux_util # GCC Compatibility files ifeq "$(VERSION)" "4" else # 5 lib_c_items += kmp_gsupport endif -# ifneq "$(arch)" "ppc64" lib_asm_items += z_Linux_asm -# endif endif endif @@ -860,7 +845,7 @@ ifeq "$(os)-$(LINK_TYPE)" "win-dyna" pdb_file = $(lib_item).pdb endif endif -ifneq "$(filter lin lrb,$(os))" "" +ifneq "$(filter lin,$(os))" "" ifeq "$(LINK_TYPE)" "dyna" ifneq "$(DEBUG_INFO)" "on" dbg_file = $(lib_item).dbg @@ -980,7 +965,7 @@ ifneq "$(filter icc icl icl.exe,$(c))" "" ifeq "$(os)" "win" libirc = $(icc_lib_dir)\libircmt$(lib) libipgo = $(icc_lib_dir)\libipgo$(lib) - else # lin, lrb or mac + else # lin, mic or mac ifeq "$(LINK_TYPE)" "dyna" # In case of dynamic linking, prefer libi*_pic.a libraries, they contains # position-independent code. @@ -1003,8 +988,10 @@ ifneq "$(filter icc icl icl.exe,$(c))" "" # Linux* OS: # We link in libraries to static library only. ifeq "$(os)-$(LINK_TYPE)" "lin-stat" + ifneq "$(arch)" "mic" linked_in_libs += libirc endif + endif # OS X*: # The trick is not required in case of dynamic library, but on Intel(R) 64 architecture we have a # problem: libirc.a is a fat, so linker (libtool) produces fat libguide.dylib... :-( (Only @@ -1054,7 +1041,7 @@ ifneq "$(dbg_file)" "" $(cp) $< $@ endif -ifneq "$(filter lin lrb,$(os))" "" +ifneq "$(filter lin,$(os))" "" lib_file_deps = $(if $(linked_in_libs),required/.objs,$(lib_obj_files)) endif ifeq "$(os)" "mac" @@ -1152,8 +1139,13 @@ endif stripped/$(lib_file) : unstripped/$(lib_file) $(dbg_file) stripped/.dir .rebuild $(target) + ifeq "$(arch)" "mic" + x86_64-k1om-linux-objcopy --strip-debug $< $@.tmp + x86_64-k1om-linux-objcopy --add-gnu-debuglink=$(dbg_file) $@.tmp $@ + else objcopy --strip-debug $< $@.tmp objcopy --add-gnu-debuglink=$(dbg_file) $@.tmp $@ + endif ifeq "$(os)" "mac" @@ -1262,8 +1254,8 @@ kmp_dummy.c : .rebuild # --- test-touch --- -# test-touch is not available for lrb. -ifneq "$(os)" "lrb" +# test-touch is not available for mic. +ifneq "$(arch)" "mic" # Compile a simple C test and link it with the library. Do it two times: the first link gives us # clear message if there are any problems, the second link run in verbose mode, linker output @@ -1400,7 +1392,7 @@ endif # But test-relo does actual work only on Linux* OS and # Intel(R) Many Integrated Core Architecture in case of dynamic linking. -ifeq "$(if $(filter lin lrb,$(os)),os)-$(LINK_TYPE)" "os-dyna" +ifeq "$(if $(filter lin,$(os)),os)-$(LINK_TYPE)" "os-dyna" # Make sure dynamic library does not contain position-dependent code. force-test-relo : test-relo/.force test-relo/.test @@ -1408,7 +1400,11 @@ ifeq "$(if $(filter lin lrb,$(os)),os)-$(LINK_TYPE)" "os-dyna" test-relo/.test : $(lib_item)$(dll) test-relo/.dir .rebuild $(target) + ifeq "$(arch)" "mic" + x86_64-k1om-linux-readelf -d $< > $(dir $@)readelf.log + else readelf -d $< > $(dir $@)readelf.log + endif grep -e TEXTREL $(dir $@)readelf.log; [ $$? -eq 1 ] $(touch) $@ @@ -1417,9 +1413,7 @@ endif # --- test-execstack --- # But test-execstack does actual work only on Linux* OS in case of dynamic linking. -# TODO: Enable it on Intel(R) Many Integrated Core Architecture as well. ifeq "$(if $(filter lin,$(os)),os)-$(LINK_TYPE)" "os-dyna" - tests += test-execstack # Make sure stack is not executable. @@ -1428,15 +1422,14 @@ ifeq "$(if $(filter lin,$(os)),os)-$(LINK_TYPE)" "os-dyna" test-execstack/.test : $(lib_item)$(dll) test-execstack/.dir .rebuild $(target) - $(perl) $(tools_dir)check-execstack.pl $< + $(perl) $(tools_dir)check-execstack.pl $(oa-opts) $< $(touch) $@ - endif # --- test-instr --- # But test-instr does actual work only on Intel(R) Many Integrated Core Architecture. -ifeq "$(os)" "lrb" +ifeq "$(arch)" "mic" # Make sure dynamic library does not contain position-dependent code. force-test-instr : test-instr/.force test-instr/.test @@ -1444,7 +1437,7 @@ ifeq "$(os)" "lrb" test-instr/.test : $(lib_file) $(tools_dir)check-instruction-set.pl test-instr/.dir .rebuild $(target) - $(perl) $(tools_dir)check-instruction-set.pl $(oa-opts) --show --mic-arch=$(MIC_ARCH) --mic-os=$(MIC_OS) $< + $(perl) $(tools_dir)check-instruction-set.pl $(oa-opts) --show --mic-arch=$(MIC_ARCH) $< $(touch) $@ endif @@ -1462,33 +1455,46 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LINK_TYPE))" "" ifeq "$(arch)" "32" td_exp += libc.so.6 td_exp += ld-linux.so.2 + td_exp += libgcc_s.so.1 endif ifeq "$(arch)" "32e" td_exp += libc.so.6 td_exp += ld-linux-x86-64.so.2 + td_exp += libgcc_s.so.1 endif ifeq "$(arch)" "64" td_exp += libc.so.6.1 + td_exp += libgcc_s.so.1 endif ifeq "$(arch)" "arm" td_exp += libc.so.6 td_exp += ld-linux-armhf.so.3 + td_exp += libgcc_s.so.1 endif ifeq "$(arch)" "ppc64" td_exp += libc.so.6 td_exp += ld64.so.1 + td_exp += libgcc_s.so.1 endif ifeq "$(arch)" "aarch" td_exp += libc.so.6 td_exp += ld-linux-aarch64.so.1 endif + ifeq "$(arch)-$(MIC_ARCH)" "mic-knf" + td_exp += ld-linux-l1om.so.2 + td_exp += libc.so.6 + td_exp += libgcc_s.so.1 + endif + ifeq "$(arch)-$(MIC_ARCH)" "mic-knc" + td_exp += ld-linux-k1om.so.2 + td_exp += libc.so.6 + endif ifeq "$(std_cpp_lib)" "1" td_exp += libstdc++.so.6 endif td_exp += libdl.so.2 - td_exp += libgcc_s.so.1 - ifeq "$(filter 32 32e 64 ppc64,$(arch))" "" + ifeq "$(filter 32 32e 64 ppc64 mic,$(arch))" "" td_exp += libffi.so.6 td_exp += libffi.so.5 endif @@ -1496,31 +1502,6 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LINK_TYPE))" "" td_exp += libpthread.so.0 endif endif - ifeq "$(os)" "lrb" - ifeq "$(MIC_OS)" "lin" - ifeq "$(std_cpp_lib)" "1" - td_exp += libstdc++.so.6 - endif - ifeq "$(MIC_ARCH)" "knf" - td_exp += "ld-linux-l1om.so.2" - td_exp += libc.so.6 - td_exp += libpthread.so.0 - td_exp += libdl.so.2 - td_exp += libgcc_s.so.1 - endif - ifeq "$(MIC_ARCH)" "knc" - td_exp += "ld-linux-k1om.so.2" - td_exp += libc.so.6 - td_exp += libdl.so.2 - td_exp += libpthread.so.0 - endif - endif - ifeq "$(MIC_OS)" "bsd" - td_exp += libc.so.7 - td_exp += libthr.so.3 - td_exp += libunwind.so.5 - endif - endif ifeq "$(os)" "mac" # td_exp += /usr/lib/libgcc_s.1.dylib td_exp += /usr/lib/libSystem.B.dylib @@ -1552,15 +1533,7 @@ endif # -------------------------------------------------------------------------------------------------- # Fortran files. # -------------------------------------------------------------------------------------------------- -ifeq "$(TARGET_COMPILER)" "11" - omp_lib_f = omp_lib.f -endif -ifeq "$(TARGET_COMPILER)" "12" omp_lib_f = omp_lib.f90 -endif -ifeq "$(omp_lib_f)" "" - $(error omp_lib_f is not defined) -endif omp_lib.mod omp_lib_kinds.mod : $(omp_lib_f) .rebuild $(target) $(fort) $(fort-flags) $< diff --git a/openmp/runtime/tools/build.pl b/openmp/runtime/tools/build.pl index 00564985451..64c35bdf141 100755 --- a/openmp/runtime/tools/build.pl +++ b/openmp/runtime/tools/build.pl @@ -55,26 +55,22 @@ my %makefiles = ( # * params: A hash of possible option values. "*" denotes default option value. For example, # if "versio" option is not specified, "--version=5" will be used implicitly. # * suffux: Only for extra options. Subroutine returning suffix for build and output -# directories. +# directories. ** When you do not want an option to be part of the suffix, set its base=2 my $opts = { "target" => { targets => "", base => 1, parms => { map( ( $_ => "" ), keys( %makefiles ) ), rtl => "*" }, }, "version" => { targets => "rtl", base => 1, parms => { 5 => "*", 4 => "" }, }, "lib-type" => { targets => "rtl", base => 1, parms => { normal => "*", stubs => "" }, }, "link-type" => { targets => "rtl", base => 1, parms => { dynamic => "*", static => "" }, }, - "target-compiler" => { targets => "rtl,dsl", base => 0, parms => { 12 => "*", 11 => "" }, suffix => sub { $_[ 0 ]; } }, "mode" => { targets => "rtl,dsl,timelimit", base => 0, parms => { release => "*", diag => "", debug => "" }, suffix => sub { substr( $_[ 0 ], 0, 3 ); } }, "omp-version" => { targets => "rtl", base => 0, parms => { 40 => "*", 30 => "", 25 => "" }, suffix => sub { $_[ 0 ]; } }, "coverage" => { targets => "rtl", base => 0, parms => { off => "*", on => "" }, suffix => sub { $_[ 0 ] eq "on" ? "c1" : "c0"; } }, - "tcheck" => { targets => "rtl", base => 0, parms => { 0 => "*", 1 => "", 2 => "" }, suffix => sub { "t" . $_[ 0 ]; } }, - "mic-arch" => { targets => "rtl", base => 0, parms => { knf => "*", knc => "", knl => "" }, suffix => sub { $_[ 0 ]; } }, - "mic-os" => { targets => "rtl", base => 0, parms => { bsd => "*", lin => "" }, suffix => sub { $_[ 0 ]; } }, - "mic-comp" => { targets => "rtl", base => 0, parms => { native => "*", offload => "" }, suffix => sub { substr( $_[ 0 ], 0, 3 ); } }, + "stats" => { targets => "rtl", base => 0, parms => { off => "*", on => "" }, suffix => sub { $_[ 0 ] eq "on" ? "s1" : "s0"; } }, }; my $synonyms = { "debug" => [ qw{ dbg debg } ], }; # This array specifies order of options to process, so it cannot be initialized with keys( %$opts ). -my @all_opts = qw{ target version lib-type link-type target-compiler mode omp-version coverage tcheck mic-arch mic-os mic-comp }; +my @all_opts = qw{ target version lib-type link-type mode omp-version coverage stats }; # This is the list of base options. my @base_opts = grep( $opts->{ $_ }->{ base } == 1, @all_opts ); # This is the list of extra options. @@ -241,7 +237,7 @@ sub enqueue_jobs($$@) { # Shortened version of @extra -- only non-default values. my $suffix = ( @extra ? "." . join( ".", @extra ) : "" ); my $knights = index( $suffix, "kn" ) - 1; - if ( $target_platform !~ "lrb" and $knights > 0 ) { + if ( $target_arch !~ "mic" and $knights > 0 ) { $suffix = substr( $suffix, 0, $knights ); } my $suf = ( @ex ? "." . join( ".", @ex ) : "" ); @@ -256,9 +252,7 @@ sub enqueue_jobs($$@) { make_args => [ "os=" . $target_os, "arch=" . $target_arch, - "MIC_OS=" . $set->{ "mic-os" }, - "MIC_ARCH=" . $set->{ "mic-arch" }, - "MIC_COMP=" . $set->{ "mic-comp" }, + "MIC_ARCH=" . $target_mic_arch, "date=" . Build::tstr( $Build::start ), "TEST_DEPS=" . ( $test_deps ? "on" : "off" ), "TEST_TOUCH=" . ( $test_touch ? "on" : "off" ), @@ -274,10 +268,9 @@ sub enqueue_jobs($$@) { "LIB_TYPE=" . substr( $set->{ "lib-type" }, 0, 4 ), "LINK_TYPE=" . substr( $set->{ "link-type" }, 0, 4 ), "OMP_VERSION=" . $set->{ "omp-version" }, - "USE_TCHECK=" . $set->{ tcheck }, "VERSION=" . $set->{ version }, - "TARGET_COMPILER=" . $set->{ "target-compiler" }, "suffix=" . $suf, + "stats=" . $set->{ stats }, @goals, ], build_dir => $build_dir @@ -371,29 +364,20 @@ Use specified string as default answer to all questions. =item B<--architecture=>I<arch> Specify target architecture to build. Default is architecture of host machine. I<arch> can be C<32>, -C<32e>, or one of known aliases like C<IA32>. +C<32e>, C<mic>, or one of known aliases like C<IA32>. If architecture is not specified explicitly, value of LIBOMP_ARCH environment variable is used. If LIBOMP_ARCH is not defined, host architecture detected. =item B<--os=>I<os> -Specify target OS. Default is OS of host machine. I<os> can be C<lin>, C<lrb>, C<mac>, C<win>, +Specify target OS. Default is OS of host machine. I<os> can be C<lin>, C<mac>, C<win>, or one of known aliases like C<Linux>, C<WinNT>, etc. -=item B<--mic-os=>I<os> - -Specify OS on Intel(R) Many Integrated Core Architecture card. Default is C<bsd>. I<os> can be C<bsd>, C<lin>. - =item B<--mic-arch=>I<arch> Specify architecture of Intel(R) Many Integrated Core Architecture card. Default is C<knf>. I<arch> can be C<knf>, C<knc>, C<knl>. -=item B<--mic-comp=>I<compiler-type> - -Specify whether the Intel(R) Many Integrated Core Compiler is native or offload. Default is C<native>. -I<compiler-type> can be C<native> or C<offload>. - =item B<-->[B<no->]B<test-deps> Enable or disable C<test-deps>. The test runs in any case, but result of disabled test is ignored. @@ -445,10 +429,6 @@ Mode controls 3 features: code optimization o o --------------------------------------------------- -=item B<--target-compiler=>I<version> - -Build files for specified target compiler, C<11> or C<12>. - =back =item Shortcuts diff --git a/openmp/runtime/tools/check-depends.pl b/openmp/runtime/tools/check-depends.pl index 2a8de56604a..ce97230c1d6 100755 --- a/openmp/runtime/tools/check-depends.pl +++ b/openmp/runtime/tools/check-depends.pl @@ -95,10 +95,16 @@ sub get_deps_ldd($) { sub get_deps_readelf($) { my $file = shift ( @_ ); - my $tool = "readelf"; + my $tool; my @bulk; my @deps; + if($target_arch eq "mic") { + $tool = "x86_64-k1om-linux-readelf"; + } else { + $tool = "readelf"; + } + execute( [ $tool, "-d", $file ], -stdout => \@bulk ); debug( @bulk, "(eof)" ); @@ -346,7 +352,7 @@ if ( not -e $lib ){ # Select appropriate get_deps implementation. if ( 0 ) { -} elsif ( $target_os eq "lin" or $target_os eq "lrb" ) { +} elsif ( $target_os eq "lin" ) { *get_deps = \*get_deps_readelf; } elsif ( $target_os eq "mac" ) { *get_deps = \*get_deps_otool; diff --git a/openmp/runtime/tools/check-execstack.pl b/openmp/runtime/tools/check-execstack.pl index f1417c7305e..1f09eab59d7 100755 --- a/openmp/runtime/tools/check-execstack.pl +++ b/openmp/runtime/tools/check-execstack.pl @@ -18,6 +18,7 @@ use FindBin; use lib "$FindBin::Bin/lib"; use tools; +use Platform ":vars"; our $VERSION = "0.002"; @@ -25,7 +26,13 @@ sub execstack($) { my ( $file ) = @_; my @output; my @stack; - execute( [ "readelf", "-l", "-W", $file ], -stdout => \@output ); + my $tool; + if($target_arch eq "mic") { + $tool = "x86_64-k1om-linux-readelf"; + } else { + $tool = "readelf"; + } + execute( [ $tool, "-l", "-W", $file ], -stdout => \@output ); @stack = grep( $_ =~ m{\A\s*(?:GNU_)?STACK\s+}, @output ); if ( not @stack ) { # Interpret missed "STACK" line as error. @@ -49,6 +56,7 @@ sub execstack($) { }; # sub execstack get_options( + Platform::target_options(), ); foreach my $file ( @ARGV ) { diff --git a/openmp/runtime/tools/check-instruction-set.pl b/openmp/runtime/tools/check-instruction-set.pl index 1fa787e7a5f..a63d91601b5 100755 --- a/openmp/runtime/tools/check-instruction-set.pl +++ b/openmp/runtime/tools/check-instruction-set.pl @@ -24,48 +24,34 @@ our $VERSION = "0.004"; my $hex = qr{[0-9a-f]}i; # hex digit. -# lrb_32e-specific details. +# mic-specific details. -my $mic_arch; # either knf or knc -my $mic_os; # either bsd or lin -sub bad_lrb_fmt($) { +sub bad_mic_fmt($) { # Before we allowed both elf64-x86-64-freebsd and elf-l1om-freebsd. # Now the first one is obsolete, only elf64-l1om-freebsd is allowed. my ( $fmt ) = @_; if ( 0 ) { - } elsif ( "$mic_os" eq "bsd" ) { - if ( "$mic_arch" eq "knf" ) { - return $fmt !~ m{\Aelf64-l1om(?:-freebsd)?\z}; - } else { - return $fmt !~ m{\Aelf64-x86-64(?:-freebsd)?\z}; - }; - } elsif ( "$mic_os" eq "lin" ) { - if ( 0 ) { - } elsif ( "$mic_arch" eq "knf" ) { + } elsif ( "$target_mic_arch" eq "knf" ) { return $fmt !~ m{\Aelf64-l1om?\z}; - } elsif ( "$mic_arch" eq "knc" ) { + } elsif ( "$target_mic_arch" eq "knc" ) { return $fmt !~ m{\Aelf64-k1om?\z}; } else { return 1; }; - } else { - return 1; - }; -}; # sub bad_lrb_fmt +}; # sub bad_mic_fmt -# Undesired instructions for lrb: all x87 and some other. +# Undesired instructions for mic: all x87 and some other. # AC: Since compiler 2010-06-30 x87 instructions are supported, removed the check of x87. -my $lrb_bad_re; -sub bad_lrb_instr($$) { +my $mic_bad_re; +sub bad_mic_instr($$) { my ( $instr, $args ) = @_; -# if ( "$mic_os" eq "lin" and "$mic_arch" eq "knf" ) { - if ( "$mic_os" eq "lin" or "$mic_arch" eq "knc" ) { + if ( "$target_mic_arch" eq "knc" ) { # workaround of bad code generation on KNF Linux* OS: - return ( defined( $instr ) and $instr =~ $lrb_bad_re ); + return ( defined( $instr ) and $instr =~ $mic_bad_re ); } else { - return ( defined( $instr ) and $instr =~ $lrb_bad_re or defined( $args ) and $args =~ m{xmm}i ); + return ( defined( $instr ) and $instr =~ $mic_bad_re or defined( $args ) and $args =~ m{xmm}i ); } -}; # sub bad_lrb_instr +}; # sub bad_mic_instr # lin_32-specific details. @@ -133,11 +119,7 @@ sub check_file($;$$) { $max_instructions = 100; }; # if - if ( "$mic_os" eq "bsd" ) { - execute( [ "x86_64-freebsd-objdump", "-d", $file ], -stdout => \@bulk ); - } else { - execute( [ "objdump", "-d", $file ], -stdout => \@bulk ); - } + execute( [ "x86_64-k1om-linux-objdump", "-d", $file ], -stdout => \@bulk ); my $n = 0; my $errors = 0; @@ -202,24 +184,22 @@ my $show_instructions; get_options( "max-instructions=i" => \$max_instructions, "show-instructions!" => \$show_instructions, - "mic-arch=s" => \$mic_arch, - "mic-os=s" => \$mic_os, Platform::target_options(), ); -if ( "$mic_os" eq "lin" and "$mic_arch" eq "knf" ) { - $lrb_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmpxchg16b|clevict[12])}i; +if ( "$target_os" eq "lin" and "$target_mic_arch" eq "knf" ) { + $mic_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmpxchg16b|clevict[12])}i; } else { - $lrb_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmov|cmpxchg16b|clevict[12])}i; + $mic_bad_re = qr{^(?:pause|[slm]fence|scatter|gather|cmov|cmpxchg16b|clevict[12])}i; }; if ( 0 ) { -} elsif ( $target_platform eq "lrb_32e" ) { - *bad_instr = \*bad_lrb_instr; - *bad_fmt = \*bad_lrb_fmt; +} elsif ( $target_os eq "lin" and $target_arch eq "mic" ) { + *bad_instr = \*bad_mic_instr; + *bad_fmt = \*bad_mic_fmt; } elsif ( $target_platform eq "lin_32" ) { *bad_instr = \*bad_ia32_instr; *bad_fmt = \*bad_ia32_fmt; } else { - runtime_error( "Only works on lin_32 and lrb_32e platforms." ); + runtime_error( "Only works on lin_32 and lin_mic platforms." ); }; # if # Do the work. @@ -322,7 +302,7 @@ Currently the script works only for: =over -=item C<lrb_32e> +=item C<lin_mic> Intel(R) Many Integrated Core Architecture target OS. Undesired unstructions are: all x87 instructions and some others. diff --git a/openmp/runtime/tools/check-tools.pl b/openmp/runtime/tools/check-tools.pl index ae7fb72ac79..5f6e53a51d5 100755 --- a/openmp/runtime/tools/check-tools.pl +++ b/openmp/runtime/tools/check-tools.pl @@ -190,7 +190,7 @@ sub get_intel_compiler_version($) { if ( not defined( $ic_arch ) ) { return @ret; }; # if - if ( Platform::canon_arch( $ic_arch ) ne $target_arch ) { + if ( Platform::canon_arch( $ic_arch ) ne $target_arch and not (Platform::canon_arch($ic_arch) eq "32e" and $target_arch eq "mic" )) { warning( "Target architecture is $target_arch, $tool for $ic_arch found." ); return @ret; }; # if @@ -391,7 +391,6 @@ my $fortran = 0; # Check for corresponding Fortran compiler, ifo my $clang = 0; # Check Clang Compilers. my $intel_compilers = { "lin" => { c => "icc", cpp => "icpc", f => "ifort" }, - "lrb" => { c => "icc", cpp => "icpc", f => "ifort" }, "mac" => { c => "icc", cpp => "icpc", f => "ifort" }, "win" => { c => "icl", cpp => undef, f => "ifort" }, }; diff --git a/openmp/runtime/tools/common.inc b/openmp/runtime/tools/common.inc index db13251672d..e80b68ffe6c 100644 --- a/openmp/runtime/tools/common.inc +++ b/openmp/runtime/tools/common.inc @@ -37,12 +37,20 @@ endif # !omp_os # Compiling for the Intel(R) Many Integrated Core architecture is non-trivial at the next layer # of script down, but we can make it consistent here. -ifeq "$(arch)" "mic" +ifneq "$(filter knf knc knl, $(arch))" "" # I really do mean this... - override arch:=32e + # have top-level arch=mic and then mic_arch = flavor of mic + override mic_arch:=$(arch) + override arch:=mic override mic:=yes else - override mic:=no + ifeq "$(arch)" "mic" + # default flavor of mic is knc + mic_arch?=knc + override mic:=yes + else + override mic:=no + endif endif ifeq (,$(wildcard $(omp_root)/tools/$(omp_os).inc)) @@ -74,15 +82,15 @@ ifneq "$(mic)" "no" $(error Compiling the runtime with gcc is not supported on Intel\(R\) Many Integrated Core Architecture) endif - # Magic flags for the build script! - build_args += --os=lrb --mic-arch=knc --mic-os=lin --mic-comp=offload + # Add Intel(R) Many Integrated Core Architecture kind (knf, knc, knl, etc.) + build_args += --mic-arch=$(mic_arch) # Check that the binutils for Intel(R) Many Integrated Core Architecture are available # First we see whether the objdump on the user's path supports the k1om architecture. - hask1om = $(shell if (objdump --help | grep -s k1om); then echo OK; else echo KO; fi) + hask1om = $(shell if (x86_64-k1om-linux-objdump --help | grep -s k1om); then echo OK; else echo KO; fi) ifneq "$(hask1om)" "OK" # Appropriate binutils are not already set up, so try to add them from the default place. - micBinPath = /usr/linux-k1om-4.7/x86_64-k1om-linux/bin + micBinPath = /usr/linux-k1om-4.7/bin micBinPresent = $(shell if test -d $(micBinPath); then echo OK; else echo KO; fi) ifneq "$(micBinPresent)" "OK" # We can't find them in the normal place, so complain. diff --git a/openmp/runtime/tools/extract-objects.pl b/openmp/runtime/tools/extract-objects.pl index 04be6ea82da..e9eaa3d7494 100755 --- a/openmp/runtime/tools/extract-objects.pl +++ b/openmp/runtime/tools/extract-objects.pl @@ -141,7 +141,7 @@ if ( not -w $output ) { if ( $target_os eq "win" ) { *process = \&windows; -} elsif ( $target_os eq "lin" or $target_os eq "lrb" ) { +} elsif ( $target_os eq "lin") { *process = \&linux; } elsif ( $target_os eq "mac" ) { *process = \&darwin; diff --git a/openmp/runtime/tools/lib/Platform.pm b/openmp/runtime/tools/lib/Platform.pm index 839e54f824b..2e2b8904a2b 100644 --- a/openmp/runtime/tools/lib/Platform.pm +++ b/openmp/runtime/tools/lib/Platform.pm @@ -32,12 +32,12 @@ use Uname; my @vars; BEGIN { - @vars = qw{ $host_arch $host_os $host_platform $target_arch $target_os $target_platform }; + @vars = qw{ $host_arch $host_os $host_platform $target_arch $target_mic_arch $target_os $target_platform }; } our $VERSION = "0.014"; our @EXPORT = qw{}; -our @EXPORT_OK = ( qw{ canon_arch canon_os legal_arch arch_opt }, @vars ); +our @EXPORT_OK = ( qw{ canon_arch canon_os canon_mic_arch legal_arch arch_opt }, @vars ); our %EXPORT_TAGS = ( all => [ @EXPORT_OK ], vars => \@vars ); # Canonize architecture name. @@ -54,6 +54,8 @@ sub canon_arch($) { $arch = "ppc64"; } elsif ( $arch =~ m{\Aaarch64} ) { $arch = "aarch64"; + } elsif ( $arch =~ m{\Amic} ) { + $arch = "mic"; } else { $arch = undef; }; # if @@ -61,12 +63,30 @@ sub canon_arch($) { return $arch; }; # sub canon_arch +# Canonize Intel(R) Many Integrated Core Architecture name. +sub canon_mic_arch($) { + my ( $mic_arch ) = @_; + if ( defined( $mic_arch ) ) { + if ( $mic_arch =~ m{\Aknf} ) { + $mic_arch = "knf"; + } elsif ( $mic_arch =~ m{\Aknc}) { + $mic_arch = "knc"; + } elsif ( $mic_arch =~ m{\Aknl} ) { + $mic_arch = "knl"; + } else { + $mic_arch = undef; + }; # if + }; # if + return $mic_arch; +}; # sub canon_mic_arch + { # Return legal approved architecture name. my %legal = ( "32" => "IA-32 architecture", "32e" => "Intel(R) 64", "arm" => "ARM", "aarch64" => "AArch64", + "mic" => "Intel(R) Many Integrated Core Architecture", ); sub legal_arch($) { @@ -86,6 +106,7 @@ sub canon_arch($) { "64" => "ia64", "arm" => "arm", "aarch64" => "aarch", + "mic" => "intel64", ); sub arch_opt($) { @@ -104,8 +125,6 @@ sub canon_os($) { if ( defined( $os ) ) { if ( $os =~ m{\A\s*(?:Linux|lin|l)\s*\z}i ) { $os = "lin"; - } elsif ( $os =~ m{\A\s*(?:lrb)\s*\z}i ) { - $os = "lrb"; } elsif ( $os =~ m{\A\s*(?:Mac(?:\s*OS(?:\s*X)?)?|mac|m|Darwin)\s*\z}i ) { $os = "mac"; } elsif ( $os =~ m{\A\s*(?:Win(?:dows)?(?:(?:_|\s*)?(?:NT|XP|95|98|2003))?|w)\s*\z}i ) { @@ -117,7 +136,10 @@ sub canon_os($) { return $os; }; # sub canon_os -my ( $_host_os, $_host_arch, $_target_os, $_target_arch ); +my ( $_host_os, $_host_arch, $_target_os, $_target_arch, $_target_mic_arch, $_default_mic_arch); + +# Set the default mic-arch value. +$_default_mic_arch = "knc"; sub set_target_arch($) { my ( $arch ) = canon_arch( $_[ 0 ] ); @@ -128,6 +150,15 @@ sub set_target_arch($) { return $arch; }; # sub set_target_arch +sub set_target_mic_arch($) { + my ( $mic_arch ) = canon_mic_arch( $_[ 0 ] ); + if ( defined( $mic_arch ) ) { + $_target_mic_arch = $mic_arch; + $ENV{ LIBOMP_MIC_ARCH } = $mic_arch; + }; # if + return $mic_arch; +}; # sub set_target_mic_arch + sub set_target_os($) { my ( $os ) = canon_os( $_[ 0 ] ); if ( defined( $os ) ) { @@ -149,6 +180,11 @@ sub target_options() { set_target_arch( $_[ 1 ] ) or die "Bad value of --target-architecture option: \"$_[ 1 ]\"\n"; }, + "target-mic-architecture|targert-mic-arch|mic-architecture|mic-arch=s" => + sub { + set_target_mic_arch( $_[ 1 ] ) or + die "Bad value of --target-mic-architecture option: \"$_[ 1 ]\"\n"; + }, ); return @options; }; # sub target_options @@ -205,6 +241,19 @@ if ( defined( $ENV{ LIBOMP_ARCH } ) ) { }; # if $ENV{ LIBOMP_ARCH } = $_target_arch; +# Detect target Intel(R) Many Integrated Core Architecture. +if ( defined( $ENV{ LIBOMP_MIC_ARCH } ) ) { + # Use mic arch specified in LIBOMP_MIC_ARCH. + $_target_mic_arch = canon_mic_arch( $ENV{ LIBOMP_MIC_ARCH } ); + if ( not defined( $_target_mic_arch ) ) { + die "Unknown architecture specified in LIBOMP_MIC_ARCH environment variable: \"$ENV{ LIBOMP_MIC_ARCH }\""; + }; # if +} else { + # Otherwise use default Intel(R) Many Integrated Core Architecture. + $_target_mic_arch = $_default_mic_arch; +}; # if +$ENV{ LIBOMP_MIC_ARCH } = $_target_mic_arch; + # Detect target OS. if ( defined( $ENV{ LIBOMP_OS } ) ) { # Use OS specified in LIBOMP_OS. @@ -224,6 +273,7 @@ tie( $host_arch, "Platform::host_arch" ); tie( $host_os, "Platform::host_os" ); tie( $host_platform, "Platform::host_platform" ); tie( $target_arch, "Platform::target_arch" ); +tie( $target_mic_arch, "Platform::target_mic_arch" ); tie( $target_os, "Platform::target_os" ); tie( $target_platform, "Platform::target_platform" ); @@ -269,6 +319,13 @@ tie( $target_platform, "Platform::target_platform" ); }; # sub FETCH } # package Platform::target_arch +{ package Platform::target_mic_arch; + use base "Platform::base"; + sub FETCH { + return $_target_mic_arch; + }; # sub FETCH +} # package Platform::target_mic_arch + { package Platform::target_os; use base "Platform::base"; sub FETCH { @@ -279,7 +336,11 @@ tie( $target_platform, "Platform::target_platform" ); { package Platform::target_platform; use base "Platform::base"; sub FETCH { + if ($_target_arch eq "mic") { + return "${_target_os}_${_target_mic_arch}"; + } else { return "${_target_os}_${_target_arch}"; + } }; # sub FETCH } # package Platform::target_platform @@ -330,7 +391,7 @@ the script assumes host architecture is target one. Input string is an architecture name to canonize. The function recognizes many variants, for example: C<32e>, C<Intel64>, C<Intel(R) 64>, etc. Returned string is a canononized architecture name, -one of: C<32>, C<32e>, C<64>, or C<undef> is input string is not recognized. +one of: C<32>, C<32e>, C<64>, C<arm>, C<ppc64>, C<mic>, or C<undef> is input string is not recognized. =item B<legal_arch( $arch )> @@ -347,7 +408,7 @@ recognized. =item B<canon_os( $os )> -Input string is OS name to canonize. The function recognizes many variants, for example: C<mac>, C<OS X>, etc. Returned string is a canonized OS name, one of: C<lin>, C<lrb>, +Input string is OS name to canonize. The function recognizes many variants, for example: C<mac>, C<OS X>, etc. Returned string is a canonized OS name, one of: C<lin>, C<mac>, C<win>, or C<undef> is input string is not recognized. =item B<target_options()> diff --git a/openmp/runtime/tools/message-converter.pl b/openmp/runtime/tools/message-converter.pl index 382f42e6d17..f4f4b998e6b 100755 --- a/openmp/runtime/tools/message-converter.pl +++ b/openmp/runtime/tools/message-converter.pl @@ -485,7 +485,7 @@ $input_file = $ARGV[ 0 ]; my $generate_message; -if ( $target_os =~ m{\A(?:lin|lrb|mac)\z} ) { +if ( $target_os =~ m{\A(?:lin|mac)\z} ) { $generate_message = \&generate_message_unix; } elsif ( $target_os eq "win" ) { $generate_message = \&generate_message_windows; diff --git a/openmp/runtime/tools/required-objects.pl b/openmp/runtime/tools/required-objects.pl index b378b089e7a..5d2b6a0cfaa 100755 --- a/openmp/runtime/tools/required-objects.pl +++ b/openmp/runtime/tools/required-objects.pl @@ -117,9 +117,15 @@ sub _load_symbols_nm($) { if ( %$objects ) { # Do not run nm if a set of objects is empty -- nm will try to open a.out in this case. + my $tool; + if($target_arch eq "mic") { + $tool = "x86_64-k1om-linux-nm" + } else { + $tool = "nm" + } execute( [ - "nm", + $tool, "-g", # Display only external (global) symbols. "-o", # Precede each symbol by the name of the input file. keys( %$objects ) @@ -397,10 +403,17 @@ sub copy_objects($$;$\@) { my $target = shift( @_ ); my $prefix = shift( @_ ); my $symbols = shift( @_ ); + my $tool; my @redefine; my @redefine_; my $syms_file = "__kmp_sym_pairs.log"; + if ( $target_arch eq "mic" ) { + $tool = "x86_64-k1om-linux-objcopy" + } else { + $tool = "objcopy" + } + if ( not -e $target ) { die "\"$target\" directory does not exist\n"; }; # if @@ -420,7 +433,7 @@ sub copy_objects($$;$\@) { foreach my $src ( sort( keys( %$objects ) ) ) { my $dst = cat_file( $target, get_file( $src ) ); if ( @redefine ) { - execute( [ "objcopy", "--redefine-syms", $syms_file, $src, $dst ] ); + execute( [ $tool, "--redefine-syms", $syms_file, $src, $dst ] ); } else { copy_file( $src, $dst, -overwrite => 1 ); }; # if @@ -482,7 +495,7 @@ if ( not %$base ) { if ( $target_os eq "win" ) { *load_symbols = \&_load_symbols_link; -} elsif ( $target_os eq "lin" or $target_os eq "lrb" ) { +} elsif ( $target_os eq "lin" ) { *load_symbols = \&_load_symbols_nm; } elsif ( $target_os eq "mac" ) { *load_symbols = \&_load_symbols_nm; diff --git a/openmp/runtime/tools/src/common-defs.mk b/openmp/runtime/tools/src/common-defs.mk index 252a96266ed..82a6b549fde 100644 --- a/openmp/runtime/tools/src/common-defs.mk +++ b/openmp/runtime/tools/src/common-defs.mk @@ -45,7 +45,7 @@ endif # Description: # The function return printable name of specified architecture, IA-32 architecture or Intel(R) 64. # -legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(if $(filter arm,$(1)),ARM,$(if $(filter ppc64,$(1)),PPC64,$(if $(filter aarch64,$(1)),AArch64,$(error Bad architecture specified: $(1)))))))) +legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(if $(filter arm,$(1)),ARM,$(if $(filter ppc64,$(1)),PPC64,$(if $(filter aarch64,$(1)),AArch64,$(if $(filter mic,$(1)),Intel(R) Many Integrated Core Architecture,$(error Bad architecture specified: $(1))))))))) # Synopsis: # var_name = $(call check_variable,var,list) @@ -127,10 +127,14 @@ endif # Mandatory variables passed from build.pl. # -------------------------------------------------------------------------------------------------- -os := $(call check_variable,os,lin lrb mac win) -arch := $(call check_variable,arch,32 32e 64 arm ppc64 aarch64) -platform := $(os)_$(arch) -platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64 lin_ppc64 lin_aarch64) +os := $(call check_variable,os,lin mac win) +arch := $(call check_variable,arch,32 32e 64 arm ppc64 aarch64 mic) +ifeq "$(arch)" "mic" # We want the flavor of mic (knf, knc, knl, etc.) + platform := $(os)_$(MIC_ARCH) +else + platform := $(os)_$(arch) +endif +platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lin_knc lin_knf mac_32 mac_32e win_32 win_32e win_64 lin_ppc64 lin_aarch64) # oa-opts means "os and arch options". They are passed to almost all perl scripts. oa-opts := --os=$(os) --arch=$(arch) @@ -155,7 +159,7 @@ ifeq "$(os)" "win" # win dll = .dll exe = .exe cat = $(dll) -else # lin, lrb or mac +else # lin, mic or mac asm = .s obj = .o lib = .a @@ -180,7 +184,7 @@ ifeq "$(os)" "win" touch = touch perl = perl slash = \\ -else # lin, lrb or mac +else # lin, mic or mac cp = cp -f rm = rm -f mkdir = mkdir -p diff --git a/openmp/runtime/tools/src/common-rules.mk b/openmp/runtime/tools/src/common-rules.mk index c289beb4655..a63aa0b5db1 100644 --- a/openmp/runtime/tools/src/common-rules.mk +++ b/openmp/runtime/tools/src/common-rules.mk @@ -79,9 +79,9 @@ %$(obj) : %$(asm) .rebuild $(target) - # There is a bug on lrb: icc does not work with "-x assembler-with-cpp" option, so we have + # There is a bug on mic: icc does not work with "-x assembler-with-cpp" option, so we have # to preprocess file manually and then assembly it. - ifeq "$(os)" "lrb" + ifeq "$(arch)" "mic" $(c) -E $(cpp-flags) $< > $@.tmp $(as) $(as-flags) -x assembler $(as-out)$@ $@.tmp else @@ -130,9 +130,13 @@ expand-vars = $(perl) $(tools_dir)expand-vars.pl --strict $(ev-flags) $< $@ # strip debug info in case it is requested (works for Linux* OS only) ifneq "$(dbg_strip)" "" ifeq "$(DEBUG_INFO)" "off" + ifeq "$(arch)" "mic" + x86_64-k1om-linux-objcopy --strip-debug $@ + else objcopy --strip-debug $@ endif endif + endif # -- Making dynamic library --- @@ -156,7 +160,11 @@ expand-vars = $(perl) $(tools_dir)expand-vars.pl --strict $(ev-flags) $< $@ %.dbg : %$(dll) .rebuild $(target) + ifeq "$(arch)" "mic" + x86_64-k1om-linux-objcopy --only-keep-debug $< $@ + else objcopy --only-keep-debug $< $@ + endif .PRECIOUS: %.res # Do not delete automatically created files. diff --git a/openmp/runtime/tools/src/common-tools.mk b/openmp/runtime/tools/src/common-tools.mk index 873ee886035..5c9dcb74f73 100644 --- a/openmp/runtime/tools/src/common-tools.mk +++ b/openmp/runtime/tools/src/common-tools.mk @@ -34,7 +34,7 @@ # "No rule to build .\kmp_i18n.inc". Using "./" solves the problem. cpp-flags += -I ./ # For non-x86 architecture -ifeq "$(filter 32 32e 64,$(arch))" "" +ifeq "$(filter 32 32e 64 mic,$(arch))" "" cpp-flags += $(shell pkg-config --cflags libffi) endif # Add all VPATH directories to path for searching include files. @@ -57,7 +57,7 @@ endif # --- Linux* OS, Intel(R) Many Integrated Core Architecture and OS X* definitions --- -ifneq "$(filter lin lrb mac,$(os))" "" +ifneq "$(filter lin mac,$(os))" "" # --- C/C++ --- ifeq "$(c)" "" c = icc @@ -160,6 +160,7 @@ endif # --- Linux* OS definitions --- ifeq "$(os)" "lin" +ifneq "$(arch)" "mic" # --- C/C++ --- # On lin_32, we want to maintain stack alignment to be conpatible with GNU binaries built with # compiler. @@ -212,15 +213,16 @@ ifeq "$(os)" "lin" ld-flags-dll += -Wl,-soname=$(@F) endif endif +endif # --- Intel(R) Many Integrated Core Architecture definitions --- -ifeq "$(os)" "lrb" +ifeq "$(arch)" "mic" # --- C/C++ --- # Intel(R) Many Integrated Core Architecture specific options, need clarification for purpose: #c-flags += -mmic -mP2OPT_intrin_disable_name=memcpy -mP2OPT_intrin_disable_name=memset -mGLOB_freestanding -mGLOB_nonstandard_lib -nostdlib -fno-builtin #cxx-flags += -mmic -mP2OPT_intrin_disable_name=memcpy -mP2OPT_intrin_disable_name=memset -mGLOB_freestanding -mGLOB_nonstandard_lib -nostdlib -fno-builtin - # icc for lrb has a bug: it generates dependencies for target like file.obj, while real object + # icc for mic has a bug: it generates dependencies for target like file.obj, while real object # files are named file.o. -MT is a workaround for the problem. c-flags-m += -MT $(basename $@).o cxx-flags-m += -MT $(basename $@).o |

