GithubHelp home page GithubHelp logo

hearthsim / decrunch Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 23.0 142 KB

Python wrapper around Crunch DXTc decompressor

Home Page: https://hearthsim.info

License: zlib License

C++ 82.83% C 13.68% Python 1.42% Cython 2.07%
dxtc python crunch

decrunch's People

Contributors

jleclanche avatar k0lb3 avatar robert-nix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

decrunch's Issues

ERROR: pip install decrunch (Windows 8.1 64-bit)

The following error message is shown when I try to install pip install decrunch on my computer, even though I have Microsoft Visual C++ 14.0 installed.

pip install decrunch

Building wheel for decrunch (setup.py) ... error

ERROR: Command errored out with exit status 1:

 command: 'f:\program files\python\python\python.exe' -u -c  
  'import sys, setuptools, tokenize; sys.argv[0] = '"''"C:\\Users\\Joong\\AppData\\Local\\Temp\\pip- 
  install-u1d4k562\\decrunch\\setup.py'"'"';
   __file__ ='"'"'C:\\Users\\Joong\\AppData\\Local\\Temp\\pip-install- 
   u1d4k562\\decrunch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',open) 
  (file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');
  f.close();exec;(compile(code,__file__, '"'"'exec'"'"')')' bdist_wheel -d 
  'C:\Users\Joong\AppData\Local\Temp\pip-wheel-oxss0ec4' --python-tag cp38
      cwd:  C:\Users\Joong\AppData\Local\Temp\pip-install-u1d4k562\decrunch\
  Complete output (5 lines):
  running bdist_wheel
  running build
  running build_ext 
  building 'decrunch' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": 
  https://visualstudio.microsoft.com/downloads/
  ---------------------------------------------------
  ERROR: Failed building wheel for decrunch

The second part for Running setup.py clean for decrunch with the added:

... install --record 'C:\Users\Joong\AppData\Local\Temp\pip-record-vveqk67e\install-record.txt'
--single-version-externally managed --compile Check the logs for full command output.

I need some help please. I got the other dependencies installed all right without no problems, like pillow, lz4 and fsb5.

Was I meant to install the files in a certain order?

Python 3.7 install fails due to Cython-generated cpp file in sdist

Unfortunately, the PyPi package contains a file named decrunch.cpp.
he problem is that this file was generated with an old version of Cython which generates code incompatible with Python 3.7.

If I remove decrunch.cpp, I can install the package as usual.

Maybe the solution is to just regenerate the file with a new Cython version.

To be precise, the error when installing is the following:

decrunch.cpp:3561:69: error: too many arguments to function
       return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                                                                       ^
  error: command 'gcc' failed with exit status 1

AssertionError: decrunch .dist-info directory not found

Hi!

$ pip3 install decrunch || pip3 --version && python --version
Collecting decrunch
Installing collected packages: decrunch
Exception:
Traceback (most recent call last):
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\wheel.py", line 347, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: decrunch .dist-info directory not found
pip 9.0.1 from c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages (python 3.6)
Python 3.6.3

Windows 10 pro btw

What can I do? ❤️ Need it for your other tools

Unable to install via pip on windows 10

Was unable to install via pip on Windows 10 for Python 3.9, with the latest Visual Studio Build Tools 2019 installed. Was seeing:

pip cl : Command line warning D9002 : ignoring unknown option '-std=c++11'

Ended up installing from source by commenting out the extra_compile_args=["-std=c++11"], line from setup.py

From what I understand from googling around, seems that c++11 is enabled by default so the argument is unknown?

cubemaps

Very low priority, but cubemaps are a thing in .crn files, and this API should handle that.

Can't install via pip

Building wheels for collected packages: decrunch
Building wheel for decrunch (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'decrunch' extension
creating build
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icrunch -IC:\Users\X\AppData\Local\Programs\Python\Python310\include -IC:\Users\X\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /EHsc /Tpcrn_decomp.cpp /Fobuild\temp.win-amd64-3.10\Release\crn_decomp.obj -std=c++11
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert.
crn_decomp.cpp
crn_decomp.cpp(3): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "string.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for decrunch
Running setup.py clean for decrunch
Failed to build decrunch
Installing collected packages: decrunch
Running setup.py install for decrunch ... error
error: subprocess-exited-with-error

× Running setup.py install for decrunch did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running install
running build
running build_ext
building 'decrunch' extension
creating build
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icrunch -IC:\Users\X\AppData\Local\Programs\Python\Python310\include -IC:\Users\X\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /EHsc /Tpcrn_decomp.cpp /Fobuild\temp.win-amd64-3.10\Release\crn_decomp.obj -std=c++11
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert.
crn_decomp.cpp
crn_decomp.cpp(3): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "string.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> decrunch

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

mac error

Building wheel for decrunch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-z9iclf2b/decrunch/setup.py'"'"'; file='"'"'/private/tmp/pip-install-z9iclf2b/decrunch/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-pevo03av --python-tag cp36
cwd: /private/tmp/pip-install-z9iclf2b/decrunch/
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
building 'decrunch' extension
creating build
creating build/temp.macosx-10.6-intel-3.6
/usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Icrunch -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c crn_decomp.cpp -o build/temp.macosx-10.6-intel-3.6/crn_decomp.o -std=c++11
crn_decomp.cpp:3:10: fatal error: 'string.h' file not found
#include <string.h>
^~~~~~~~~~
1 error generated.
error: command '/usr/local/bin/clang' failed with exit status 1

ERROR: Failed building wheel for decrunch

ETC2 crunched support

Atm decrunch doesn't support crunched versions of ETC2.

Addition to decrunch.pyx Format:
ETC1 = 10
ETC2 = 11
ETC2A = 12
ETC1S = 13
ETC2AS = 14

The /crunch code from Unity-Technologies/crunch results in a build error.

Error building, loses precision

sembiance@riverbend ~/decrunch $ python setup.py install --user
running install
running bdist_egg
running egg_info
creating decrunch.egg-info
writing decrunch.egg-info/PKG-INFO
writing top-level names to decrunch.egg-info/top_level.txt
writing dependency_links to decrunch.egg-info/dependency_links.txt
writing manifest file 'decrunch.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'decrunch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'decrunch' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-pc-linux-gnu-g++ -pthread -fPIC -Icrunch -I/usr/include/python2.7 -c crn_decomp.cpp -o build/temp.linux-x86_64-2.7/crn_decomp.o
In file included from crn_decomp.cpp:10:0:
crunch/crn_decomp.h: In function ‘void* crnd::crnd_malloc(size_t, size_t*)’:
crunch/crn_decomp.h:2536:28: error: cast from ‘crnd::uint8* {aka unsigned char*}’ to ‘crnd::uint32 {aka unsigned int}’ loses precision [-fpermissive]
       CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
                            ^
crunch/crn_decomp.h:435:39: note: in definition of macro ‘CRND_ASSERT’
 #define CRND_ASSERT(_exp) (void)( (!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0) )
                                       ^
crunch/crn_decomp.h: In function ‘void* crnd::crnd_realloc(void*, size_t, size_t*, bool)’:
crunch/crn_decomp.h:2561:28: error: cast from ‘void*’ to ‘crnd::uint32 {aka unsigned int}’ loses precision [-fpermissive]
       CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
                            ^
crunch/crn_decomp.h:435:39: note: in definition of macro ‘CRND_ASSERT’
 #define CRND_ASSERT(_exp) (void)( (!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0) )
                                       ^
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
>sembiance@riverbend ~/decrunch $ x86_64-pc-linux-gnu-g++ --version
x86_64-pc-linux-gnu-g++ (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) 5.4.0
sembiance@riverbend ~/decrunch $ python --version
Python 2.7.13
sembiance@riverbend ~/decrunch $ uname -a
Linux riverbend 4.10.9 1 SMP PREEMPT Tue Apr 11 10:30:30 EDT 2017 x86_64 Intel(R) Core(TM) i7-4960X CPU @ 3.60GHz GenuineIntel GNU/Linux

It builds if I change the (uint32) cast to (long) (a temporary, unadvised cheat I learned from http://stackoverflow.com/questions/1640423/error-cast-from-void-to-int-loses-precision#1640448)

Note: Using Python 3.4 doesn't fix this error.

pip install issue

pip install decrunch
gives the following output (on Windows 10 1607 & Python 3.6.1):
Running setup.py (path:%USERPROFILE%\AppData\Local\Temp\pip-build-wxg4s8ak\decrunch\setup.py) egg_info for package decrunch produced metadata for project name unknown. Fix your #egg=decrunch fragments. Requirement already satisfied (use --upgrade to upgrade): unknown from https://pypi.python.org/packages/7b/0f/ea88026a5e2340eb45df1289e67c925e551158244728abdb7107d946f294/decrunch-0.2.1.tar.gz#md5=1e189a72d122fafc1717e6781c1567e2 in %USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.