Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MKFIT] patch mkfit to build on aarch64/ppc64 #5179

Merged
merged 2 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mkfit-2.0.0-non-x86_64-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/immintrin.h b/immintrin.h
new file mode 100644
index 0000000..363d136
--- /dev/null
+++ b/immintrin.h
@@ -0,0 +1,4 @@
+#include <stdlib.h>
+#define _mm_malloc(a, b) aligned_alloc(b, a)
+#define _mm_free(p) free(p)
+#define _mm_prefetch(a,b) __builtin_prefetch(a)
1 change: 1 addition & 0 deletions mkfit-toolfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/mkfit.xml
<environment name="INCLUDE" default="$MKFITBASE/include"/>
<environment name="LIBDIR" default="$MKFITBASE/lib"/>
</client>
<use name="tbb"/>
<runtime name="MKFIT_BASE" value="$MKFITBASE"/>
</tool>
EOF_TOOLFILE
Expand Down
19 changes: 18 additions & 1 deletion mkfit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,29 @@

Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Requires: tbb
BuildRequires: gmake
Patch0: mkfit-2.0.0-non-x86_64-fix

%prep
%setup -q -n %{n}-%{realversion}

%ifnarch x86_64
%patch0 -p1
%endif

sed -i -e 's|-std=c++14|-std=c++1z|' Makefile.config

%build
make TBB_PREFIX=$TBB_ROOT VEC_GCC="-march=core2"
%ifarch x86_64
BUILD_ARGS=VEC_GCC="-march=core2"
%endif
%ifarch aarch64
BUILD_ARGS=VEC_GCC="-march=native"
%endif
%ifarch ppc64le
BUILD_ARGS=VEC_GCC="-mcpu=native"
%endif
make %{makeprocesses} TBB_PREFIX=$TBB_ROOT ${BUILD_ARGS}

%install
mkdir %{i}/include %{i}/include/mkFit %{i}/Geoms
Expand Down