Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile on ArchLinux #1

Open
terencode opened this issue May 24, 2020 · 2 comments
Open

Unable to compile on ArchLinux #1

terencode opened this issue May 24, 2020 · 2 comments

Comments

@terencode
Copy link

terencode commented May 24, 2020

Hey, I wanted to try your project you wrote about on dev.to but I'm unfortunately unable to compile link on ArchLinux:

[ 14%] Building C object CMakeFiles/oclbhgs.dir/main.c.o
[ 28%] Building C object CMakeFiles/oclbhgs.dir/sources/logics/galaxy.c.o
[ 42%] Building C object CMakeFiles/oclbhgs.dir/sources/logics/body.c.o
[ 57%] Building C object CMakeFiles/oclbhgs.dir/sources/logics/cell.c.o
[ 71%] Building C object CMakeFiles/oclbhgs.dir/sources/logics/ocl.c.o
/home/terence/oclbhgs/sources/logics/ocl.c: In function ‘ocl_init’:
/home/terence/oclbhgs/sources/logics/ocl.c:92:5: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]
   92 |     ocl->queue = clCreateCommandQueue(ocl->ctx, ocl->device, 0, &ocl->err);
      |     ^~~
In file included from /home/terence/oclbhgs/sources/logics/../headers/../kernel_headers/ocl.h:14,
                 from /home/terence/oclbhgs/sources/logics/../headers/ocl.h:8,
                 from /home/terence/oclbhgs/sources/logics/ocl.c:18:
/usr/include/CL/cl.h:1443:1: note: declared here
 1443 | clCreateCommandQueue(cl_context                     /* context */,
      | ^~~~~~~~~~~~~~~~~~~~
/home/terence/oclbhgs/sources/logics/ocl.c:124:66: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
  124 |         if (fread(source_code, source_file_size, 1, source_file) < 0) {
      |                                                                  ^
[ 85%] Building C object CMakeFiles/oclbhgs.dir/sources/logics/ogl.c.o
[100%] Linking C executable oclbhgs
/usr/bin/ld: CMakeFiles/oclbhgs.dir/sources/logics/ogl.c.o: undefined reference to symbol 'glLoadIdentity'
/usr/bin/ld: /usr/lib/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/oclbhgs.dir/build.make:183: oclbhgs] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/oclbhgs.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

I'm on gcc 10.1 and with https://www.archlinux.org/packages/extra/x86_64/freeglut/ for GLUT.

@mortimr
Copy link
Owner

mortimr commented May 24, 2020

Hi, I will try to get some time to make the compilation work and find the exact version I used back then. Sorry, should have made the installation guide more detailed :( I have a lot of work right now, I’ll comment back here once I manage to do it

@terencode
Copy link
Author

No problem, take your time ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants