ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.88k stars 308 forks source link

undefined reference when trying to run interactive graphics in linux x11 #211

Closed cerberuscl closed 2 months ago

cerberuscl commented 2 months ago

get this error:

λ ~/FluidX3D/ master ./make.sh Info: Detected Operating System: Linux Info: Compiling with 16 CPU cores. g++ temp/.o -o bin/FluidX3D -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL /sbin/ld: temp/graphics.o: in function key_linux(int)': graphics.cpp:(.text+0x2767): undefined reference toXkbKeycodeToKeysym' /sbin/ld: temp/graphics.o: in function update_frame(double)': graphics.cpp:(.text+0x29e7): undefined reference toXLockDisplay' /sbin/ld: graphics.cpp:(.text+0x2a26): undefined reference to XPutImage' /sbin/ld: graphics.cpp:(.text+0x2a4a): undefined reference toXUnlockDisplay' /sbin/ld: graphics.cpp:(.text+0x2a8d): undefined reference to XWarpPointer' /sbin/ld: temp/graphics.o: in functionhide_cursor()': graphics.cpp:(.text+0x2ae0): undefined reference to XCreateBitmapFromData' /sbin/ld: graphics.cpp:(.text+0x2b1c): undefined reference toXCreatePixmapCursor' /sbin/ld: graphics.cpp:(.text+0x2b39): undefined reference to XDefineCursor' /sbin/ld: graphics.cpp:(.text+0x2b48): undefined reference toXFreeCursor' /sbin/ld: graphics.cpp:(.text+0x2b57): undefined reference to XFreePixmap' /sbin/ld: temp/graphics.o: in functionshow_cursor()': graphics.cpp:(.text+0x2b85): undefined reference to XCreateFontCursor' /sbin/ld: graphics.cpp:(.text+0x2b9e): undefined reference toXDefineCursor' /sbin/ld: graphics.cpp:(.text+0x2bad): undefined reference to XFreeCursor' /sbin/ld: temp/graphics.o: in functioninput_detection()': graphics.cpp:(.text+0x3af5): undefined reference to XNextEvent' /sbin/ld: graphics.cpp:(.text+0x3cf3): undefined reference toXWarpPointer' /sbin/ld: graphics.cpp:(.text+0x3da1): undefined reference to XWarpPointer' /sbin/ld: temp/graphics.o: in functionmain': graphics.cpp:(.text+0x3f3d): undefined reference to XInitThreads' /sbin/ld: graphics.cpp:(.text+0x3f47): undefined reference toXOpenDisplay' /sbin/ld: graphics.cpp:(.text+0x3f78): undefined reference to XRRGetScreenResources' /sbin/ld: graphics.cpp:(.text+0x3f8a): undefined reference toXRRGetOutputPrimary' /sbin/ld: graphics.cpp:(.text+0x3f9c): undefined reference to XRRGetOutputInfo' /sbin/ld: graphics.cpp:(.text+0x3fb9): undefined reference toXRRGetCrtcInfo' /sbin/ld: graphics.cpp:(.text+0x3fcb): undefined reference to XRRGetScreenInfo' /sbin/ld: graphics.cpp:(.text+0x3fec): undefined reference toXRRConfigCurrentRate' /sbin/ld: graphics.cpp:(.text+0x3ffd): undefined reference to XRRFreeScreenConfigInfo' /sbin/ld: graphics.cpp:(.text+0x4005): undefined reference toXRRFreeCrtcInfo' /sbin/ld: graphics.cpp:(.text+0x400f): undefined reference to XRRFreeOutputInfo' /sbin/ld: graphics.cpp:(.text+0x4019): undefined reference toXRRFreeScreenResources' /sbin/ld: graphics.cpp:(.text+0x448a): undefined reference to XCreateWindow' /sbin/ld: graphics.cpp:(.text+0x44fe): undefined reference toXSetNormalHints' /sbin/ld: graphics.cpp:(.text+0x4552): undefined reference to XInternAtom' /sbin/ld: graphics.cpp:(.text+0x4582): undefined reference toXChangeProperty' /sbin/ld: graphics.cpp:(.text+0x45a0): undefined reference to XStoreName' /sbin/ld: graphics.cpp:(.text+0x45b3): undefined reference toXMapRaised' /sbin/ld: graphics.cpp:(.text+0x45d0): undefined reference to XCreateGC' /sbin/ld: graphics.cpp:(.text+0x4615): undefined reference toXCreateImage' /sbin/ld: graphics.cpp:(.text+0x4638): undefined reference to XSelectInput' /sbin/ld: graphics.cpp:(.text+0x468e): undefined reference toXWarpPointer' /sbin/ld: graphics.cpp:(.text+0x486f): undefined reference to XFreeGC' /sbin/ld: graphics.cpp:(.text+0x4897): undefined reference toXDestroyWindow' /sbin/ld: graphics.cpp:(.text+0x48a3): undefined reference to `XCloseDisplay' collect2: error: ld returned 1 exit status make: *** [makefile:25: bin/FluidX3D] Error 1

the benchmark run good , ascii graphics is working

ProjectPhysX commented 2 months ago

Hi @cerberuscl,

you need a Linux desktop environment with X11 to run with INTERACTIVR_GRAPHICS. The make.sh compile script does not detect a monitor on your system, so it compiles without linking the X11 library, and then compiling fails if you have INTERACTIVR_GRAPHICS enabled. If you have only a command line interface available, use INTERACTIVR_GRAPHICS_ASCII or only CLI interface and render images to hard drive with enabling the GRAPHICS module.

Kind regards, Moritz