nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.63k stars 617 forks source link

Building library fails on cmake and Makefile #392

Closed grahamreeds closed 9 months ago

grahamreeds commented 1 year ago

I have tried building with master branch and the source given in the 2.2.0 zip file. Both exhibit the same behaviour.

You freely admit that the CMake version is user-maintained but as that is what I use I will begin with that.

Attempting to compile with that gives the following output:

/workspaces/glew-2.2.0/build $ cmake ./cmake
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so   
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Configuring done
CMake Error at CMakeLists.txt:107 (add_library):
  Cannot find source file:

    /workspaces/glew-2.2.0/include/GL/wglew.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

CMake Error at CMakeLists.txt:183 (add_executable):
  Cannot find source file:

    /workspaces/glew-2.2.0/src/glewinfo.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

CMake Error at CMakeLists.txt:107 (add_library):
  No SOURCES given to target: glew

CMake Error at CMakeLists.txt:111 (add_library):
  No SOURCES given to target: glew_s

CMake Error at CMakeLists.txt:183 (add_executable):
  No SOURCES given to target: glewinfo

CMake Generate step failed.  Build files cannot be regenerated correctly.
/workspaces/glew-2.2.0/build $

And for calling makefile:

/workspaces/glew-2.2.0 $ make
/bin/sh: 1: config/config.guess: Permission denied
/bin/sh: 1: config/config.guess: Permission denied
Makefile:40: *** "Platform '' not supported".  Stop.
/workspaces/glew-2.2.0 $

I might be able to pass this by adding sudo but I shouldn't have to - why does the compile need super user rights?

nigels-com commented 1 year ago

Hello @grahamreeds

Unless you want to contribute to GLEW it's recommended to build from an official release: https://glew.sourceforge.net/

See https://github.com/nigels-com/glew/issues/13 for more details.

grahamreeds commented 1 year ago

I would just like to pull it into my projects, which are all CMake based, and as part of the build. Manual steps outside the main build is a non-no as that (in my experience) have people scratching their heads and disturbing other members of the team as to what went wrong. Making it as fool proof as possible is key.

I will look to see if there is a simple CMake command to download a zip and extract.

nigels-com commented 1 year ago

I'd recommend Perlmint/glew-cmake for that use case. This repo is less focused on cmake.