From owner-freebsd-ports@freebsd.org Wed Dec 27 18:12:19 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 428E1EA5067 for ; Wed, 27 Dec 2017 18:12:19 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC556FEFA for ; Wed, 27 Dec 2017 18:12:19 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: by mailman.ysv.freebsd.org (Postfix) id 2E23CEA5066; Wed, 27 Dec 2017 18:12:19 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DC95EA5065 for ; Wed, 27 Dec 2017 18:12:19 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0E16FEF8 for ; Wed, 27 Dec 2017 18:12:18 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id vBRICGlr000664 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 27 Dec 2017 10:12:16 -0800 (PST) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56] claimed to be yv.noip.me To: "ports@freebsd.org" From: Yuri Subject: Should building for different SIMD levels be supported using flavors? Message-ID: <61cfc2b2-d121-64ad-ad80-c81ff08916f6@rawbw.com> Date: Wed, 27 Dec 2017 10:12:15 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 18:12:19 -0000 Some projects rely on SIMD to perform computations. Sometimes, utilizing specific SIMD instructions can result in 10 times better performance, so it is important for the ports system to properly support SIMD. There are some projects that do automatic run-time SIMD detection, like Embree, but there are many that do not. I proposed the solution for this using flavors, see the proposed port science/g2o: https://reviews.freebsd.org/D13610 It maps SIMD levels into port flavors. So that g2o-sse42 is for SSE42, and g2o-nosimd is not using SIMD. Later, the user will to install the flavor corresponding to his machine's SIMD support. Further, ports framework and tools (pkg) should automatically detect machine's SIMD, and install the ports with the correct SIMD flavor for it. It seems to me that this is the right solution, and that flavors fit the purpose very well. Flavors are defined as needed for situations when the whole project needs to be rebuilt, and in this case it needs to be rebuilt because SIMD instructions inside are different. Sadly, Mathieu disagreed, and asked to "Always build with the lowest available instructions." How can FreeBSD support SSE then? There should be some consistent path forward on SIMD support. Just always using the lowest SIMD isn't an answer. Yuri