From owner-freebsd-ports@freebsd.org Wed Apr 20 21:33:57 2016 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 BAFD3B15A74 for ; Wed, 20 Apr 2016 21:33:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F5F173F; Wed, 20 Apr 2016 21:33:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::cc1d:822c:be3b:d53d] (unknown [IPv6:2001:7b8:3a7:0:cc1d:822c:be3b:d53d]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5ED7D2D91E; Wed, 20 Apr 2016 23:33:48 +0200 (CEST) Subject: Re: Needing help getting cad/kicad-devel compiled under FreeBSD-9 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B97FF286-6CDD-4BD9-8E42-6F6C8368F762"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Wed, 20 Apr 2016 23:33:37 +0200 Cc: FreeBSD-ports , Gerald Pfeifer Message-Id: References: To: mr X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 21:33:57 -0000 --Apple-Mail=_B97FF286-6CDD-4BD9-8E42-6F6C8368F762 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Apr 2016, at 10:28, mr wrote: > since the last update kicad seems to use GLM (math/glm) additionaly. > Compiling under FreeBSD-10 works FreeBSD-9 not. >=20 > A bugreport ( https://bugs.launchpad.net/kicad/+bug/1571393 ) for = kicad got > closed because of: > ... > As reported this doesn't appear to be a Kicad bug, so i will close = this > bug, the problems are from GLM which may be better at providing = support in > this case. > ... >=20 > Since GLM is the same in ports on FreeBSD-9/10 the Issue is probably = due to > the way FreeBSD handles the compiler/settings... >=20 > The difference seems to be that FreeBSD-10 chooses the base clang++ as > compiler, FreeBSD-9 uses g++48 from ports as compiler. > In the Makefile I have 'USES=3D...compiler:c++11-lib...'. > Shouldn't this be sufficient to select the appropriate = compiler/settings? Yes, that looks about right. > Compiling under FreeBSD-9 gives: > ... >=20 > [ 34%] Building CXX object = common/CMakeFiles/gal.dir/draw_panel_gal.cpp.o > cd /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common && > /usr/local/bin/g++48 -DHAVE_STDINT_H -DKICAD_KEEPCASE -DUSE_OPENMP > -DWXUSINGDLL -DWX_COMPATIBILITY -D_FILE_OFFSET_BITS=3D64 = -D_THREAD_SAFE > -D__WXGTK__ = -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/include > -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/. = -isystem > /usr/local/lib/wx/include/gtk2-unicode-3.0 -isystem > /usr/local/include/wx-3.0 > -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/./dialogs > -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/./widgets > = -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/./dialog_abou= t > -I/usr/local/include/cairo -I/usr/local/include > = -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/../3d-viewer > -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/../pcbnew > = -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/../polygon > -I/wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694 = -I/usr/local/include > -Wall -O2 -pipe -fstack-protector -Wl,-rpath=3D/usr/local/lib/gcc48 > -fno-strict-aliasing -Wl,-rpath=3D/usr/local/lib/gcc48 > -Wno-unused-local-typedefs -Wno-strict-aliasing -fopenmp -pthread -O2 = -pipe > -fstack-protector -Wl,-rpath=3D/usr/local/lib/gcc48 = -fno-strict-aliasing > -Wl,-rpath=3D/usr/local/lib/gcc48 -DNDEBUG -fPIC -fvisibility=3Dhidden > -fvisibility-inlines-hidden -std=3Dgnu++11 -o > CMakeFiles/gal.dir/draw_panel_gal.cpp.o -c > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/draw_panel_gal.= cpp > In file included from > /usr/local/include/glm/detail/func_exponential.hpp:132:0, > from = /usr/local/include/glm/detail/func_geometric.inl:33, > from = /usr/local/include/glm/detail/func_geometric.hpp:142, > from /usr/local/include/glm/geometric.hpp:35, > from = /usr/local/include/glm/gtc/matrix_transform.inl:33, > from = /usr/local/include/glm/gtc/matrix_transform.hpp:394, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/include/gal/opengl/ver= tex_manager.h:35, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/include/gal/opengl/ope= ngl_gal.h:35, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/draw_panel_gal.= cpp:40: > /usr/local/include/glm/detail/func_exponential.inl:43:14: error: > 'std::log2' has not been declared > using std::log2; > ^ > In file included from = /usr/local/include/glm/detail/func_common.hpp:455:0, > from = /usr/local/include/glm/detail/func_geometric.inl:34, > from = /usr/local/include/glm/detail/func_geometric.hpp:142, > from /usr/local/include/glm/geometric.hpp:35, > from = /usr/local/include/glm/gtc/matrix_transform.inl:33, > from = /usr/local/include/glm/gtc/matrix_transform.hpp:394, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/include/gal/opengl/ver= tex_manager.h:35, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/include/gal/opengl/ope= ngl_gal.h:35, > from > = /wrkdirs/usr/ports/cad/kicad-devel/work/kicad-r6694/common/draw_panel_gal.= cpp:40: > /usr/local/include/glm/detail/func_common.inl:229:16: error: = 'std::trunc' > has not been declared > using ::std::trunc; > ^ > /usr/local/include/glm/detail/func_common.inl:248:16: error: = 'std::round' > has not been declared > using ::std::round; > ^ This is because gcc48's header does not define a whole bunch of C99 math functions in the std:: namespace. E.g., /usr/local/lib/gcc48/include/c++/cmath has: 922 #if __cplusplus >=3D 201103L 923 924 #ifdef _GLIBCXX_USE_C99_MATH_TR1 ... 983 #undef log2 984 #undef log2f 985 #undef log2l ... 1032 namespace std _GLIBCXX_VISIBILITY(default) 1033 { 1034 _GLIBCXX_BEGIN_NAMESPACE_VERSION ... 1117 using ::log2; 1118 using ::log2f; 1119 using ::log2l; ... 1678 _GLIBCXX_END_NAMESPACE_VERSION 1679 } // namespace 1680 1681 #endif // _GLIBCXX_USE_C99_MATH_TR1 1682 1683 #endif // C++11 and = /usr/local/lib/gcc48/include/c++/x86_64-portbld-freebsd9.3/bits/c++config.= h has: /* Define if C99 functions or macros in should be imported in in namespace std::tr1. */ /* #undef _GLIBCXX_USE_C99_MATH_TR1 */ It looks like this file is generated at build time, so something in gcc's configure scripts is turning off the "C99_MATH_TR1" support. Then again, the name of the define is a bit strange, since this is not about , but the regular header. It is probably worth reporting a bug for the gcc port. I tried this quick hack to work around it: --- /usr/local/lib/gcc48/include/c++/cmath.orig 2016-04-14 = 07:09:27.000000000 +0200 +++ /usr/local/lib/gcc48/include/c++/cmath 2016-04-20 = 23:21:19.847854000 +0200 @@ -921,7 +921,7 @@ _GLIBCXX_END_NAMESPACE_VERSION #if __cplusplus >=3D 201103L -#ifdef _GLIBCXX_USE_C99_MATH_TR1 +#ifdef _GLIBCXX_USE_C99_MATH #undef acosh #undef acoshf @@ -1678,7 +1678,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#endif // _GLIBCXX_USE_C99_MATH_TR1 +#endif // _GLIBCXX_USE_C99_MATH #endif // C++11 You will also need to add -D_DECLARE_C99_LDBL_MATH to ${CXXFLAGS}, to enable the declaration of a number of long double functions in math.h, otherwise gcc's fails to compile with: /usr/local/lib/gcc48/include/c++/cmath:1043:11: error: '::acoshl' has = not been declared using ::acoshl; ^ -Dimitry --Apple-Mail=_B97FF286-6CDD-4BD9-8E42-6F6C8368F762 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlcX9bsACgkQsF6jCi4glqOSkgCg48mjjGW7AF1aOxJ43nAx+JaI pSgAn0xE2NiZ9so9wgCgkRypIGTcWyO8 =qmGn -----END PGP SIGNATURE----- --Apple-Mail=_B97FF286-6CDD-4BD9-8E42-6F6C8368F762--