Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles compiling for windows #9

Closed
fire opened this issue Feb 28, 2023 · 16 comments
Closed

Troubles compiling for windows #9

fire opened this issue Feb 28, 2023 · 16 comments

Comments

@fire
Copy link
Contributor

fire commented Feb 28, 2023

  1. spdlog is missing
  2. openvdb is missing
  3. boost is missing

Looking into this.

@fire
Copy link
Contributor Author

fire commented Feb 28, 2023

Newer instructions that are failing

  1. use msys
  2. pacman -S mingw-w64-x86_64-boost mingw-w64-x86_64-openvdb mingw-w64-x86_64-spdlog cmake ninja
  3. git clone https://github.com/SarahWeiii/CoACD.git
  4. cd CoACD
  5. mkdir -p build
  6. cd build
  7. cmake .. -GNinja

@fire
Copy link
Contributor Author

fire commented Feb 28, 2023

Some errors:

src/btConvexHull/btAlignedAllocator.cpp:71:31: error: cast from 'char*' to 'long unsigned int' loses precision [-fpermissive]
   71 |         offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1);

@fire
Copy link
Contributor Author

fire commented Feb 28, 2023

This is sufficiently difficult that making release builds for windows might be a good idea.

@SarahWeiii
Copy link
Owner

Hi thank you for the suggestions. Our code was mainly tested on Linux, have you tried using WSL to run the code on Windows?

@yetigit
Copy link

yetigit commented Mar 25, 2023

Hi thank you for the suggestions. Our code was mainly tested on Linux, have you tried using WSL to run the code on Windows?

i'm sure it compiles fine on linux but a native windows build would be more than welcome for this fantastic library

@fire
Copy link
Contributor Author

fire commented Mar 25, 2023

I am unable to compile for windows.

@yetigit
Copy link

yetigit commented Mar 30, 2023

I am unable to compile for windows.

@fire please use my fork https://github.com/yetigit/CoACD and checkout to master to build on windows.

git clone --recursive https://github.com/yetigit/CoACD.git
git fetch origin master
git checkout master

and use vcpkg with cmake.

example of using the app :
coacdapp.exe -i chair.obj -o chairout.obj -np -mn 10 -t 0.4 -c 4

the parameter -np is needed to speed things up if you are sure you have a watertight manifold mesh
the new parameter -c (max number of convex hulls) is super useful.


The problem we had here on windows :

  • is the namespace pollution. there was a dozen of using namespace std in broad scope headers (this was the biggest problem and I had to go in there and manually prepend std:: to everything for hours).
  • couple of incorrect includes
  • dependencies not referenced in the cmake file
  • unneeded instructions in the cmake file

@SarahWeiii i am not familiar with collaborating using forks and I have some other work to do but do consider the changes I made on my fork, on master https://github.com/yetigit/CoACD and maybe let's try to merge it later, cheerios

@fire
Copy link
Contributor Author

fire commented Mar 30, 2023

vcpkg install openvdb:x64-windows
git clone --recursive https://github.com/yetigit/CoACD.git
cd CoACD
git fetch origin master
git checkout master
mkdir build
cd build
$env:CMAKE_TOOLCHAIN_FILE="C:\Users\ernes\scoop\apps\vcpkg\current\scripts\buildsystems\vcpkg.cmake"
cmake .. -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release
.\CoACD.sln and build the coacdapp

Work in progress

Need to force 64bit OpenVDB

coacd_RelWithDebInfo.zip

Estimated took an hour to fix the vcpkg problems.

@SarahWeiii
Copy link
Owner

Thank you @fire @yetigit for the effort of compiling CoACD on Windows! @yetigit you could simply send a pull request to me and I can merge the code into the main branch.

@SarahWeiii SarahWeiii pinned this issue Mar 30, 2023
@Shayp277
Copy link

Shayp277 commented Jun 8, 2023

Hi everyone,
I've been struggeling for couple of days now to try and run coacd on windows with no success.

when I "pip install coacd" the installation is complete but then when I try to import it I get:

PS C:\Users\shayp> & C:/Users/shayp/AppData/Local/Microsoft/WindowsApps/python3.10.exe c:/Users/shayp/Desktop/Untitled-1.py
Traceback (most recent call last):
File "C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd_init_.py", line 19, in
lib = ctypes.CDLL(os.path.join(os.path.dirname(file), "lib_coacd.so"))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd\lib_coacd.so' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Users\shayp\Desktop\Untitled-1.py", line 1, in
import coacd
File "C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd_init_.py", line 21, in
lib = ctypes.CDLL(os.path.join(os.path.dirname(file), "lib_coacd.dll"))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd\lib_coacd.dll' (or one of its dependencies). Try using the full path with constructor syntax.

@Shayp277
Copy link

Shayp277 commented Jun 8, 2023

Hi everyone, I've been struggeling for couple of days now to try and run coacd on windows with no success.

when I "pip install coacd" the installation is complete but then when I try to import it I get:

PS C:\Users\shayp> & C:/Users/shayp/AppData/Local/Microsoft/WindowsApps/python3.10.exe c:/Users/shayp/Desktop/Untitled-1.py Traceback (most recent call last): File "C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd__init__.py", line 19, in lib = ctypes.CDLL(os.path.join(os.path.dirname(file), "lib_coacd.so")) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes__init_.py", line 374, in init self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd\lib_coacd.so' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\shayp\Desktop\Untitled-1.py", line 1, in import coacd File "C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd__init__.py", line 21, in lib = ctypes.CDLL(os.path.join(os.path.dirname(file), "lib_coacd.dll")) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes__init_.py", line 374, in init self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'C:\Users\shayp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\coacd\lib_coacd.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Is it possible to run this library on an x86_64 os?

@SarahWeiii SarahWeiii unpinned this issue Jun 9, 2023
@SarahWeiii
Copy link
Owner

SarahWeiii commented Jun 9, 2023

Our library supports x86_64 os. Have you installed vc redist or visual studio?

@SarahWeiii
Copy link
Owner

We have updated the pypi package, including all the .dll in the wheel. You could install the latest (0.0.4) and try if it works.

@Shayp277
Copy link

We have updated the pypi package, including all the .dll in the wheel. You could install the latest (0.0.4) and try if it works.

I have both vc redist and visual studio.
How do I get version 0.0.4? pip install coacd is giving me version 0.0.3
thanks

@SarahWeiii
Copy link
Owner

You may try pip install coacd --upgrade

@Shayp277
Copy link

Hi, reinstalled the coacd and now its the 0.0.4 version.
Guess I tried before the package was updated in the pypi.
Now everything works great!
thank you very much for this awesome library and quick response :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants