package init

This commit is contained in:
ultra_planet 2020-02-14 16:00:28 +08:00
parent 9db2146841
commit 7c426c5f2e
8 changed files with 311 additions and 0 deletions

BIN
2018_U5.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,38 @@
diff -up tbb-2018_U5/build/common_rules.inc\~ tbb-2018_U5/build/common_rules.inc
--- tbb-2018_U5/build/common_rules.inc~ 2018-06-19 10:04:20.000000000 -0600
+++ tbb-2018_U5/build/common_rules.inc 2018-07-03 11:18:03.540252098 -0600
@@ -136,7 +136,7 @@ LINK_FILES+=$(TEST_LIBS)
# Customizations
$(KNOWN_WARNINGS): %.$(OBJ): %.cpp
- $(CPLUS) $(COMPILE_ONLY) $(subst $(WARNING_KEY),,$(CPLUS_FLAGS)) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $<
+ $(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $<
tbb_misc.$(OBJ): version_string.ver
tbb_misc.$(OBJ): INCLUDES+=$(INCLUDE_KEY).
diff -up tbb-2018_U5/build/Makefile.tbbmalloc\~ tbb-2018_U5/build/Makefile.tbbmalloc
--- tbb-2018_U5/build/Makefile.tbbmalloc~ 2018-07-03 11:16:37.945377902 -0600
+++ tbb-2018_U5/build/Makefile.tbbmalloc 2018-07-03 11:16:58.872102659 -0600
@@ -51,7 +51,7 @@ ORIG_LINK_MALLOC.LIB:=$(LINK_MALLOC.LIB)
MALLOC_CPLUS.OBJ = backend.$(OBJ) large_objects.$(OBJ) backref.$(OBJ) tbbmalloc.$(OBJ)
MALLOC.OBJ := $(MALLOC_CPLUS.OBJ) $(MALLOC_ASM.OBJ) itt_notify_malloc.$(OBJ) frontend.$(OBJ)
PROXY.OBJ := proxy.$(OBJ) tbb_function_replacement.$(OBJ)
-M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(CXXFLAGS) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
+M_CPLUS_FLAGS := $(CXXFLAGS) -fno-strict-aliasing $(DEFINE_KEY)__TBBMALLOC_BUILD=1
M_INCLUDES := $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
# Suppress superfluous warnings for TBBMalloc compilation
diff -dup tbb-2018_U5/build/Makefile.test\~ tbb-2018_U5/build/Makefile.test
--- tbb-2018_U5/build/Makefile.test~ 2018-06-19 10:04:20.000000000 -0600
+++ tbb-2018_U5/build/Makefile.test 2018-07-03 11:18:53.651592978 -0600
@@ -272,7 +272,7 @@ test_tbb_plain: $(TEST_PREREQUISITE) $(T
# For deprecated files, we don't mind warnings etc., thus compilation rules are most relaxed
-CPLUS_FLAGS_DEPRECATED = $(DEFINE_KEY)__TBB_TEST_DEPRECATED=1 $(subst $(WARNING_KEY),,$(CPLUS_FLAGS)) $(WARNING_SUPPRESS) $(INCLUDE_KEY)$(tbb_root)/src/test
+CPLUS_FLAGS_DEPRECATED = $(DEFINE_KEY)__TBB_TEST_DEPRECATED=1 $(CPLUS_FLAGS) $(WARNING_SUPPRESS) $(INCLUDE_KEY)$(tbb_root)/src/test
TEST_TBB_OLD.OBJ = test_concurrent_vector_v2.$(OBJ) test_concurrent_queue_v2.$(OBJ) test_mutex_v2.$(OBJ) test_task_scheduler_observer_v3.$(OBJ)
$(TEST_TBB_OLD.OBJ): CPLUS_FLAGS := $(CPLUS_FLAGS_DEPRECATED)
Diff finished. Tue Jul 3 11:19:32 2018

14
tbb-4.0-mfence.patch Normal file
View File

@ -0,0 +1,14 @@
diff -up tbb44_20151115oss/include/tbb/machine/linux_ia32.h\~ tbb44_20151115oss/include/tbb/machine/linux_ia32.h
--- tbb44_20151115oss/include/tbb/machine/linux_ia32.h~ 2015-11-25 03:49:14.000000000 -0700
+++ tbb44_20151115oss/include/tbb/machine/linux_ia32.h 2016-01-14 20:29:45.251333321 -0700
@@ -34,7 +34,7 @@
#define __TBB_control_consistency_helper() __TBB_compiler_fence()
#define __TBB_acquire_consistency_helper() __TBB_compiler_fence()
#define __TBB_release_consistency_helper() __TBB_compiler_fence()
-#define __TBB_full_memory_fence() __asm__ __volatile__("mfence": : :"memory")
+#define __TBB_full_memory_fence() __sync_synchronize()
#if __TBB_ICC_ASM_VOLATILE_BROKEN
#define __TBB_VOLATILE
Diff finished. Thu Jan 14 20:30:12 2016

37
tbb-4.4-cxxflags.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up tbb-2018_U2/build/linux.gcc.inc\~ tbb-2018_U2/build/linux.gcc.inc
--- tbb-2018_U2/build/linux.gcc.inc~ 2017-12-06 10:29:49.000000000 -0700
+++ tbb-2018_U2/build/linux.gcc.inc 2018-01-22 20:47:07.148422967 -0700
@@ -68,10 +68,10 @@ ifneq (,$(shell gcc -dumpversion | egrep
endif
ifeq ($(cfg), release)
- CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
- CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
+ CPLUS_FLAGS = $(CXXFLAGS) -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD
endif
TBB_ASM.OBJ=
diff -up tbb-2018_U2/build/Makefile.tbbmalloc\~ tbb-2018_U2/build/Makefile.tbbmalloc
--- tbb-2018_U2/build/Makefile.tbbmalloc~ 2017-12-06 10:29:49.000000000 -0700
+++ tbb-2018_U2/build/Makefile.tbbmalloc 2018-01-22 20:47:30.104350662 -0700
@@ -51,7 +51,7 @@ ORIG_LINK_MALLOC.LIB:=$(LINK_MALLOC.LIB)
MALLOC_CPLUS.OBJ = backend.$(OBJ) large_objects.$(OBJ) backref.$(OBJ) tbbmalloc.$(OBJ)
MALLOC.OBJ := $(MALLOC_CPLUS.OBJ) $(MALLOC_ASM.OBJ) itt_notify_malloc.$(OBJ) frontend.$(OBJ)
PROXY.OBJ := proxy.$(OBJ) tbb_function_replacement.$(OBJ)
-M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
+M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(CXXFLAGS) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
M_INCLUDES := $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
# Suppress superfluous warnings for TBBMalloc compilation
@@ -86,7 +86,7 @@ $(MALLOC.DLL) $(MALLOCPROXY.DLL): CPLUS_
$(MALLOC.DLL) $(MALLOCPROXY.DLL): M_CPLUS_FLAGS += $(SDL_FLAGS)
$(MALLOC.DLL): BUILDING_LIBRARY = $(MALLOC.DLL)
$(MALLOC.DLL): $(MALLOC.OBJ) $(MALLOC.RES) $(MALLOC_NO_VERSION.DLL)
- $(subst $(CPLUS),$(CONLY),$(LIB_LINK_CMD)) $(LIB_OUTPUT_KEY)$(MALLOC.DLL) $(MALLOC.OBJ) $(MALLOC.RES) $(LIB_LINK_LIBS) $(MALLOC_LINK_FLAGS)
+ $(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(MALLOC.DLL) $(MALLOC.OBJ) $(MALLOC.RES) $(LIB_LINK_LIBS) $(MALLOC_LINK_FLAGS)
ifneq (,$(MALLOCPROXY.DEF))
tbbmallocproxy.def: $(MALLOCPROXY.DEF)

5
tbb.pc Normal file
View File

@ -0,0 +1,5 @@
Name: Threading Building Blocks
Description: The Threading Building Blocks library abstracts low-level threading details
URL: http://www.threadingbuildingblocks.org/
Version: _openEuler_VERSION
Libs: -ltbb

207
tbb.spec Normal file
View File

@ -0,0 +1,207 @@
Name: tbb
Version: 2018.5
Release: 4
Summary: Threading Building Blocks lets you easily write parallel C++ programs
License: ASL 2.0
URL: http://threadingbuildingblocks.org/
Source0: https://github.com/01org/tbb/archive/2018_U5.tar.gz
Source6: tbb.pc
Source7: tbbmalloc.pc
Source8: tbbmalloc_proxy.pc
Patch1: tbb-4.4-cxxflags.patch
Patch2: tbb-4.0-mfence.patch
Patch3: tbb-2018U5-dont-snip-Wall.patch
BuildRequires: gcc-c++ swig python2-devel python3-devel
%description
Threading Building Blocks (TBB) lets you easily write parallel C++ programs that
take full advantage of multicore performance, that are portable, composable and
have future-proof scalability.
%package devel
Summary: C++ headers and shared development libraries of TBB
Requires: tbb%{?_isa} = %{version}-%{release}
%description devel
The Threading Building Blocks (TBB) C++ libraries including Header files and
shared object symlinks.
%package help
Summary: Documents for tbb
Buildarch: noarch
Requires: man info
Provides: bundled(jquery) tbb-doc = %{version}-%{release}
Obsoletes: tbb-doc < %{version}-%{release}
%description help
Man pages and other related documents for tbb.
%package -n python2-tbb
Summary: TBB module of Python 2
%{?python_provide:%python_provide python2-tbb}
%description -n python2-tbb
TBB module of Python 2
%package -n python3-tbb
Summary: TBB module of Python 3
%{?python_provide:%python_provide python3-tbb}
%description -n python3-tbb
TBB module of Python 3
%prep
%autosetup -n tbb-2018_U5 -p1
sed -i 's/"`hostname -s`" ("`uname -m`"/openEulerbuild (%{_arch}/' \
build/version_info_linux.sh
sed -i 's/-mrtm//' build/linux.gcc.inc
sed -i 's,env python,python2,' python/TBB.py python/tbb/__*.py
sed -i '/^#!/d' python/tbb/{pool,test}.py
if [ "%{_libdir}" != "%{_prefix}/lib" ]; then
sed -i.orig 's/"lib"/"%{_lib}"/' cmake/TBBMakeConfig.cmake
touch -r cmake/TBBMakeConfig.cmake.orig cmake/TBBMakeConfig.cmake
rm cmake/TBBMakeConfig.cmake.orig
fi
cp -a python python3
sed -i 's,python,python3,g' python3/Makefile python3/rml/Makefile
sed -i 's,python2,python3,' python3/TBB.py python3/tbb/__*.py
%build
%ifarch %{ix86}
cp -a build build.orig
make %{?_smp_mflags} tbb_build_prefix=obj stdver=c++14 \
CXXFLAGS="$RPM_OPT_FLAGS -march=pentium4 -msse2" \
LDFLAGS="-Wl,--as-needed $RPM_LD_FLAGS"
mv build build.sse2
mv build.orig build
%endif
%make_build tbb_build_prefix=obj stdver=c++14 \
CXXFLAGS="$RPM_OPT_FLAGS" \
LDFLAGS="-Wl,--as-needed $RPM_LD_FLAGS"
%define pcsource {%{SOURCE6} %{SOURCE7} %{SOURCE8}}
for pcfile in %{pcsource}; do
base=$(basename ${pcfile})
sed 's/_openEuler_VERSION/%{version}/' ${pcfile} > ${base}
touch -r ${pcfile} ${base}
done
. build/obj_release/tbbvars.sh
pushd python
%make_build -C rml stdver=c++14 \
CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
PIC_KEY="-fPIC -Wl,--as-needed" LDFLAGS="$RPM_LD_FLAGS"
cp -p rml/libirml.so* .
%py2_build
popd
pushd python3
%make_build -C rml stdver=c++14 \
CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
PIC_KEY="-fPIC -Wl,--as-needed" LDFLAGS="$RPM_LD_FLAGS"
cp -p rml/libirml.so* .
%py3_build
popd
%check
make test tbb_build_prefix=obj stdver=c++14 CXXFLAGS="$RPM_OPT_FLAGS"
%install
mkdir -p %{buildroot}/%{_libdir}
mkdir -p %{buildroot}/%{_includedir}
%ifarch %{ix86}
mkdir -p %{buildroot}/%{_libdir}/sse2
pushd build.sse2/obj_release
for file in libtbb{,malloc{,_proxy}}; do
install -p -D -m 755 ${file}.so.2 %{buildroot}/%{_libdir}/sse2
done
popd
%endif
pushd build/obj_release
for file in libtbb{,malloc{,_proxy}}; do
install -p -D -m 755 ${file}.so.2 %{buildroot}/%{_libdir}
ln -s $file.so.2 %{buildroot}/%{_libdir}/$file.so
done
popd
pushd include
find tbb -type f ! -name \*.htm\* -exec install -p -D -m 644 {} \
%{buildroot}/%{_includedir}/{} \;
popd
%define pcsource {%{SOURCE6} %{SOURCE7} %{SOURCE8}}
for file in %{pcsource}; do
install -p -D -m 644 $(basename ${file}) \
%{buildroot}/%{_libdir}/pkgconfig/$(basename ${file})
done
# Install the rml headers
mkdir -p %{buildroot}%{_includedir}/rml
cp -p src/rml/include/*.h %{buildroot}%{_includedir}/rml
. build/obj_release/tbbvars.sh
pushd python
%py2_install
chmod a+x %{buildroot}%{python2_sitearch}/TBB.py
chmod a+x %{buildroot}%{python2_sitearch}/tbb/__*.py
cp -p libirml.so.1 %{buildroot}%{_libdir}
ln -s libirml.so.1 %{buildroot}%{_libdir}/libirml.so
popd
pushd python3
%py3_install
chmod a+x %{buildroot}%{python3_sitearch}/TBB.py
chmod a+x %{buildroot}%{python3_sitearch}/tbb/__*.py
cp -p libirml.so.1 %{buildroot}%{_libdir}
popd
mkdir -p %{buildroot}%{_libdir}/cmake
cp -a cmake %{buildroot}%{_libdir}/cmake/tbb
rm %{buildroot}%{_libdir}/cmake/tbb/README.rst
%ldconfig_scriptlets libs
%files
%defattr(-,root,root)
%license LICENSE
%{_libdir}/libirml.so.1
%{_libdir}/*.so.2
%ifarch %{ix86}
%{_libdir}/sse2/*.so.2
%endif
%files devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/*.pc
%{_includedir}/tbb
%{_includedir}/rml
%{_libdir}/cmake/
%{_libdir}/*.so
%files help
%defattr(-,root,root)
%doc doc/Release_Notes.txt doc/html README README.md cmake/README.rst CHANGES
%files -n python2-tbb
%doc python/index.html
%{python2_sitearch}/TBB*
%{python2_sitearch}/tbb/
%files -n python3-tbb
%doc python3/index.html
%{python3_sitearch}/TBB*
%{python3_sitearch}/tbb/
%{python3_sitearch}/__pycache__/TBB*
%changelog
* Fri Feb 14 2020 lingsheng <lingsheng@huawei.com> - 2018.5-4
- Package init

5
tbbmalloc.pc Normal file
View File

@ -0,0 +1,5 @@
Name: Threading Building Blocks Scalable Allocator
Description: Implementation of Scalable Memory Allocator of Threading Building Blocks
URL: http://www.threadingbuildingblocks.org/
Version: _openEuler_VERSION
Libs: -ltbbmalloc

5
tbbmalloc_proxy.pc Normal file
View File

@ -0,0 +1,5 @@
Name: Threading Building Blocks Scallable Malloc Proxy
Description: Implementation of proxy that redirects memory allocation calls to TBB Scalable Memory Allocator
URL: http://www.threadingbuildingblocks.org/
Version: _openEuler_VERSION
Libs: -ltbbmalloc_proxy -ltbbmalloc