diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-16 12:54:51 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-16 12:54:51 +0000 |
commit | d315ceac18e5129ba5836f450bbf695093848f5a (patch) | |
tree | 7eba0a538759cd608436bb4e45750cb3e5d7b718 /openmp/runtime/src | |
parent | 44480078857a2f211c2b4c49308186180b041c8f (diff) | |
download | bcm5719-llvm-d315ceac18e5129ba5836f450bbf695093848f5a.tar.gz bcm5719-llvm-d315ceac18e5129ba5836f450bbf695093848f5a.zip |
cleanup changes of building for Intel(R) Many Integrated Core Architecture
llvm-svn: 226271
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/defs.mk | 4 | ||||
-rw-r--r-- | openmp/runtime/src/makefile.mk | 131 |
2 files changed, 56 insertions, 79 deletions
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) $< |