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

Can't compile with MSVC #156

Open
namjmnam opened this issue Feb 7, 2024 · 0 comments
Open

Can't compile with MSVC #156

namjmnam opened this issue Feb 7, 2024 · 0 comments

Comments

@namjmnam
Copy link

namjmnam commented Feb 7, 2024

Here is my cmake command for PowerShell:

cmake `
  -DTPL_BLAS_LIBRARIES="C:/OpenBLAS/lib/libopenblas.dll.a" `
  -DCMAKE_BUILD_TYPE:STRING=Release `
  -DCMAKE_COLOR_MAKEFILE:BOOL=FALSE `
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE `
  -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe" `
  -DCMAKE_CUDA_COMPILER="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/bin/nvcc.exe" `
  -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3" `
  -Denable_openmp:BOOL=FALSE `
  -DCMAKE_C_FLAGS:STRING='/DWIN32 /D_WINDOWS /W3' `
  -DTPL_ENABLE_PARMETISLIB:BOOL=FALSE `
  -DXSDK_ENABLE_Fortran=OFF `
  -DTPL_ENABLE_CUDALIB=TRUE `
  -G "NMake Makefiles JOM" `
  "C:/Python Projects/archive/superlu_dist-8.1.0"

Here is the output error:

-- The C compiler identification is MSVC 19.38.33135.0
-- The CXX compiler identification is MSVC 19.38.33135.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: 'C:/Python Projects/build/CMakeFiles/CMakeScratch/TryCompile-x7jfyi'
    
    Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 jom -f Makefile /nologo cmTC_acea6\fast
    jom: parallel job execution disabled for Makefile
        C:\jom\jom.exe  -f CMakeFiles\cmTC_acea6.dir\build.make /nologo -L CMakeFiles\cmTC_acea6.dir\build
    Building C object CMakeFiles/cmTC_acea6.dir/testCCompiler.c.obj
        "C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_acea6.dir\testCCompiler.c.obj.d --working-dir="C:\Python Projects\build\CMakeFiles\CMakeScratch\TryCompile-x7jfyi" --filter-prefix="랓??: ?ぁ?????? " -- C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe @C:\Users\1\AppData\Local\Temp\testCCompiler.c.obj.10200.0.jom
    testCCompiler.c
    Linking C executable cmTC_acea6.exe
        "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_acea6.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_acea6.dir\objects1.rsp @C:\Users\1\AppData\Local\Temp\cmTC_acea6.exe.10200.78.jom
    Visual Studio Incremental Link with embedded manifests
    Create CMakeFiles\cmTC_acea6.dir/manifest.rc
    Create empty: CMakeFiles\cmTC_acea6.dir/embed.manifest
    RC Pass 1:
    rc /fo CMakeFiles\cmTC_acea6.dir/manifest.res CMakeFiles\cmTC_acea6.dir/manifest.rc
    RC Pass 1: command "rc /fo CMakeFiles\cmTC_acea6.dir/manifest.res CMakeFiles\cmTC_acea6.dir/manifest.rc" failed (exit code 0) with the following output:
    지정된 파일을 찾을 수 없습니다jom: C:\Python Projects\build\CMakeFiles\CMakeScratch\TryCompile-x7jfyi\CMakeFiles\cmTC_acea6.dir\build.make [cmTC_acea6.exe] Error 2
    jom: C:\Python Projects\build\CMakeFiles\CMakeScratch\TryCompile-x7jfyi\Makefile [cmTC_acea6\fast] Error 2





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


-- Configuring incomplete, errors occurred!

But when I run it without the line -G "NMake Makefiles JOM", it actually compiles into a VS17 solution:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.38.33135.0
-- The CXX compiler identification is MSVC 19.38.33135.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SuperLU_DIST will be built as a static library.
-- Found MPI_C: C:/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64/msmpi.lib (found version "2.0") 
-- Found MPI_CXX: C:/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64/msmpi.lib (found version "2.0") 
-- Found MPI: TRUE (found version "2.0")  
-- Enabled support for CUDA.
-- The CUDA compiler identification is NVIDIA 12.3.107
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
CMake Warning (dev) at CMakeLists.txt:185 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3 (found version "12.3") 
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/include (found version "12.3.107") 
-- CUDAToolkit_LIBRARY_ROOT='C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3'
-- Enabled support for CUDA.
-- Using TPL_BLAS_LIBRARIES='C:/OpenBLAS/lib/libopenblas.dll.a'
-- Will not link with LAPACK.
-- Will not link with ParMETIS.
-- EXTRA_LIB_EXPORT=''
-- Will not link with CombBLAS.
-- Configuring done (11.2s)
-- Generating done (0.4s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_COLOR_MAKEFILE


-- Build files have been written to: C:/Python Projects/build

But the VS solution doesn't really work well and building from there gives me all kinds of errors. I've tried to use older version of MSVC(2017) and MinGW, but no luck.

Any better solutions for Windows?

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

1 participant