Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0KnP-001ott-1l for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 14:44:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0KnN-009XvK-1n for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 14:44:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0KnN-009XvA-03 for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 14:44:21 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0KnI-00000001cdh-2DXC for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 14:44:20 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-48535a0ef86so31957125e9.1 for ; Wed, 11 Mar 2026 07:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773240254; x=1773845054; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=k7602Un16fYxxcdBAzHJUcPBKJB+eplfcMNxODLnJeo=; b=IzOp4qR3p3RjIxSbBoT28qjx/Oq00G4GIUvkmyZGfZQBjN0XQpRk3GzdHEagjqloiG K4zCa5LdiXof2ExGGSzBX7u7VWpMkDaCky9+yiuCD3LBHhz0FkSMCPaeeW6znS1E2jsM lKYWSLdz5wqHddxEkPrx01gUPUdHGtjwV9aJGtKtPXnPFpJwEW5H7VeYpbPfidG8Cvx1 v8aKJDbdj2CRNx2gD9+GVj+BkD74QpknDBeIsoHVOtjefpY9S2z4A95ymfIPalp75pAW Is7ydGcL39jPWXYwwXkz7h362+idvYq2LKSIrMs63sSIgNwJH57dPM1n0tieEEmrrItz 4u5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773240254; x=1773845054; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k7602Un16fYxxcdBAzHJUcPBKJB+eplfcMNxODLnJeo=; b=U5IEpa8uwAtPnUs5/YdS4ocCG5liY8zUJYdlt6NL7hL/2h7h74fj7m/SbuA66knAEw HhdhlLT2NZ4LkKRRvnseJUIRRkqmwr2PygYKtCx/sLW+nz8gBz8sANzqOHVpy6JLtvv4 vc/W+N0Ul6uh5/30aFQpTCqEldx+XLjRByOU6ISIG5Kvx58vKUSPuVpC06UOHs6Lpt+0 tCY1gNg79TyB9BHx+yGD0aIk+t4DAhFo1cdR7kk+7LuSPL1vmbLb80GyADJeazVWkVbg vSEi5wqSAdvvIDWzSj21PcAjqvf7SKBLrwMD++jK8M/uObu3N48gTkx2W+Mle22bQHQl iBNw== X-Gm-Message-State: AOJu0YzGclCvAgRIdcKQFh9orvETb4+O8Afyf7eRN6HFIiLZusQpwyZ5 5Xrydxcze9Rj8o22gRzJaAhAY2lpmZ+FJO62c+e+YONrjcQc2BF0x0jyQCpshQ== X-Gm-Gg: ATEYQzxz2T9TvGm5z80PXb1+WLTqfYg0H6tE1fDf1d1fihfq3P3lA8bHLEGF1aIZzpK qj8jLHqfSRsBfQqWwvxeqANPOZUAaY1MTyGX7JeSa9jVy8YWzVV1T6BHZFA9d2KMn2QebEAo1Hg t+R0Kmtf5sh2wQOYuBIvUjg+tCa442tPE4fulYJxbHGSyHMjjD1zK2Q+a7M7WLSgvaue5cXdDow aEUUQgMK2r6awwUKM8s8rKvX8IkVskEvifflr0P85aDEjbRY1gYxCQ67waN9A9D32aIafMqSKXc w5qrJ1ivq3xKY6dWhDbJweK7x5TKfJPUy3xeoH5hd2KSG2xR1M6iOw7zVcG3ULtMeuwJFSFrgcZ wowY2bOOX+j5AgenvnqUoRHoLr4eXx+1LjPcJun/+SqgMSort7U1/gXxUPj4icCA8ZwR1veI4Lo KxeuEWMt9Wzg56eFNaPSve45bv/KQcrucg/cItEVOwL4HyUBeK73+G0YcmRfVTHE1WDB0Kel44G ZrwMLbH3phghok/f3jVgGtmz+gxy/em/b7HHrccVP8zonutKR3FnZswZQ== X-Received: by 2002:a05:600c:4e43:b0:485:3fd1:992c with SMTP id 5b1f17b1804b1-4854b0a6a05mr46192395e9.1.1773240253853; Wed, 11 Mar 2026 07:44:13 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4854a2eea84sm36312285e9.1.2026.03.11.07.44.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 07:44:13 -0700 (PDT) Date: Wed, 11 Mar 2026 14:44:11 +0000 From: Bertrand Drouvot To: pgsql-hackers@lists.postgresql.org Subject: Make Intel's ICX compiler working Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0i28wJn1lGGn4uT+" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0i28wJn1lGGn4uT+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi hackers, After having worked on [1], I tried to make use of the Intel's ICX compiler [2]. While the compilation was ok for both autoconf and meson (meson version has to be 0.64 or greater, see [3] that added the ICX support), I ran into a couple of issues when running the test suite. 1/ Issue on floating point The tests were failing with issues such as: --- /home/postgres/postgresql/postgres/src/test/regress/expected/time.out +++ /home/postgres/postgresql/postgres/src/test/regress/results/time.out @@ -225,8 +225,8 @@ (1 row) SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401'); - date_part --------------- - 48625.575401 + date_part +-------------------- + 48625.575400999995 The reason is that ICX defaults to -fp-model=fast enabling unsafe floating-point optimizations (see [4]). This is the same class of optimizations that we guard against by rejecting -ffast-math in autoconf (BTW, we don't guard against in meson, I think we should do the same, and it has been proposed in [5]). The issue is solved by using the ICX -fp-model=precise flag (see [6]). 2/ Issue on ICX's default runtime libraries For example, I was observing: postgres: postgres regression [local] CREATE SUBSCRIPTION: Relink `/opt/intel/oneapi/compiler/2025.3/lib/libimf.so' with `/lib/x86_64-linux-gnu/libm.so.6' for IFUNC symbol `cosf' followed by a SIGSEGV. The reason is that ICX by default links against Intel runtime libraries such as libimf.so, which provide IFUNC-based replacements for standard math functions (e.g. cosf). When shared libraries built with ICX are loaded into a process that also uses the system libm.so.6, the dynamic linker encounters conflicting IFUNC resolvers and segfaults. The issue is solved by making use of -no-intel-lib ([7]). I think that it makes sense to have ICX working (we took care of ICC in the past), so PFA, a patch implementing those changes for both autoconf and meson. Remarks: For autoconf, ICX is detected thanks to the __INTEL_LLVM_COMPILER macro (see, [8]) and for meson with the compiler id "intel-llvm" (see [9]). With those in place the tests run without any issues. Regarding -no-intel-lib, we may want specific libraries to exclude, but excluding all looks safer. We could also think about having some BF animals with ICX and/or maybe a dedicated cirrus task. Looking forward to your feedback. [1]: https://postgr.es/m/aa73q1aT0A3/vke/%40ip-10-97-1-34.eu-west-3.compute.internal [2]: https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.html [3]: https://mesonbuild.com/Release-notes-for-0-64-0.html [4]: https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html [5]: https://postgr.es/m/abFXfKC8zR0Oclon%40ip-10-97-1-34.eu-west-3.compute.internal [6]: https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2025-1/fp-model-fp.html [7]: https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2025-1/no-intel-lib-qno-intel-lib.html [8]: https://www.intel.com/content/www/us/en/developer/articles/technical/use-predefined-macros-for-specific-code-for-intel-dpcpp-compiler-intel-cpp-compiler-intel-cpp-compiler-classic.html [9]: https://mesonbuild.com/Reference-tables.html Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --0i28wJn1lGGn4uT+ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-Make-Intel-s-ICX-compiler-working.patch"