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: > ================================================== > CFLAGS = -Wall -Wextra -pthread -I/usr/local/include > -I/usr/local/include/SDL -O3 -march=native > > LFLAGS = -Wall -L/usr/local/lib > > lennardjones : $(OBJS) > $(CC) $(LFLAGS) -o lennardjones $(OBJS) -lSDL -lSDL_gfx -lGLU > ================================================== > > It would be interesting to hear feedback. (Basic controls are: up-arrow add > 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 simple test case is the following: py...@nox:~% cat test.c int main() {} py...@nox:~% cc -o test test.c -L/usr/local/lib -lSDL -lGL py...@nox:~% ./test zsh: segmentation fault (core dumped) ./test Then I attempted to switch the arguments around... py...@nox:~% cc -o test test.c -L/usr/local/lib -lGL -lSDL py...@nox:~% ./test py...@nox:~% Voila! (Admittedly much to my surprise ;)) So then I changed the Makefile to use these libraries: -lGLU -lSDL -lSDL_gfx. Result: a perfectly working ./lennardjones. The only minor issue is that it presented me with exactly one option: py...@nox:~/temp/lennard-jones-gas-3d% ./lennardjones Current pixel depth: 32 Available Modes 0 => 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 this library order works around. The actual problem is still a mystery to me. It might be worthwhile to post a bugreport on the nvnews.net FreeBSD forum. Best regards, Pieter de Goeje _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"