Amulet-Map-Editor icon indicating copy to clipboard operation
Amulet-Map-Editor copied to clipboard

[Bug Report] Failure during pip install

Open cynojien opened this issue 3 years ago • 8 comments

Bug Report

Current Behaviour:

On Ubuntu 22.04 any 0.10* version fails to build. Can't use any of the prior builds due to the UI bug.

Steps To Reproduce:

Created a virtual python environment. While installing version 0.10.0a1 via pip or any of the newer versions from source the install fails while building the amulet-map-editor wheel.

$ python -m pip install /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1 --upgrade

Processing ./.amulet/Amulet-Map-Editor-0.10.0b1
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting amulet-nbt~=2.0
  Using cached amulet_nbt-2.0.1-cp310-cp310-linux_x86_64.whl
Requirement already satisfied: numpy~=1.17 in ./.amulet/lib/python3.10/site-packages (from amulet-map-editor==0.10.0b1) (1.23.1)
Requirement already satisfied: wxPython~=4.1 in ./.amulet/lib/python3.10/site-packages (from amulet-map-editor==0.10.0b1) (4.2.0)
Collecting pyopengl~=3.0
  Using cached PyOpenGL-3.1.6-py3-none-any.whl (2.4 MB)
Collecting packaging
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting amulet-core~=1.9
  Using cached amulet_core-1.9.4-py3-none-any.whl (1.0 MB)
Collecting minecraft-resource-pack~=1.3
  Using cached minecraft_resource_pack-1.3.1-py3-none-any.whl (448 kB)
Collecting pymctranslate~=1.2
  Using cached PyMCTranslate-1.2.6-py3-none-any.whl (701 kB)
Collecting portalocker~=2.4
  Using cached portalocker-2.5.1-py2.py3-none-any.whl (15 kB)
Collecting mutf8~=1.0
  Using cached mutf8-1.0.6-cp310-cp310-linux_x86_64.whl
Requirement already satisfied: Pillow>=7.1 in ./.amulet/lib/python3.10/site-packages (from minecraft-resource-pack~=1.3->amulet-map-editor==0.10.0b1) (9.2.0)
Requirement already satisfied: six in ./.amulet/lib/python3.10/site-packages (from wxPython~=4.1->amulet-map-editor==0.10.0b1) (1.16.0)
Collecting pyparsing!=3.0.5,>=2.0.2
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Building wheels for collected packages: amulet-map-editor
  Building wheel for amulet-map-editor (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for amulet-map-editor (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [323 lines of output]
      Warning: build in /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages is using versioneer.py from /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1/versioneer.py
      running bdist_wheel
      running build
      running build_py
      Warning: build in /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages is using versioneer.py from /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1/versioneer.py
      Warning: build in /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages is using versioneer.py from /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1/versioneer.py
      running egg_info
      writing amulet_map_editor.egg-info/PKG-INFO
      writing dependency_links to amulet_map_editor.egg-info/dependency_links.txt
      writing entry points to amulet_map_editor.egg-info/entry_points.txt
      writing requirements to amulet_map_editor.egg-info/requires.txt
      writing top-level names to amulet_map_editor.egg-info/top_level.txt
      reading manifest file 'amulet_map_editor.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.pyi' under directory 'amulet_map_editor'
      warning: no files found matching '*.pxd' under directory 'amulet_map_editor'
      warning: no files found matching '*.jpg' under directory 'amulet_map_editor'
      writing manifest file 'amulet_map_editor.egg-info/SOURCES.txt'
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.api.image.icon.tablericons' as data is deprecated, please list it in `packages`.
          !!

          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.api.image.icon.tablericons' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.api.image.icon.tablericons' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.api.image.icon.tablericons' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.api.image.logo' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.api.image.logo' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.api.image.logo' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.api.image.logo' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.api.image.nbt' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.api.image.nbt' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.api.image.nbt' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.api.image.nbt' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.lang' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.lang' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.lang' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.lang' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui.cubemap' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui.cubemap' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui.cubemap' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.amulet_ui.cubemap' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.textures' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.textures' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.textures' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.bedrock.textures' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.java' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.java' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.java' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.java' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui.cubemap' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui.cubemap' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui.cubemap' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'amulet_map_editor.programs.edit.amulet_resource_pack.java.assets.amulet.textures.amulet_ui.cubemap' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      copying amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c -> build/lib.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk
      UPDATING build/lib.linux-x86_64-cpython-310/amulet_map_editor/_version.py
      set build/lib.linux-x86_64-cpython-310/amulet_map_editor/_version.py to '0.10.0b1'
      running build_ext
      Warning: build in /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages is using versioneer.py from /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1/versioneer.py
      Warning: build in /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages is using versioneer.py from /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1/versioneer.py
      building 'amulet_map_editor.api.opengl.mesh.level.chunk.chunk_builder_cy' extension
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/josh/.amulet/include -I/usr/include/python3.10 -c amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c -o build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -openmp
      In file included from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
                       from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                       from amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c:1071:
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
         17 | #warning "Using deprecated NumPy API, disable it with " \
            |  ^~~~~~~
      x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.cpython-310-x86_64-linux-gnu.so -openmp
      /usr/bin/ld: cannot find build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o: No such file or directory
      collect2: error: ld returned 1 exit status
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for amulet-map-editor
Failed to build amulet-map-editor
ERROR: Could not build wheels for amulet-map-editor, which is required to install pyproject.toml-based projects

Environment:

  • OS: Ubuntu 22.04
  • Amulet Version: 0.10.0a1 or greater

cynojien avatar Aug 12 '22 19:08 cynojien

I am not entirely sure what the issue is here. These four lines are where the error actually is

x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.cpython-310-x86_64-linux-gnu.so -openmp
/usr/bin/ld: cannot find build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o: No such file or directory
collect2: error: ld returned 1 exit status
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

gentlegiantJGC avatar Aug 13 '22 10:08 gentlegiantJGC

I also cannot install any 0.10* versions on Fedora 36. I just looked through the GitHub repository and cannot even find that file.

LackingCats avatar Aug 13 '22 11:08 LackingCats

The file is a .pyx file which is a cython file which is converted to a .c file which is compiled to a .so file on linux. I have just spotted the line further up that should generate the .o file

      building 'amulet_map_editor.api.opengl.mesh.level.chunk.chunk_builder_cy' extension
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/josh/.amulet/include -I/usr/include/python3.10 -c amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c -o build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -openmp
      In file included from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
                       from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                       from amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c:1071:
      /tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
         17 | #warning "Using deprecated NumPy API, disable it with " \
            |  ^~~~~~~
      x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.cpython-310-x86_64-linux-gnu.so -openmp
      /usr/bin/ld: cannot find build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o: No such file or directory
      collect2: error: ld returned 1 exit status

gentlegiantJGC avatar Aug 14 '22 09:08 gentlegiantJGC

Try using the following command to see if it gives any more information python -m pip install /home/josh/.amulet/Amulet-Map-Editor-0.10.0b1 --upgrade -v -v -v

gentlegiantJGC avatar Aug 14 '22 09:08 gentlegiantJGC

Are Ubuntu 22.04 and Fedora 36 using Python 3.10? If so, installing and using 3.9 might solve the problem.

dathide avatar Aug 20 '22 20:08 dathide

I don't really know what is going on here. I have tried running that command isolated from the rest and it does not seem to generate the .so file like it is supposed to.

If anyone has any experience with linux I think this is the command that is failing but seems to be failing silently.

x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-unn6l7fk/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/josh/.amulet/include -I/usr/include/python3.10 -c amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c -o build/temp.linux-x86_64-cpython-310/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o -openmp

You will need to modify the include directories

gentlegiantJGC avatar Aug 27 '22 09:08 gentlegiantJGC

Same problem on Mac M1 Monterey 12.6

eightlay avatar Sep 18 '22 16:09 eightlay

mac 12.5.1 also

TheKidThatCodes avatar Sep 21 '22 15:09 TheKidThatCodes

Same, on Monterey 12.5.1, I get the exact error here. I even spotted where the .c file should generate the .o file, before searching around coming to this chain, but that clearly the time I spent reading the error message didn't help me do anything or else I wouldn't be here.

robofinch avatar Sep 23 '22 05:09 robofinch

Exactly the same issue for me doesn't matter if i'm using python3.9 or 3.7

imsl0wer avatar Sep 23 '22 09:09 imsl0wer

I'm also getting these errors on MacOS 12.6

Full logs are here: https://pastebin.com/FNKuF2pA

JoshLoecker avatar Sep 26 '22 17:09 JoshLoecker

I FOUND A SOLUTION !!!!!!!

diff --git a/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx b/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
index 6c25e11a..958f7882 100644
--- a/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
+++ b/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
@@ -1,6 +1,6 @@
 # cython: language_level=3, boundscheck=False, wraparound=False
-# distutils: extra_compile_args = -openmp
-# distutils: extra_link_args = -openmp
+# distutils: extra_compile_args = 
+# distutils: extra_link_args = 
 
 import numpy
 cimport numpy

SAGESSE-CN avatar Sep 28 '22 02:09 SAGESSE-CN

hmm. I will look into that. OpenMP is a library for multiprocessing. Perhaps I need a different flag for unix.

gentlegiantJGC avatar Sep 28 '22 08:09 gentlegiantJGC

Thanks for the pointers. I have put together a patch in #803 that works on windows and ubuntu. I don't have a mac to test on.

Please can you test it to make sure it works on your machine. https://github.com/Amulet-Team/Amulet-Map-Editor/pull/803/files

gentlegiantJGC avatar Sep 28 '22 09:09 gentlegiantJGC

I'm getting the same errors. Here are the commands I ran:

# Checkout repo
git clone https://github.com/Amulet-Team/Amulet-Map-Editor
gh pr checkout 803     # As noted here: https://cli.github.com/manual/gh_pr_checkout

# Create & activate the virtual environment
python3.7 -m venv amulet_venv
source ./amulet_venv/bin/activate
python --version    # shows Python 3.7.14

# Install amulet
python -m pip install ./Amulet-Map-Editor

And here are the full logs of the last command: https://pastebin.com/ST9zSe91

JoshLoecker avatar Sep 28 '22 20:09 JoshLoecker

This says that clang that comes pre-installed does not support openmp but you can update to a newer version to get support. https://www.positioniseverything.net/clang-error-unsupported-option-fopenmp/

I don't know if there is a way to make it ignore the flags if they are not supported.

Edit: https://stackoverflow.com/questions/21617158/how-to-silence-unused-command-line-argument-error-with-clang-without-disabling-i

I may have to look into making it compiler dependent

gentlegiantJGC avatar Sep 28 '22 21:09 gentlegiantJGC

https://clang.llvm.org/docs/OpenMPSupport.html

SAGESSE-CN avatar Sep 29 '22 00:09 SAGESSE-CN

Thanks for the pointers. I have put together a patch in #803 that works on windows and ubuntu. I don't have a mac to test on.

Please can you test it to make sure it works on your machine. https://github.com/Amulet-Team/Amulet-Map-Editor/pull/803/files

1: your can't contains "-openmp" flags, because clang thinks it equivalent to "-o penmp", this will overrides the "-o build/.../chunk_builder_cy.o" 2: for the -fopenmp flags, your need use "-Xclang -fopenmp" or "-Xpreprocessor -fopenmp"

diff --git a/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx b/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
index 5292dd5c..ec60ccac 100644
--- a/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
+++ b/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
@@ -1,6 +1,6 @@
 # cython: language_level=3, boundscheck=False, wraparound=False
-# distutils: extra_compile_args = ["-fopenmp", "-openmp"]
-# distutils: extra_link_args = ["-fopenmp", "-openmp"]
+# distutils: extra_compile_args = ["-Xclang -fopenmp"]
+# distutils: extra_link_args = ["-Xclang -fopenmp"]
 
 import numpy
 cimport numpy

3: when I compiling successfully, and then run and load a world, all shader failed.

OpenGL.GL.shaders.ShaderCompilationError: ('Shader compile failure (0): b"WARNING: 0:2: extension \'GL_ARB_explicit_attrib_location\' is not supported\\nERROR: 0:4: \'layout\' : syntax error: syntax error\\n"', [b'#version 120\n#extension GL_ARB_explicit_attrib_location : enable\n\nlayout(location = 0) in vec3 positions;\nlayout(location = 1) in vec2 vTexCoord;\nlayout(location = 2) in vec4 vTexOffset;\nlayout(location = 3) in vec3 vTint;\n\nvarying vec2 fTexCoord;\nvarying vec4 fTexOffset;\nvarying vec3 fTint;\n\nuniform mat4 transformation_matrix;\n\nvoid main(){\n    gl_Position = transformation_matrix * vec4(positions, 1.0);\n    fTexCoord = vTexCoord;\n    fTexOffset = vTexOffset;\n    fTint = vTint;\n}'], GL_VERTEX_SHADER)
Traceback (most recent call last):
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/programs/edit/plugins/tools/select.py", line 327, in _on_draw
    self.canvas.renderer.draw_sky_box()
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/programs/edit/api/renderer.py", line 224, in draw_sky_box
    self.sky_box.draw(self.canvas.camera.transformation_matrix)
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/mesh/sky_box.py", line 63, in draw
    super().draw(
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/mesh/tri_mesh.py", line 161, in draw
    self._setup()
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/mesh/tri_mesh.py", line 90, in _setup
    self._shader = get_shader(self.context_identifier, self.shader_name)
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/shaders/__init__.py", line 60, in get_shader
    shader = compile_shader()
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/shaders/__init__.py", line 49, in compile_shader
    _load_shader(
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/amulet_map_editor/api/opengl/shaders/__init__.py", line 73, in _load_shader
    return OpenGL.GL.shaders.compileShader(shader, shader_type)
  File "/Users/sagesse/Library/Python/3.9/lib/python/site-packages/OpenGL/GL/shaders.py", line 235, in compileShader
    raise ShaderCompilationError(
OpenGL.GL.shaders.ShaderCompilationError: ('Shader compile failure (0): b"WARNING: 0:2: extension \'GL_ARB_explicit_attrib_location\' is not supported\\nERROR: 0:4: \'layout\' : syntax error: syntax error\\n"', [b'#version 120\n#extension GL_ARB_explicit_attrib_location : enable\n\nlayout(location = 0) in vec3 positions;\nlayout(location = 1) in vec2 vTexCoord;\nlayout(location = 2) in vec4 vTexOffset;\nlayout(location = 3) in vec3 vTint;\n\nvarying vec2 fTexCoord;\nvarying vec4 fTexOffset;\nvarying vec3 fTint;\n\nuniform mat4 transformation_matrix;\n\nvoid main(){\n    gl_Position = transformation_matrix * vec4(positions, 1.0);\n    fTexCoord = vTexCoord;\n    fTexOffset = vTexOffset;\n    fTint = vTint;\n}'], GL_VERTEX_SHADER)

command:

cd Amulet-Map-Editor
git checkout bug-769
vim amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.pyx
pip install .
python .

SAGESSE-CN avatar Sep 29 '22 01:09 SAGESSE-CN

As you can tell my knowledge of C, compilers and different platforms is very limited. Thanks for the information.

I wish the Cython documentation had a more clear example. It is very clear for gcc and semi-clear for MSVC but beyond that it has nothing.

gentlegiantJGC avatar Sep 29 '22 08:09 gentlegiantJGC

I think with the complexities on mac we will just disable openmp support on mac. It doesn't give that much of a speed boost because the code it parallelises doesn't take that long to run in the first place.

I have updated #803 to find the compiler and set the args for just that compiler.

Let me know if you still have issues.

gentlegiantJGC avatar Sep 29 '22 12:09 gentlegiantJGC

I was able to install and run these changes! 😄

JoshLoecker avatar Sep 29 '22 17:09 JoshLoecker