lharri73 / PySimlink

Compile, run, and interact with Simulink models natively in Python. https://lharri73.github.io/PySimlink/
GNU General Public License v3.0
15 stars 4 forks source link

Cannot run test compile #21

Open djsmith1000 opened 1 month ago

djsmith1000 commented 1 month ago

I am unable to compile any model on Windows. It looks like it fails to run the test compile. Output below. I can compile on linux in a docker container, but have tried two different windows machines with VS 2017 and 2019 with the desktop C++ packages installed and it won't compile. I've played with paths extensively, trying 32 and 64 bit compiler versions.

Help please!

-- The C compiler identification is MSVC 19.16.27027.1 -- The CXX compiler identification is MSVC 19.16.27027.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - broken -- Configuring incomplete, errors occurred! CMake Error at C:/Users/AppData/Local/Programs/Python/Python311/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler

"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/Users/AppData/Local/Programs/Python/Python311/Lib/site-packages/__pycache__/pysimlink/simple_compile_test/build/CMakeFiles/CMakeScratch/TryCompile-ox8ssx'

Run Build Command(s): C:/Users/AppData/Local/Programs/Python/Python311/Lib/site-packages/cmake/data/bin/cmake.exe -E env VERBOSE=1 nmake -f Makefile /nologo cmTC_3facb\fast
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86\nmake.exe"  -f CMakeFiles\cmTC_3facb.dir\build.make /nologo -L                  CMakeFiles\cmTC_3facb.dir\build
Building C object CMakeFiles/cmTC_3facb.dir/testCCompiler.c.obj
    C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\cmake\data\bin\cmake.exe -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_3facb.dir\testCCompiler.c.obj.d --working-dir=C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\__pycache__\pysimlink\simple_compile_test\build\CMakeFiles\CMakeScratch\TryCompile-ox8ssx --filter-prefix="Note: including file: " -- C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\cl.exe @C:\Users\AppData\Local\Temp\nmA978.tmp
testCCompiler.c
Linking C executable cmTC_3facb.exe
    C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_3facb.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\cmTC_3facb.dir\objects1.rsp @C:\Users\AppData\Local\Temp\nmA9C7.tmp
Visual Studio Incremental Link with embedded manifests
Create CMakeFiles\cmTC_3facb.dir/manifest.rc
Create empty: CMakeFiles\cmTC_3facb.dir/embed.manifest
RC Pass 1:
rc /fo CMakeFiles\cmTC_3facb.dir/manifest.res CMakeFiles\cmTC_3facb.dir/manifest.rc
RC Pass 1: command "rc /fo CMakeFiles\cmTC_3facb.dir/manifest.res CMakeFiles\cmTC_3facb.dir/manifest.rc" failed (exit code 0) with the following output:
no such file or directoryNMAKE : fatal error U1077: 'C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\cmake\data\bin\cmake.exe' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86\nmake.exe"' : return code '0x2'
Stop.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

lharri73 commented 1 month ago

This is an environment issue (or a bug for the cmake python package). Some things you can try: