From 3c903c99709fba2765bff1e0a38aeccbcc890556 Mon Sep 17 00:00:00 2001 From: cielavenir Date: Fri, 2 Jul 2021 22:57:50 +0900 Subject: [PATCH] support icx compilation --- Makefile | 11 +++++++---- applet/zlibrawstdio_compress.h | 2 +- cielbox.c | 4 +++- compile_icx.sh | 11 +++++++++++ zlibrawstdio | 1 + zlibrawstdio2 | 1 + 6 files changed, 24 insertions(+), 6 deletions(-) create mode 100755 compile_icx.sh create mode 120000 zlibrawstdio create mode 120000 zlibrawstdio2 diff --git a/Makefile b/Makefile index a1691d8..670abb9 100644 --- a/Makefile +++ b/Makefile @@ -14,11 +14,14 @@ export CC := $(PREFIX)clang #export CXX := $(PREFIX)clang++ -stdlib=libc++ export CXX := $(PREFIX)clang++ else ifneq ($(OPEN64),) -export CC := $(PREFIX)opencc -export CXX := $(PREFIX)openCC +export CC := $(PREFIX)opencc +export CXX := $(PREFIX)openCC else ifneq ($(ICC),) -export CC := $(PREFIX)icc -export CXX := $(PREFIX)icpc +export CC := $(PREFIX)icc +export CXX := $(PREFIX)icpc +else ifneq ($(ICX),) +export CC := $(PREFIX)icx +export CXX := $(PREFIX)icpx else export CC := $(PREFIX)gcc export CXX := $(PREFIX)g++ diff --git a/applet/zlibrawstdio_compress.h b/applet/zlibrawstdio_compress.h index 9fba6ff..d5e22a3 100644 --- a/applet/zlibrawstdio_compress.h +++ b/applet/zlibrawstdio_compress.h @@ -449,7 +449,7 @@ static int zlibrawstdio_main(const int argc, const char **argv){ POPT_TABLEEND, }; optCon = poptGetContext(argv[0], argc, argv, optionsTable, 0); - poptSetOtherOptionHelp(optCon, "{-cz9 enc.bz2} or {-cd dec.bin}"); + poptSetOtherOptionHelp(optCon, "{-cz9 enc.gz} or {-cd dec.bin}"); for(;(optc=poptGetNextOpt(optCon))>=0;){ switch(optc){ diff --git a/cielbox.c b/cielbox.c index c0b9b98..8918d92 100644 --- a/cielbox.c +++ b/cielbox.c @@ -162,7 +162,9 @@ __attribute__((noreturn)) static void usage(){ ; const char *compiler= -#if defined(__INTEL_COMPILER) +#if defined(__INTEL_CLANG_COMPILER) + " [icx]" +#elif defined(__INTEL_COMPILER) " [icc]" #elif defined(__OPENCC__) " [opencc]" diff --git a/compile_icx.sh b/compile_icx.sh new file mode 100755 index 0000000..fd8d35e --- /dev/null +++ b/compile_icx.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if ! type icpc >/dev/null 2>/dev/null && [ -f /opt/intel/oneapi/setvars.sh ]; then + . /opt/intel/oneapi/setvars.sh +fi +make clean +echo "Self (icx)" +#ZLIBNG_X86=1 ICC=1 ARCH="-march=core2 -mmmx -msse -msse2 -msse3 -pthread" LIBS="-pthread -ldl" SUFF=_icc make +ZLIBNG_X86=1 ICX=1 ARCH="-march=native -pthread" LIBS="-pthread -ldl" SUFF=_icx make +make clean + +upx --best --lzma cielbox_icx diff --git a/zlibrawstdio b/zlibrawstdio new file mode 120000 index 0000000..ea85061 --- /dev/null +++ b/zlibrawstdio @@ -0,0 +1 @@ +cielbox \ No newline at end of file diff --git a/zlibrawstdio2 b/zlibrawstdio2 new file mode 120000 index 0000000..ea85061 --- /dev/null +++ b/zlibrawstdio2 @@ -0,0 +1 @@ +cielbox \ No newline at end of file