Skip to content

How to build for Apple M1 Mac? #44

Description

@RG-404

I could not install bimpy using conda and pip so I tried to build it from source code.

On running:
python setup.py install

Output Downloading libs/gl3w/include/GL/glcorearb.h... Downloading libs/gl3w/include/KHR/khrplatform.h... Parsing glcorearb.h header... Generating libs/gl3w/include/GL/gl3w.h... Generating libs/gl3w/src/gl3w.c... running install running bdist_egg running egg_info creating bimpy.egg-info writing bimpy.egg-info/PKG-INFO writing dependency_links to bimpy.egg-info/dependency_links.txt writing top-level names to bimpy.egg-info/top_level.txt writing manifest file 'bimpy.egg-info/SOURCES.txt' reading manifest file 'bimpy.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'gl3w/gl3w_gen.py' warning: no files found matching '*.py' under directory 'example' warning: no files found matching '*.c*' under directory 'libs/gl3w/include' warning: no files found matching '*.h' under directory 'config' warning: no files found matching '*.h' adding license file 'LICENSE.txt' writing manifest file 'bimpy.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-11-arm64/egg running install_lib running build_py creating build creating build/lib.macosx-11-arm64-3.9 creating build/lib.macosx-11-arm64-3.9/bimpy copying bimpy/themes.py -> build/lib.macosx-11-arm64-3.9/bimpy copying bimpy/download.py -> build/lib.macosx-11-arm64-3.9/bimpy copying bimpy/__init__.py -> build/lib.macosx-11-arm64-3.9/bimpy copying bimpy/utils.py -> build/lib.macosx-11-arm64-3.9/bimpy copying bimpy/app.py -> build/lib.macosx-11-arm64-3.9/bimpy creating build/lib.macosx-11-arm64-3.9/bimpy/multilingual copying bimpy/multilingual/unicode_ranges.py -> build/lib.macosx-11-arm64-3.9/bimpy/multilingual copying bimpy/multilingual/load_fonts.py -> build/lib.macosx-11-arm64-3.9/bimpy/multilingual copying bimpy/multilingual/__init__.py -> build/lib.macosx-11-arm64-3.9/bimpy/multilingual running build_ext building '_bimpy' extension creating build/temp.macosx-11-arm64-3.9 creating build/temp.macosx-11-arm64-3.9/libs creating build/temp.macosx-11-arm64-3.9/libs/glfw creating build/temp.macosx-11-arm64-3.9/libs/glfw/src creating build/temp.macosx-11-arm64-3.9/libs/gl3w creating build/temp.macosx-11-arm64-3.9/libs/gl3w/src clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/context.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/context.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/init.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/init.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/input.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/input.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/vulkan.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/vulkan.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/monitor.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/monitor.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/window.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/window.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/cocoa_time.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/cocoa_time.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/posix_thread.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/posix_thread.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/egl_context.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/egl_context.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/glfw/src/osmesa_context.c -o build/temp.macosx-11-arm64-3.9/libs/glfw/src/osmesa_context.o clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/gl3w/src/gl3w.c -o build/temp.macosx-11-arm64-3.9/libs/gl3w/src/gl3w.o creating build/temp.macosx-11-arm64-3.9/libs/imgui creating build/temp.macosx-11-arm64-3.9/sources clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/imgui/imgui.cpp -o build/temp.macosx-11-arm64-3.9/libs/imgui/imgui.o -std=c++11 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/imgui/imgui_draw.cpp -o build/temp.macosx-11-arm64-3.9/libs/imgui/imgui_draw.o -std=c++11 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/imgui/imgui_demo.cpp -o build/temp.macosx-11-arm64-3.9/libs/imgui/imgui_demo.o -std=c++11 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c sources/bimpy.cpp -o build/temp.macosx-11-arm64-3.9/sources/bimpy.o -std=c++11 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c libs/imgui/imgui_widgets.cpp -o build/temp.macosx-11-arm64-3.9/libs/imgui/imgui_widgets.o -std=c++11 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c sources/imgui_impl_opengl3.cpp -o build/temp.macosx-11-arm64-3.9/sources/imgui_impl_opengl3.o -std=c++11 In file included from sources/bimpy.cpp:6: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ In file included from libs/imgui/imgui_draw.cpp:29: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ In file included from sources/imgui_impl_opengl3.cpp:54: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ In file included from libs/imgui/imgui.cpp:793: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ In file included from libs/imgui/imgui_demo.cpp:67: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ In file included from libs/imgui/imgui_widgets.cpp:35: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ 1 warning generated. clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_GLFW_COCOA=1 -DIMGUI_USER_CONFIG="bimpy_imgui_config.h" -Ilibs/glfw/include -Ilibs/imgui -Ilibs/pybind11/include -Ilibs/backward-cpp -Ilibs/gl3w/include -Isources/config -Isources -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c sources/imgui_impl_glfw.cpp -o build/temp.macosx-11-arm64-3.9/sources/imgui_impl_glfw.o -std=c++11 In file included from sources/imgui_impl_glfw.cpp:40: In file included from libs/imgui/imgui.h:42: In file included from sources/config/bimpy_imgui_config.h:6: sources/runtime_error.h:47:70: warning: field 'ap' is uninitialized when used here [-Wuninitialized] std::runtime_error(string_format(fmt_str, (va_start(ap, fmt_str), ap))) ^ 1 warning generated. In file included from sources/bimpy.cpp:18: libs/backward-cpp/backward.hpp:4160:60: error: member reference type 'struct __darwin_mcontext64 *' is a pointer; did you mean to use '->'? error_addr = reinterpret_cast(uctx->uc_mcontext.pc); ~~~~~~~~~~~~~~~~~^ -> libs/backward-cpp/backward.hpp:4160:61: error: no member named 'pc' in '__darwin_mcontext64' error_addr = reinterpret_cast(uctx->uc_mcontext.pc); ~~~~~~~~~~~~~~~~~ ^ sources/bimpy.cpp:753:17: warning: explicitly assigning value of variable of type 'const pybind11::detail::self_t' to itself [-Wself-assign-overloaded] .def(py::self -= py::self) ~~~~~~~~ ^ ~~~~~~~~ sources/bimpy.cpp:1648:29: warning: lambda capture 'get_persistent_storage' is not used [-Wunused-lambda-capture] m.def("add_font_default", [get_persistent_storage](int oversample=2, bool merge=false) ^~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. 1 warning generated. 1 warning generated. 3 warnings and 2 errors generated. 1 warning generated. error: command '/usr/bin/clang' failed with exit code 1

How to reproduce:
git submodule update --init
python3 setup.py install

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions