From owner-freebsd-questions@FreeBSD.ORG Wed Mar 11 11:58:57 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22810A52 for ; Wed, 11 Mar 2015 11:58:57 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D60B9ED4 for ; Wed, 11 Mar 2015 11:58:56 +0000 (UTC) Received: from r56.edvax.de (port-92-195-131-196.dynamic.qsc.de [92.195.131.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 70F1C27808; Wed, 11 Mar 2015 12:58:47 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t2BBwkre003852; Wed, 11 Mar 2015 12:58:46 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 11 Mar 2015 12:58:46 +0100 From: Polytropon To: Bernt Hansson Subject: Re: sysinfo.h Message-Id: <20150311125846.e1b7fdb5.freebsd@edvax.de> In-Reply-To: <55002A42.4070608@bananmonarki.se> References: <55002A42.4070608@bananmonarki.se> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 11:58:57 -0000 On Wed, 11 Mar 2015 12:42:58 +0100, Bernt Hansson wrote: > Hello list! > > Trying to build a program (freecad) > > I have got cmake to find libs and other programs it needs. > > running cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Release . > > results is this > -- Configuring done > -- Generating done > -- Build files have been written to: > /usr/home/bernt/vebbnerladdningar/FreeCAD_sf_master-master/FreeCAD_sf_master-master > > Then one should run make. > > make gives this error > > /usr/home/bernt/vebbnerladdningar/FreeCAD_sf_master-master/FreeCAD_sf_master-master/src/3rdParty/salomesmesh/src/SMDS/SMDS_MemoryLimit.cpp:32:25: > error: sys/sysinfo.h: No such file or directory > > Guess it's linuxism. > > What is sysinfo.h called in freebsd? FreeBSD has a sysinfo utility, see "man 8 sysinfo", which can be obtained with the "sysinfo" package. But as far as I can see, it's implemented via shell scripts. On Linux systems, sysinfo.h is a system-level header file. >From this file (example of a sysinfo.h file): http://www.scs.stanford.edu/histar/src/pkg/uclibc/include/sys/sysinfo.h More precisely: sysinfo.h is part of the GNU C library (glibc) include files, where sysinfo() is a library function, not an external program. See for example: http://www.informit.com/articles/article.aspx?p=23618&seqNum=15 Also see: http://man7.org/linux/man-pages/man2/sysinfo.2.html Let me quote: "This function is Linux-specific, and should not be used in programs intended to be portable." Summary: It's a Linuxism. :-) But maybe you can "fake" the required functionality somehow through FreeBSD's Linux ABI... There are also ports which seem to install a sysinfo.h file (search for *.plist containing "sysinfo.h"), for example devel/libgtop or lang/gnatdroid-sysroot. Maybe that's a way to get the required files? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...