drufat / triangle

Python bindings to the triangle library
GNU Lesser General Public License v3.0
224 stars 53 forks source link

"c1: fatal error C1083: Cannot open source file: 'c/triangle.c': No such file or directory" error while building from source #74

Closed Mohsin-Bashir closed 9 months ago

Mohsin-Bashir commented 10 months ago

I am getting this error while trying to build triangle from source:

running install C:\Users\yesbo.conda\envs\py39env\lib\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!! self.initialize_options() C:\Users\yesbo.conda\envs\py39env\lib\site-packages\setuptools_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ********************************************************************************

!! self.initialize_options() running bdist_egg running egg_info writing triangle.egg-info\PKG-INFO writing dependency_links to triangle.egg-info\dependency_links.txt writing requirements to triangle.egg-info\requires.txt writing top-level names to triangle.egg-info\top_level.txt reading manifest file 'triangle.egg-info\SOURCES.txt' adding license file 'LICENSE' writing manifest file 'triangle.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib running build_py running build_ext building 'triangle.core' extension "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -IC:\Users\yesbo.conda\envs\py39env\include -IC:\Users\yesbo.conda\envs\py39env\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcc/triangle.c /Fobuild\temp.win-amd64-cpython-39\Release\c/triangle.obj triangle.c c1: fatal error C1083: Cannot open source file: 'c/triangle.c': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2


I am using Windows 11, anaconda 3, python 3.9.17 I tried installing different versions of microsoft build tools but I get the same error every time. I even tried on a different machine with different version of anaconda and python, but still im getting the same error. Can somebody help me in fixing this issue?

0x6d61676e7573 commented 10 months ago

I believe you need to download the c source files, they are located in another repo. The files in this repo are just a python wrapper to that c library.

In a conda environment maybe it's easier to simply do conda install -c conda-forge triangle

drufat commented 9 months ago

You may have to use the --recurse-submodules option when cloning the repository. The C source files are located in a separate sub-module. They had to be put in a separate repository because their author uses a different license than the wrapper code.