From owner-freebsd-questions@FreeBSD.ORG Wed Dec 23 21:38:03 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE275106568D for ; Wed, 23 Dec 2009 21:38:03 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from mx.utwente.nl (mx2.utsp.utwente.nl [130.89.2.13]) by mx1.freebsd.org (Postfix) with ESMTP id 314A08FC20 for ; Wed, 23 Dec 2009 21:38:02 +0000 (UTC) Received: from nox.student.utwente.nl (nox.student.utwente.nl [130.89.165.91]) by mx.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id nBNKs79e026047; Wed, 23 Dec 2009 21:54:08 +0100 From: Pieter de Goeje To: Richard Mace Date: Wed, 23 Dec 2009 21:54:07 +0100 User-Agent: KMail/1.9.10 References: <200912221736.20023.macerl@telkomsa.net> <200912230320.29577.pieter@degoeje.nl> <200912230542.28400.macerl@telkomsa.net> In-Reply-To: <200912230542.28400.macerl@telkomsa.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200912232154.07830.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact icts.servicedesk@utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: Roland Smith , freebsd-questions@freebsd.org, Roger Subject: Re: Help building/running SDL/OpenGL code X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2009 21:38:03 -0000 On Wednesday 23 December 2009 04:42:28 Richard Mace wrote: > Incidentally, if there is anyone out there with newer hardware who is > interested in building the code I am talking about you can find it at: > > http://physics.ukzn.ac.za/~richm/courses/phys110/lennard-jones-3d.html > > You'll need to change the following lines in the Makefile to get it to > successfully build under FreeBSD: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > CFLAGS =3D -Wall -Wextra -pthread -I/usr/local/include > -I/usr/local/include/SDL -O3 -march=3Dnative > > LFLAGS =3D -Wall -L/usr/local/lib > > lennardjones : $(OBJS) > =A0 =A0 =A0 =A0 $(CC) $(LFLAGS) -o lennardjones $(OBJS) -lSDL -lSDL_gfx -= lGLU > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > > It would be interesting to hear feedback. (Basic controls are: up-arrow a= dd > heat to crystal; down-arrow cool down gas/crystal. There are a bunch of > others -- look in main.c). You are welcome to do whatever you wish with my > code. Arrr. Same problem here at startup: segfault in glXGetFBConfigAttribSGIX. A= =20 simple test case is the following: pyotr@nox:~% cat test.c int main() {} pyotr@nox:~% cc -o test test.c -L/usr/local/lib -lSDL -lGL pyotr@nox:~% ./test zsh: segmentation fault (core dumped) ./test Then I attempted to switch the arguments around... pyotr@nox:~% cc -o test test.c -L/usr/local/lib -lGL -lSDL pyotr@nox:~% ./test pyotr@nox:~% Voila! (Admittedly much to my surprise ;)) So then I changed the Makefile to use these libraries: -lGLU -lSDL -lSDL_gf= x.=20 Result: a perfectly working ./lennardjones. The only minor issue is that it= =20 presented me with exactly one option: pyotr@nox:~/temp/lennard-jones-gas-3d% ./lennardjones Current pixel depth: 32 Available Modes 0 =3D> 3840 x 1200 Select your preferred video mode: So apparently I prefer mode 0 :D. It run fine (and smooth) though. It is clear something goes wrong during the runtime linking process, which= =20 this library order works around. The actual problem is still a mystery to m= e.=20 It might be worthwhile to post a bugreport on the nvnews.net FreeBSD forum. Best regards, Pieter de Goeje