weigert / TinyEngine

Tiny OpenGL Wrapper / 3D Engine in C++
1.01k stars 65 forks source link

compile error on iMac with chip M1 #26

Closed codingwatching closed 1 year ago

codingwatching commented 3 years ago

I am sorry for this, but maybe because I just moving to a new iMac with chip M1, after setup all the commands, I still have this error:

apple@Apples-iMac TinyEngine % brew install glew
Warning: glew 2.2.0_1 is already installed and up-to-date.
To reinstall 2.2.0_1, run:
  brew reinstall glew
apple@Apples-iMac TinyEngine % sudo make all     
Password:
Copying Core Header Files ...
Done
Copying Helper Header Files ...
Done
Compiling TinyEngine ...
In file included from TinyEngine.cpp:3:
./TinyEngine.h:9:10: fatal error: 'GL/glew.h' file not found
#include <GL/glew.h>                                //Rendering Dependencies
         ^~~~~~~~~~~
1 error generated.
make: *** [install] Error 1
weigert commented 2 years ago

Hi. Were you able to fix this dependency issue? This is a question of modifying the makefile to be able to find glew on your system.

madasebrof commented 1 year ago

@codingwatching you'll need to modify the makefile to find the homebrew stuff, e.g.:

# TinyEngine Build Recipe
# Author: Nicholas McDonald
# Version 1.0
# Tested on GNU/Linux

# Install Location Configuration
LIBPATH = /usr/local/lib
INCLUDEPATH = /usr/local/include
BREWPATH = /opt/homebrew/include # <--- add this...

# Compilation Settings
CC = g++ -std=c++17
CF = -Wfatal-errors -O3 -I$(INCLUDEPATH) -I$(BREWPATH) # <--- ...then add to compiler

...
weigert commented 1 year ago

Hi everybody and sorry for the late reply,

MacOS / M1 / macos-arm64 support has now been merged into the main branch, and the makefiles can be used as usual.

Note that there are still some compatibility issues and not all examples will run.

See this #36 more recent issue for a small discussion, and feel free to look at the latest merged pull request for concrete fixes which allowed compatibility.

I will close this issue but feel free to continue commenting if you have any more problems,