DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.18k stars 263 forks source link

METIS issue on Windows with MSVC #247

Closed Fabian188 closed 1 year ago

Fabian188 commented 1 year ago

I am using the current dev2 branch on Windows with MSVC and Intel oneAPI installed.

This is the configuration

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\build>cmake .. -G "NMake Makefiles"
-- Building CHOLMOD version: v4.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/CHOLMOD
-- Build:         C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build
-- Build type:    Debug
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- Looking for CUDA
-- CUDA: not found
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_Fortran: -Qiopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- Found SuiteSparse_config: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib (found suitable version "7.0.0", minim
um required is "7.0.0")
-- SuiteSparse_config version: 7.0.0
-- SuiteSparse_config include: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- SuiteSparse_config library: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib
-- SuiteSparse_config static:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib
-- Found COLAMD: C:/Users/fabia/code/SuiteSparse-org/COLAMD/build/colamd.lib (found suitable version "3.0.3", minimum required is "3.0.3") 
-- COLAMD version: 3.0.3
-- COLAMD include: C:/Users/fabia/code/SuiteSparse-org/COLAMD/include
-- COLAMD library: C:/Users/fabia/code/SuiteSparse-org/COLAMD/build/colamd.lib
-- COLAMD static:  C:/Users/fabia/code/SuiteSparse-org/COLAMD/build/colamd.lib
-- Found AMD: C:/Users/fabia/code/SuiteSparse-org/AMD/build/amd.lib (found suitable version "3.0.3", minimum required is "3.0.3") 
-- AMD version: 3.0.3
-- AMD include: C:/Users/fabia/code/SuiteSparse-org/AMD/include
-- AMD library: C:/Users/fabia/code/SuiteSparse-org/AMD/build/amd.lib
-- AMD static:  C:/Users/fabia/code/SuiteSparse-org/AMD/build/amd.lib
-- Found CAMD: C:/Users/fabia/code/SuiteSparse-org/CAMD/build/camd.lib (found suitable version "3.0.3", minimum required is "3.0.3") 
-- CAMD version: 3.0.3
-- CAMD include: C:/Users/fabia/code/SuiteSparse-org/CAMD/include
-- CAMD library: C:/Users/fabia/code/SuiteSparse-org/CAMD/build/camd.lib
-- CAMD static:  C:/Users/fabia/code/SuiteSparse-org/CAMD/build/camd.lib
-- Found CCOLAMD: C:/Users/fabia/code/SuiteSparse-org/CCOLAMD/build/ccolamd.lib (found suitable version "3.0.3", minimum required is "3.0.3") 
-- CCOLAMD version: 3.0.3
-- CCOLAMD include: C:/Users/fabia/code/SuiteSparse-org/CCOLAMD/include
-- CCOLAMD library: C:/Users/fabia/code/SuiteSparse-org/CCOLAMD/build/ccolamd.lib
-- CCOLAMD static:  C:/Users/fabia/code/SuiteSparse-org/CCOLAMD/build/ccolamd.lib
-- Looking for Intel 32-bit BLAS
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/w
indows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x
86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- Found Intel10_64lp 32-bit BLAS
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- Found LAPACK: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest
/windows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files 
(x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- Building CHOLMOD_CUDA version: v4.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/CHOLMOD
-- Build:         C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build;C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build
-- Build type:    Debug
-- Looking for CUDA
-- CUDA: not found
-- CUDA: not enabled
-- The CXX compiler identification is MSVC 19.34.31937.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Installation will be system-wide (requires 'sudo make install')
-- OpenMP C libraries:       
-- OpenMP C include:         
-- OpenMP C flags:          -openmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler
/latest/windows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program
 Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS include:
-- BLAS linker flags:
-- LAPACK libraries:    C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler
/latest/windows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program
 Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- LAPACK include:
-- LAPACK linker flags:
-- Installation will be system-wide (requires 'sudo make install')
-- Skipping the demos in CHOLMOD/Demo
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: cholmod
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Debug
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS   -openmp
-- C++ compiler:         C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C++ flags:            /DWIN32 /D_WINDOWS /GR /EHsc -openmp
-- C Flags debug:        /Zi /Ob0 /Od /RTC1
-- C++ Flags debug:      /Zi /Ob0 /Od /RTC1
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe 
-- compile definitions:  BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/CHOLMOD/build

after some warnings about macro redefinition I get errors where the first one is

[ 44%] Building C object CMakeFiles/cholmod.dir/Partition/cholmod_metis_wrapper.c.obj
cholmod_metis_wrapper.c
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(19): error C2054: Nach "__thread" muss "(" folgen
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(19): error C2085: "SuiteSparse_metis_gk_cur_jbufs": Nicht in der form
alen Parameterliste enthalten
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(20): error C2082: Neudefinition des formalen Parameters "__thread"   
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(20): error C2146: Syntaxfehler: Fehlendes "," vor Bezeichner "jmp_buf
"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(20): error C2146: Syntaxfehler: Fehlendes "," vor Bezeichner "SuiteSp
arse_metis_gk_jbufs"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis\GKlib\gk_externs.h(20): error C2143: Syntaxfehler: Es fehlt ";" vor "["

I try to translate: All for SuiteSparse_metis\GKlib\gk_externs.h(19)

 error C2054: ater "__thread" must follow "(" 
 error C2085: "SuiteSparse_metis_gk_cur_jbufs": not contained in the formal parameter list
 error C2082: new definition of the formal parameter "__thread"   

Then for SuiteSparse_metis\GKlib\gk_externs.h(20)

 error C2082: new definition of the formal parameter "__thread"    
 error C2146: syntax error: missing "," before identifier "jmp_buf
 error C2146: syntax error: missing  "," before identifier "SuiteSparse_metis_gk_jbufs"
 error C2143: syntax error: missing ";" before "["

I want to add that I was not able to compile standalone the original METIS 5.1.0 http://glaros.dtc.umn.edu/gkhome/metis/metis/download on Windows but use the variant https://github.com/scivision/METIS (5.1.0.3) which has the same cmake interface but works out of the box for Linux, macOS and Windows (MSVC and IntelLLVM)

Fabian188 commented 1 year ago

I want to add, that it works with oneAPI's IntelLLVM icx (justset CC=icx before initial cmake).

So it seems to be a pure MSVC issue.

DrTimothyAldenDavis commented 1 year ago

I see what's happening. I don't use the cmake system of METIS at all (I use my own, inside CHOLMOD). In the scivision cmake, and in the original METIS cmake, there is a definition of thread as declspec(thread), using a -D option, when using MSVC. I've just added that internally, in the CHOLMOD/Partition/cholmod_metis_wrapper.h.

I just pushed this to the dev2 branch.

DrTimothyAldenDavis commented 1 year ago

What macro redefinition warnings do you get? I can clean those up.

Fabian188 commented 1 year ago

That works! Great :)

The warnings are

 43%] Building C object CMakeFiles/cholmod.dir/Partition/cholmod_l_metis.c.obj
cholmod_l_metis.c
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(72): warning C4005: "PRId32": Makro-Neudefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(116): note: Siehe vorherige Definition von "PRId32"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(73): warning C4005: "PRId64": Makro-Neudefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(117): note: Siehe vorherige Definition von "PRId64"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(74): warning C4005: "SCNd32": Makro-Neudefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(237): note: Siehe vorherige Definition von "SCNd32"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(75): warning C4005: "SCNd64": Makro-Neudefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(238): note: Siehe vorherige Definition von "SCNd64"
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(76): warning C4005: "INT32_MIN": Makro-Neudefinition
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(51): note: Siehe vorherige Definition von "INT32_MIN"       
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(77): warning C4005: "INT32_MAX": Makro-Neudefinition
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(55): note: Siehe vorherige Definition von "INT32_MAX"       
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(78): warning C4005: "INT64_MIN": Makro-Neudefinition
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(52): note: Siehe vorherige Definition von "INT64_MIN"       
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(79): warning C4005: "INT64_MAX": Makro-Neudefinition
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(56): note: Siehe vorherige Definition von "INT64_MAX"       
[ 43%

Which means

SuiteSparse_metis/include/metis.h(72): warning C4005: "PRId32": macro re-definition
...\ucrt\inttypes.h(116): note: see previous definition of "PRId32"
Fabian188 commented 1 year ago

In case you are interested, I give you also the warnings of Intel's 2023 IntelLLVM compiler

In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check\cholmod_l_read.c:12:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check/cholmod_read.c(433,15): warning: 'sscanf' is deprecated: This function or variable may be unsafe. Consider   
      using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
            nitems = sscanf (buf, "%lg %lg %lg %lg\n", &l1, &l2, &l3, &l4) ;
                     ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\stdio.h(2239,20): note: 'sscanf' has been explicitly marked deprecated here
    _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s)
                   ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT' 
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check\cholmod_l_read.c:12:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check/cholmod_read.c(613,15): warning: 'sscanf' is deprecated: This function or variable may be unsafe. Consider   
      using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
            nitems = sscanf (buf, "%lg %lg %lg %lg\n", &l1, &l2, &x, &z) ;
                     ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\stdio.h(2239,20): note: 'sscanf' has been explicitly marked deprecated here
    _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s)
                   ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check\cholmod_l_read.c:12:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check/cholmod_read.c(964,12): warning: 'sscanf' is deprecated: This function or variable may be unsafe. Consider   
      using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
                nitems = sscanf (buf, "%lg %lg\n", &x, &z) ;
                         ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\stdio.h(2239,20): note: 'sscanf' has been explicitly marked deprecated here
    _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s)
                   ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT' 
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
3 warnings generated.

There are several more sscanf warnings in other files plus

In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check\cholmod_l_write.c:12:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Check/cholmod_write.c(52,7): warning: 'fopen' is deprecated: This function or variable may be unsafe. Consider     
      using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
        cf = fopen (comments, "r") ;
             ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\stdio.h(212,20): note: 'fopen' has been explicitly marked deprecated here
    _Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
                   ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT' 
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))

The macro redefinition from the previous post is reported by IntelLLVM as

C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(72,9): warning: 'PRId32' macro redefined [-Wmacro-redefined]
#define PRId32       "I32d"
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(116,9): note: previous definition is here
#define PRId32       "d"
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(73,9): warning: 'PRId64' macro redefined [-Wmacro-redefined]
#define PRId64       "I64d"
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(117,9): note: previous definition is here
#define PRId64       "lld"
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(74,9): warning: 'SCNd32' macro redefined [-Wmacro-redefined]
#define SCNd32       "ld"
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(237,9): note: previous definition is here
#define SCNd32       "d"
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(75,9): warning: 'SCNd64' macro redefined [-Wmacro-redefined]
#define SCNd64       "I64d"
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\inttypes.h(238,9): note: previous definition is here
#define SCNd64       "lld"
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(76,9): warning: 'INT32_MIN' macro redefined [-Wmacro-redefined]
#define INT32_MIN    ((int32_t)_I32_MIN)
        ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(51,9): note: previous definition is here
#define INT32_MIN        (-2147483647i32 - 1)
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(77,9): warning: 'INT32_MAX' macro redefined [-Wmacro-redefined]
#define INT32_MAX    _I32_MAX
        ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(55,9): note: previous definition is here
#define INT32_MAX        2147483647i32
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(78,9): warning: 'INT64_MIN' macro redefined [-Wmacro-redefined]
#define INT64_MIN    ((int64_t)_I64_MIN)
        ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(52,9): note: previous definition is here
#define INT64_MIN        (-9223372036854775807i64 - 1)
        ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_l_metis.c:12:
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition/cholmod_metis.c:58:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/include/metis.h(79,9): warning: 'INT64_MAX' macro redefined [-Wmacro-redefined]
#define INT64_MAX    _I64_MAX
        ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdint.h(56,9): note: previous definition is here
#define INT64_MAX        9223372036854775807i64
        ^
8 warnings generated.
Fabian188 commented 1 year ago

With respect to the macros I would do a if defined() -> undef() -> define() for the ones with different content and if not defined() -> define() for the ones with same content.

DrTimothyAldenDavis commented 1 year ago

Thanks for the details. I can silence those warnings.

So all of SuiteSparse notes compiles in MSVC?

Fabian188 commented 1 year ago

There are also warnings with icx from metis itself

In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_metis_wrapper.c:41:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/GKlib/error.c(178,10): warning: 'strerror' is deprecated: This function or variable may be       
      unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] 
  return strerror(errnum);
         ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\string.h(177,16): note: 'strerror' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(strerror_s)
               ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT' 
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
In file included from C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\Partition\cholmod_metis_wrapper.c:53:
C:\Users\fabia\code\SuiteSparse-org\CHOLMOD\SuiteSparse_metis/GKlib/string.c(382,5): warning: 'strcpy' is deprecated: This function or variable may be unsafe. 
      Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
    strcpy(str, orgstr);
    ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\string.h(130,1): note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\corecrt.h(835,5): note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
    __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _...     
    ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt\corecrt.h(1894,17): note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'    
                _CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
                ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(355,55): note: expanded from macro
      '_CRT_INSECURE_DEPRECATE'
        #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT(    \
                                                      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vcruntime.h(345,47): note: expanded from macro '_CRT_DEPRECATE_TEXT' 
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
2 warnings generated.

In our own application I added -Wno-deprecated-declarations when CMAKE_CXX_COMPILER MATCHES "IntelLLVM", however some warnings and their preventions are only known for the most recent IntelLLVM (I'm right now not sure about this one).

Fabian188 commented 1 year ago

Thanks for the details. I can silence those warnings.

So all of SuiteSparse notes compiles in MSVC?

I just checked CHOLMOD and UMFPACK. I can test more for you, but I suggest I wait for the macro warnings suppressed, then I can more easily see if there come additional warnings.

DrTimothyAldenDavis commented 1 year ago

The redefintions of INT32_MAX, etc, can easily be fixed by including GKlib.h first. There's already a guard in place to check for _GKLIB_H_ and skip the definitions if that is found. That doesn't require a change to METIS, just how I build and use it.

All of the security warnings for CHOLMOD are fine. I can just disable the warnings since I use fopen and sscanf in a secure manner. The warnings for strcpy and strerror in METIS are also tame since I don't use the parts of METIS that call those methods (gk_strdup and gk_strerror are not used). I can just remove them from being compiled.

DrTimothyAldenDavis commented 1 year ago

I've just pushed my updates to the dev2 branch. Can you give it a try?

Fabian188 commented 1 year ago

I have an issue with just pulled dev. I build with MSVC 19 I first built SuiteSparse_config but got this error with AMD

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/AMD 
-- Build:         C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- Build type:    Release
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SuiteSparse_config (missing: SUITESPARSE_CONFIG_LIBRARIES)
  (found suitable version "7.0.0", minimum required is "7.0.0")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake:109 (find_package_handle_standard_args)
  CMakeLists.txt:61 (find_package)

-- Configuring incomplete, errors occurred!
See also "C:/Users/fabia/code/SuiteSparse-org/AMD/build/CMakeFiles/CMakeOutput.log".
Fabian188 commented 1 year ago

This was the log from building SuiteSparse_config

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- Build:         C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- Build type:    Release
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_Fortran: -Qiopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- Looking for Intel 32-bit BLAS
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/co
mpiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/m
kl/latest/lib/intel64/mkl_core_dll.lib
-- Found Intel10_64lp 32-bit BLAS
-- OpenMP C libraries:       
-- OpenMP C include:         
-- OpenMP C flags:          -openmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/w
indows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel
/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Release
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS -openmp
-- C++ compiler:
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>nmake

Microsoft (R) Program Maintenance Utility, Version 14.34.31937.0
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

[ 25%] Building C object CMakeFiles/suitesparseconfig.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\SuiteSparse_config.c(192): warning C4098: "SuiteSparse_config_free": "void"-Funktion gibt einen Wert zur
ück
[ 50%] Linking C shared library suitesparseconfig.dll
[ 50%] Built target suitesparseconfig
[ 75%] Building C object CMakeFiles/suitesparseconfig_static.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\SuiteSparse_config.c(192): warning C4098: "SuiteSparse_config_free": "void"-Funktion gibt einen Wert zur
ück
[100%] Linking C static library suitesparseconfig_static.lib
[100%] Built target suitesparseconfig_static

BTW, the waring complains about the void function having a return

void SuiteSparse_config_free (void *p)
{
    return (SuiteSparse_config.free_func (p)) ;
}
DrTimothyAldenDavis commented 1 year ago

Is that on the dev2 branch? Or dev?

Not sure why this should be failing since not much has changed since this method worked. I just pushed an update to the dev2 branch. The FindSuiteSparse_config.cmake will report more details if it fails. Can you give it a try?

DrTimothyAldenDavis commented 1 year ago

Did you do a clean install? Maybe there was something stale.

DrTimothyAldenDavis commented 1 year ago

It might have something to do with the naming of static libraries. In the previous method, the results were:

...
-- Found SuiteSparse_config: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib (found suitable version "7.0.0", minimum required is "7.0.0")
-- SuiteSparse_config version: 7.0.0
-- SuiteSparse_config include: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- SuiteSparse_config library: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib
-- SuiteSparse_config static:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.lib
...

which is slightly wrong. cmake was finding the same libraries for both static and dynamic. Maybe the change in the naming of static libraries for MSVC caused this problem.

Fabian188 commented 1 year ago

Unfortunately it seems there is no history command on Windows, which would make it easier.

I deleted the code, cloned freshly (On Linux/macOSmake clean works, but nmake cleandoes not), checked out dev2 and got the same error.

It might not help here, but own WIN32 guards are not necessary when using CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, ... https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html

I have the same error with icx on Windows.

DrTimothyAldenDavis commented 1 year ago

Can you post the full report from cmake? I added a message that should state the reason for the failure.

DrTimothyAldenDavis commented 1 year ago

I added more messages from FindSuiteSparseConfig.cmake, just now, and pushed them to the dev2 branch.

Fabian188 commented 1 year ago

I beliefe I do everything correct. I need to stop, it's almost 2:30 AM here

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>rmdir build /s
build, Are you sure (Y/N)? y

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>mkdir build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>cd build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- Build:         C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- Build type:    Release
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_Fortran: -Qiopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- Looking for Intel 32-bit BLAS
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/co
mpiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/m
kl/latest/lib/intel64/mkl_core_dll.lib
-- Found Intel10_64lp 32-bit BLAS
-- OpenMP C libraries:       
-- OpenMP C include:         
-- OpenMP C flags:          -openmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/w
indows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel
/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Release
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS -openmp
-- C++ compiler:
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>nmake

Microsoft (R) Program Maintenance Utility, Version 14.34.31937.0
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

[ 25%] Building C object CMakeFiles/suitesparseconfig.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
[ 50%] Linking C shared library suitesparseconfig.dll
[ 50%] Built target suitesparseconfig
[ 75%] Building C object CMakeFiles/suitesparseconfig_static.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
[100%] Linking C static library suitesparseconfig_static.lib
[100%] Built target suitesparseconfig_static

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>dir
 Volume in drive C is Windows
 Volume Serial Number is 8EAD-1479

 Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build

01/03/2023  02:26 AM    <DIR>          .
01/03/2023  02:26 AM    <DIR>          ..
01/03/2023  02:25 AM            23,329 CMakeCache.txt
01/03/2023  02:26 AM    <DIR>          CMakeFiles
01/03/2023  02:25 AM             3,540 cmake_install.cmake
01/03/2023  02:25 AM             8,692 Makefile
01/03/2023  02:26 AM            10,752 suitesparseconfig.dll
01/03/2023  02:26 AM               381 suitesparseconfig.dll.manifest
01/03/2023  02:26 AM            16,364 suitesparseconfig_static.lib
               6 File(s)         63,058 bytes
               3 Dir(s)  193,419,010,048 bytes free

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>cd ..

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>cd ..

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org>cd AMD

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD>rmdir build /s
build, Are you sure (Y/N)? y

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD>mkdir build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD>cd build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/AMD 
-- Build:         C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- Build type:    Release
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- library suffixes: .lib
-- SuiteSparse_config include: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- SuiteSparse_config library: SUITESPARSE_CONFIG_LIBRARY-NOTFOUND
-- SuiteSparse_config library: SUITESPARSE_CONFIG_LIBRARY-NOTFOUND
-- SuiteSparse_config static:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig_static.lib
-- version here :
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
-- version again: 7.0.0
-- library again: C:/Users/fabia/code/SuiteSparse-org/AMD/SUITESPARSE_CONFIG_LIBRARY-NOTFOUND
-- static again:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig_static.lib
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SuiteSparse_config (missing: SUITESPARSE_CONFIG_LIBRARY)
  (found suitable version "7.0.0", minimum required is "7.0.0")

      Reason given by package: result

Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake:124 (find_package_handle_standard_args)
  CMakeLists.txt:61 (find_package)

-- Configuring incomplete, errors occurred!
See also "C:/Users/fabia/code/SuiteSparse-org/AMD/build/CMakeFiles/CMakeOutput.log".

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>git branch
* dev2
  stable

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>git pull
Already up to date.

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>git log
commit 13a646373c4c3dd151da449b401aa691df622871 (HEAD -> dev2, origin/dev2)
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 19:10:52 2023 -0600

    debug FindSuiteSparse_config

commit a7138c67c36c1e0463f3d8885894ee354f018439
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 18:16:02 2023 -0600

    revise Find*.cmake

commit 072e697a5cc4e39141cdc43c94eeefa83078356d
Author: Tim Davis <davis@tamu.edu>
Date:   Mon Jan 2 16:30:21 2023 -0600

    MATLAB interface

commit d314a098ee213fff253bca0d0fbfa96328a6b740
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 15:47:13 2023 -0600

    changelog for UMFPACK v6.0.3

commit fb0a49973412c7cc5e023c7973cd2ce6abc43495
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 15:43:40 2023 -0600

    current issues in SuiteSparse v7.0.0

commit 66709cbd548c323531a0714aa2d19301e52fdb75
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 15:43:17 2023 -0600

    revert GraphBLAS wildtype_demo to non _Generic methods

commit 3957ccfa5dc700e78aca480333fc4071cceb8a84
Author: Tim Davis <DrTimothyAldenDavis@gmail.com>
Date:   Mon Jan 2 15:32:32 2023 -0600

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>
DrTimothyAldenDavis commented 1 year ago

Thanks! I see what's happening. This is an eye opener. The default list of suffixes to search is just ".lib"!

That is the static suffix. No DLL in that list.

So the search for the dynamic library only looks for suitesparseconfig.lib (the static lib). Before, that was found but it was a mistake. That name now doesn't exist. The static library is now called suitesparseconfig_static.lib.

I'll revise the Find*.cmake accordingly. I think I know what to do to fix it.

DrTimothyAldenDavis commented 1 year ago

I've just pushed a revision to the dev2 branch that will hopefully fix this. I kept all the verbose messages in FindSuiteSparse_config.cmake, but I'll remove those once this is working. I'll push this to the dev branch to trigger the CI.

Fabian188 commented 1 year ago

dev to build AMD again

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/AMD 
-- Build:         C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- Build type:    Release
-- CUDA: not enabled
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- library suffixes: .lib
-- SuiteSparse_config inc: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- suffixes for dynamic search: .dll;.lib
-- SuiteSparse_config library: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.dll
-- suffixes for static search: .lib;.dll;.lib
-- SuiteSparse_config library: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.dll
-- SuiteSparse_config static:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig_static.lib
-- version here :
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
-- version again: 7.0.0
-- library again: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.dll
-- static again:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig_static.lib
-- Found SuiteSparse_config: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.dll (found suitable version "7.0.0", minimum requir
ed is "7.0.0")
-- result:
-- SuiteSparse_config version: 7.0.0
-- SuiteSparse_config include: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config
-- SuiteSparse_config library: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig.dll
-- SuiteSparse_config static:  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build/suitesparseconfig_static.lib
-- Installation will be system-wide (requires 'sudo make install')
-- Skipping the demos in AMD/Demo
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: amd
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Release
-- NSTATIC:              false (build static library)
-- use OpenMP:           no
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS
-- C++ compiler:
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     none
-- compile definitions:  _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/AMD/build
Fabian188 commented 1 year ago

Sorry - too early. CMake runs but build fails

[ 48%] Building C object CMakeFiles/amd.dir/Source/amd_valid.c.obj
amd_valid.c
[ 50%] Linking C shared library amd.dll
LINK: command "C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\amd.dir\objects1 /out:amd.dll /implib:a
md.lib /pdb:C:\Users\fabia\code\SuiteSparse-org\AMD\build\amd.pdb /dll /version:3.0 /machine:x64 /INCREMENTAL:NO /Qoption,link,/DEF:CMakeFiles\amd.dir\exports.
def C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build\suitesparseconfig.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib ole
aut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:amd.dll.manifest" failed (exit code 1107) with the following output:
LINK : warning LNK4044: Nicht erkannte Option /Qoption,link,/DEF:CMakeFiles\amd.dir\exports.def; wird ignoriert.
C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build\suitesparseconfig.dll : fatal error LNK1107: Ungültige oder beschädigte Datei: Lesen bei 0x2E0 nic
ht möglich.
NMAKE : fatal error U1077: ""C:\Program Files\CMake\bin\cmake.exe"": Rückgabe-Code "0xffffffff"
Stop.
NMAK

Translation

Warning LNK4044: Not recognized option  /Qoption,link,/DEF:CMakeFiles\amd.dir\exports.def; will be ignored.
C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build\suitesparseconfig.dll : fatal error LNK1107: invalid or damaged file: reading at 0x2E0 not possible.```

abia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>dir ....\SuiteSparse_config\build Volume in drive C is Windows Volume Serial Number is 8EAD-1479

Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build

01/03/2023 11:28 AM

. 01/03/2023 11:28 AM .. 01/03/2023 11:24 AM 23,329 CMakeCache.txt 01/03/2023 11:28 AM CMakeFiles 01/03/2023 11:24 AM 3,540 cmake_install.cmake 01/03/2023 11:24 AM 8,692 Makefile 01/03/2023 11:28 AM 10,752 suitesparseconfig.dll 01/03/2023 11:28 AM 381 suitesparseconfig.dll.manifest 01/03/2023 11:28 AM 16,364 suitesparseconfig_static.lib 6 File(s) 63,058 bytes

DrTimothyAldenDavis commented 1 year ago

Odd. It looks like this cmake mechanism for exporting the symbols expects the cl compiler to generate a .def file, as the file amd.dir/export.def.

But instead, the cl compiler creates amd.dll.manifest.

So when cmake creates the command to link with AMD, it tries to find the .def file but it doesn't exist.

DrTimothyAldenDavis commented 1 year ago

Did you try the dev or dev2 branch? I didn't push it to dev yet because I was waiting for the CI to finish on the pull request.

Fabian188 commented 1 year ago

I always use dev2

DrTimothyAldenDavis commented 1 year ago

OK. It seems this might be a fundamental issue with cmake, and the WINDOWS_EXPORT_ALL_SYMBOLS option. It's not working for MSVC, at least with ninja makefiles.

Can you try it without ninja, and use the MSVC defaults?

realbabilu commented 1 year ago

hmm now we have error with amd building, there is no error last morning. Last Succeed run on dev2 3:24 AM (GMT+7) https://pastebin.com/XkwSVZrP SHARED LIB https://pastebin.com/q8PVRk4Z STATIC LIB both cmake create DLL and LIB, but both cmake use LIB to link. both demo UMF4.exe shared and static still need dynamic shared UMFpack.dll and AMD.dll, Eventhough i create linking with static LIB manually. it still needed those DLLs to run, another of using umfpack_static.lib needs with optional /MD to compiler

D:\intel-run\SuiteSparse-dev2\lib\icl32static>icl umf4_f77wrapper.c -I"d:\intel-run\SuiteSparse-dev2\Include" umfpack.lib amd.lib /c
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

icl: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '/Qdiag-disable:10441' to disable this message.
umf4_f77wrapper.c

D:\intel-run\SuiteSparse-dev2\lib\icl32static>ifort umf4hb.f -I"d:\intel-run\SuiteSparse-dev2\Include" umfpack.lib amd.lib umf4_f77wrapper.obj
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.33.31630.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:umf4hb.exe
-subsystem:console
umf4hb.obj
umf4_f77wrapper.obj
umfpack.lib
amd.lib

With the latest dev2.... With static build latest version dev2

D:\intel-run\SuiteSparse-dev2>icl32static.bat

D:\intel-run\SuiteSparse-dev2>cd SuiteSparse_config

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config>cd build

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>CMAKE -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_C_COMPILER=icx.exe  -DCMAKE_BUILD_TYPE=RELEASE -DLOCAL_INSTALL=TRUE -DNSTATIC=TRUE  -DBLA_VENDOR=Intel10_64lp -DALLOW_64BIT_BLAS=FALSE -DNOPENMP=FALSE -DDEMO=TRUE -DCMAKE_Fortran_COMPILER=ifort.exe -DCMAKE_CXX_COMPILER=icx.exe ..
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- Build:         D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build
-- Local install: D:/intel-run/SuiteSparse-dev2/lib
-- Local include: D:/intel-run/SuiteSparse-dev2/include
-- Local bin:     D:/intel-run/SuiteSparse-dev2/bin
-- Install rpath: D:/intel-run/SuiteSparse-dev2/lib
-- Build   rpath: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build;D:/intel-run/SuiteSparse-dev2/lib
-- Build type:    RELEASE
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- CUDA: not enabled
-- Looking for 32-BLAS: Intel10_64lp
-- Found Intel10_64lp 32-bit BLAS
-- Specific BLAS: Intel10_64lp found: TRUE
-- OpenMP C libraries:
-- OpenMP C include:
-- OpenMP C flags:          -Qiopenmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- Installation in ../lib and ../include,
--   with 'make local ; make install'. No 'sudo' required.
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: true
-- build type:           RELEASE
-- NSTATIC:              true (do not build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe
-- C flags:              /DWIN32 /D_WINDOWS -Qiopenmp
-- C++ compiler:         icx.exe
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>jom

jom 1.1.3 - empower your cores

jom: parallel job execution disabled for Makefile
[100%] Built target suitesparseconfig

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>copy *.* ..\..\lib
.gitignore
CMakeCache.txt
cmake_install.cmake
Makefile
suitesparseconfig.dll
suitesparseconfig.dll.manifest
suitesparseconfig.exp
suitesparseconfig.lib
suitesparseconfig_static.lib
        9 file(s) copied.

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>cd ..\..

D:\intel-run\SuiteSparse-dev2>cd AMD

D:\intel-run\SuiteSparse-dev2\AMD>cd build

D:\intel-run\SuiteSparse-dev2\AMD\build>CMAKE -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_C_COMPILER=icx.exe  -DCMAKE_BUILD_TYPE=RELEASE -DLOCAL_INSTALL=TRUE -DNSTATIC=TRUE  -DBLA_VENDOR=Intel10_64lp -DALLOW_64BIT_BLAS=FALSE -DNOPENMP=FALSE -DDEMO=TRUE -DCMAKE_Fortran_COMPILER=ifort.exe -DCMAKE_CXX_COMPILER=icx.exe ..
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        D:/intel-run/SuiteSparse-dev2/AMD
-- Build:         D:/intel-run/SuiteSparse-dev2/AMD/build
-- The C compiler identification is IntelLLVM 2022.2.0 with MSVC-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Local install: D:/intel-run/SuiteSparse-dev2/lib
-- Local include: D:/intel-run/SuiteSparse-dev2/include
-- Local bin:     D:/intel-run/SuiteSparse-dev2/bin
-- Install rpath: D:/intel-run/SuiteSparse-dev2/lib
-- Build   rpath: D:/intel-run/SuiteSparse-dev2/AMD/build;D:/intel-run/SuiteSparse-dev2/lib
-- Build type:    RELEASE
-- The Fortran compiler identification is Intel 2021.7.0.20220726
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- CUDA: not enabled
-- library suffixes: .lib;.a
-- SuiteSparse_config inc: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- suffixes for dynamic search: .dll;.lib;.a
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- suffixes for static search: .lib;.dll;.lib;.a
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- SuiteSparse_config static:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- version here :
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
-- version again: 7.0.0
-- library again: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- static again:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- Found SuiteSparse_config: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll (found suitable version "7.0.0", minimum required is "7.0.0")
-- result:
-- SuiteSparse_config version: 7.0.0
-- SuiteSparse_config include: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- SuiteSparse_config static:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- Installation will be system-wide (requires 'sudo make install')
-- Installation in ../lib and ../include,
--   with 'make local ; make install'. No 'sudo' required.
-- Also compiling the demos in AMD/Demo
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: amd
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: true
-- build type:           RELEASE
-- NSTATIC:              true (do not build static library)
-- use OpenMP:           no
-- C compiler:           C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe
-- C flags:              /DWIN32 /D_WINDOWS
-- C++ compiler:         icx.exe
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     none
-- compile definitions:  _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ALLOW_64BIT_BLAS
    BLA_VENDOR
    NOPENMP

-- Build files have been written to: D:/intel-run/SuiteSparse-dev2/AMD/build

D:\intel-run\SuiteSparse-dev2\AMD\build>jom

jom 1.1.3 - empower your cores

jom: parallel job execution disabled for Makefile
[  3%] Building C object CMakeFiles/amd.dir/Source/amd_1.c.obj
[  6%] Building C object CMakeFiles/amd.dir/Source/amd_2.c.obj
[  9%] Building C object CMakeFiles/amd.dir/Source/amd_aat.c.obj
[ 12%] Building C object CMakeFiles/amd.dir/Source/amd_control.c.obj
[ 15%] Building C object CMakeFiles/amd.dir/Source/amd_defaults.c.obj
[ 18%] Building C object CMakeFiles/amd.dir/Source/amd_dump.c.obj
[ 21%] Building C object CMakeFiles/amd.dir/Source/amd_info.c.obj
[ 24%] Building C object CMakeFiles/amd.dir/Source/amd_l1.c.obj
[ 27%] Building C object CMakeFiles/amd.dir/Source/amd_l2.c.obj
[ 30%] Building C object CMakeFiles/amd.dir/Source/amd_l_aat.c.obj
[ 33%] Building C object CMakeFiles/amd.dir/Source/amd_l_control.c.obj
[ 36%] Building C object CMakeFiles/amd.dir/Source/amd_l_defaults.c.obj
[ 39%] Building C object CMakeFiles/amd.dir/Source/amd_l_dump.c.obj
[ 42%] Building C object CMakeFiles/amd.dir/Source/amd_l_info.c.obj
[ 45%] Building C object CMakeFiles/amd.dir/Source/amd_l_order.c.obj
[ 48%] Building C object CMakeFiles/amd.dir/Source/amd_l_post_tree.c.obj
[ 51%] Building C object CMakeFiles/amd.dir/Source/amd_l_postorder.c.obj
[ 54%] Building C object CMakeFiles/amd.dir/Source/amd_l_preprocess.c.obj
[ 57%] Building C object CMakeFiles/amd.dir/Source/amd_l_valid.c.obj
[ 60%] Building C object CMakeFiles/amd.dir/Source/amd_order.c.obj
[ 63%] Building C object CMakeFiles/amd.dir/Source/amd_post_tree.c.obj
[ 66%] Building C object CMakeFiles/amd.dir/Source/amd_postorder.c.obj
[ 69%] Building C object CMakeFiles/amd.dir/Source/amd_preprocess.c.obj
[ 72%] Building C object CMakeFiles/amd.dir/Source/amd_valid.c.obj
[ 75%] Linking C shared library amd.dll
LINK: command "C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin\icx.exe /nologo @CMakeFiles\amd.dir\objects1 -LD /Qoption,link,/machine:x64 /INCREMENTAL:NO /Qoption,link,/DEF:CMakeFiles\amd.dir\exports.def D:\intel-run\SuiteSparse-dev2\lib\suitesparseconfig.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib -link /out:amd.dll /implib:amd.lib /pdb:D:\intel-run\SuiteSparse-dev2\AMD\build\amd.pdb /version:3.0 /MANIFEST /MANIFESTFILE:amd.dll.manifest" failed (exit code 1107) with the following output:
D:\intel-run\SuiteSparse-dev2\lib\suitesparseconfig.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x308
icx: error: linker command failed with exit code 1107 (use -v to see invocation)
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\CMakeFiles\amd.dir\build.make [amd.dll] Error 2
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\CMakeFiles\Makefile2 [CMakeFiles\amd.dir\all] Error 2
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\Makefile [all] Error 2

D:\intel-run\SuiteSparse-dev2\AMD\build>copy *.* ..\..\lib
CMakeCache.txt
cmake_install.cmake
Makefile
        3 file(s) copied.

D:\intel-run\SuiteSparse-dev2\AMD\build>cd ..\..

With shared build


D:\intel-run\SuiteSparse-dev2>icl32shared.bat

D:\intel-run\SuiteSparse-dev2>cd SuiteSparse_config

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config>cd build

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>CMAKE -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_C_COMPILER=icx.exe  -DCMAKE_BUILD_TYPE=RELEASE -DLOCAL_INSTALL=TRUE -DNSTATIC=FALSE  -DBLA_VENDOR=Intel10_64lp -DALLOW_64BIT_BLAS=FALSE -DNOPENMP=FALSE -DDEMO=TRUE -DCMAKE_Fortran_COMPILER=ifort.exe -DCMAKE_CXX_COMPILER=icx.exe ..
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- Build:         D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build
-- Local install: D:/intel-run/SuiteSparse-dev2/lib
-- Local include: D:/intel-run/SuiteSparse-dev2/include
-- Local bin:     D:/intel-run/SuiteSparse-dev2/bin
-- Install rpath: D:/intel-run/SuiteSparse-dev2/lib
-- Build   rpath: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build;D:/intel-run/SuiteSparse-dev2/lib
-- Build type:    RELEASE
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- CUDA: not enabled
-- Looking for 32-BLAS: Intel10_64lp
-- Found Intel10_64lp 32-bit BLAS
-- Specific BLAS: Intel10_64lp found: TRUE
-- OpenMP C libraries:
-- OpenMP C include:
-- OpenMP C flags:          -Qiopenmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- Installation in ../lib and ../include,
--   with 'make local ; make install'. No 'sudo' required.
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: true
-- build type:           RELEASE
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe
-- C flags:              /DWIN32 /D_WINDOWS -Qiopenmp
-- C++ compiler:         icx.exe
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config/build

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>jom

jom 1.1.3 - empower your cores

jom: parallel job execution disabled for Makefile
[ 25%] Building C object CMakeFiles/suitesparseconfig.dir/SuiteSparse_config.c.obj
[ 75%] Linking C shared library suitesparseconfig.dll
[ 50%] Building C object CMakeFiles/suitesparseconfig_static.dir/SuiteSparse_config.c.obj
[100%] Linking C static library suitesparseconfig_static.lib
[100%] Built target suitesparseconfig_static
[100%] Built target suitesparseconfig

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>copy *.* ..\..\lib
.gitignore
CMakeCache.txt
cmake_install.cmake
Makefile
suitesparseconfig.dll
suitesparseconfig.dll.manifest
suitesparseconfig.exp
suitesparseconfig.lib
suitesparseconfig_static.lib
        9 file(s) copied.

D:\intel-run\SuiteSparse-dev2\SuiteSparse_config\build>cd ..\..

D:\intel-run\SuiteSparse-dev2>cd AMD

D:\intel-run\SuiteSparse-dev2\AMD>cd build

D:\intel-run\SuiteSparse-dev2\AMD\build>CMAKE -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_C_COMPILER=icx.exe  -DCMAKE_BUILD_TYPE=RELEASE -DLOCAL_INSTALL=TRUE -DNSTATIC=FALSE  -DBLA_VENDOR=Intel10_64lp -DALLOW_64BIT_BLAS=FALSE -DNOPENMP=FALSE -DDEMO=TRUE -DCMAKE_Fortran_COMPILER=ifort.exe -DCMAKE_CXX_COMPILER=icx.exe ..
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        D:/intel-run/SuiteSparse-dev2/AMD
-- Build:         D:/intel-run/SuiteSparse-dev2/AMD/build
-- The C compiler identification is IntelLLVM 2022.2.0 with MSVC-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Local install: D:/intel-run/SuiteSparse-dev2/lib
-- Local include: D:/intel-run/SuiteSparse-dev2/include
-- Local bin:     D:/intel-run/SuiteSparse-dev2/bin
-- Install rpath: D:/intel-run/SuiteSparse-dev2/lib
-- Build   rpath: D:/intel-run/SuiteSparse-dev2/AMD/build;D:/intel-run/SuiteSparse-dev2/lib
-- Build type:    RELEASE
-- The Fortran compiler identification is Intel 2021.7.0.20220726
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe
-- CUDA: not enabled
-- library suffixes: .lib;.a
-- SuiteSparse_config inc: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- suffixes for dynamic search: .dll;.lib;.a
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- suffixes for static search: .lib;.dll;.lib;.a
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- SuiteSparse_config static:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- version here :
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
-- version again: 7.0.0
-- library again: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- static again:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- Found SuiteSparse_config: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll (found suitable version "7.0.0", minimum required is "7.0.0")
-- result:
-- SuiteSparse_config version: 7.0.0
-- SuiteSparse_config include: D:/intel-run/SuiteSparse-dev2/SuiteSparse_config
-- SuiteSparse_config library: D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig.dll
-- SuiteSparse_config static:  D:/intel-run/SuiteSparse-dev2/lib/suitesparseconfig_static.lib
-- Installation will be system-wide (requires 'sudo make install')
-- Installation in ../lib and ../include,
--   with 'make local ; make install'. No 'sudo' required.
-- Also compiling the demos in AMD/Demo
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: amd
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: true
-- build type:           RELEASE
-- NSTATIC:              false (build static library)
-- use OpenMP:           no
-- C compiler:           C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe
-- C flags:              /DWIN32 /D_WINDOWS
-- C++ compiler:         icx.exe
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     none
-- compile definitions:  _CRT_SECURE_NO_WARNINGS
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ALLOW_64BIT_BLAS
    BLA_VENDOR
    NOPENMP

-- Build files have been written to: D:/intel-run/SuiteSparse-dev2/AMD/build

D:\intel-run\SuiteSparse-dev2\AMD\build>jom

jom 1.1.3 - empower your cores

jom: parallel job execution disabled for Makefile
[  1%] Building C object CMakeFiles/amd.dir/Source/amd_1.c.obj
[  5%] Building C object CMakeFiles/amd.dir/Source/amd_2.c.obj
[  8%] Building C object CMakeFiles/amd.dir/Source/amd_aat.c.obj
[ 13%] Building C object CMakeFiles/amd.dir/Source/amd_control.c.obj
[ 15%] Building C object CMakeFiles/amd.dir/Source/amd_defaults.c.obj
[ 20%] Building C object CMakeFiles/amd.dir/Source/amd_dump.c.obj
[ 22%] Building C object CMakeFiles/amd.dir/Source/amd_info.c.obj
[ 27%] Building C object CMakeFiles/amd.dir/Source/amd_l1.c.obj
[ 29%] Building C object CMakeFiles/amd.dir/Source/amd_l2.c.obj
[ 34%] Building C object CMakeFiles/amd.dir/Source/amd_l_aat.c.obj
[ 36%] Building C object CMakeFiles/amd.dir/Source/amd_l_control.c.obj
[ 41%] Building C object CMakeFiles/amd.dir/Source/amd_l_defaults.c.obj
[ 43%] Building C object CMakeFiles/amd.dir/Source/amd_l_dump.c.obj
[ 48%] Building C object CMakeFiles/amd.dir/Source/amd_l_info.c.obj
[ 50%] Building C object CMakeFiles/amd.dir/Source/amd_l_order.c.obj
[ 55%] Building C object CMakeFiles/amd.dir/Source/amd_l_post_tree.c.obj
[ 56%] Building C object CMakeFiles/amd.dir/Source/amd_l_postorder.c.obj
[ 62%] Building C object CMakeFiles/amd.dir/Source/amd_l_preprocess.c.obj
[ 63%] Building C object CMakeFiles/amd.dir/Source/amd_l_valid.c.obj
[ 68%] Building C object CMakeFiles/amd.dir/Source/amd_order.c.obj
[ 70%] Building C object CMakeFiles/amd.dir/Source/amd_post_tree.c.obj
[ 75%] Building C object CMakeFiles/amd.dir/Source/amd_postorder.c.obj
[ 77%] Building C object CMakeFiles/amd.dir/Source/amd_preprocess.c.obj
[ 82%] Building C object CMakeFiles/amd.dir/Source/amd_valid.c.obj
[ 84%] Linking C shared library amd.dll
[  3%] Building C object CMakeFiles/amd_static.dir/Source/amd_1.c.obj
[  6%] Building C object CMakeFiles/amd_static.dir/Source/amd_2.c.obj
[ 10%] Building C object CMakeFiles/amd_static.dir/Source/amd_aat.c.obj
[ 12%] Building C object CMakeFiles/amd_static.dir/Source/amd_control.c.obj
[ 17%] Building C object CMakeFiles/amd_static.dir/Source/amd_defaults.c.obj
[ 18%] Building C object CMakeFiles/amd_static.dir/Source/amd_dump.c.obj
[ 24%] Building C object CMakeFiles/amd_static.dir/Source/amd_info.c.obj
[ 25%] Building C object CMakeFiles/amd_static.dir/Source/amd_l1.c.obj
[ 31%] Building C object CMakeFiles/amd_static.dir/Source/amd_l2.c.obj
[ 32%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_aat.c.obj
[ 37%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_control.c.obj
[ 39%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_defaults.c.obj
[ 44%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_dump.c.obj
[ 46%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_info.c.obj
[ 51%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_order.c.obj
[ 53%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_post_tree.c.obj
[ 58%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_postorder.c.obj
[ 60%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_preprocess.c.obj
[ 65%] Building C object CMakeFiles/amd_static.dir/Source/amd_l_valid.c.obj
[ 67%] Building C object CMakeFiles/amd_static.dir/Source/amd_order.c.obj
[ 72%] Building C object CMakeFiles/amd_static.dir/Source/amd_post_tree.c.obj
[ 74%] Building C object CMakeFiles/amd_static.dir/Source/amd_postorder.c.obj
[ 79%] Building C object CMakeFiles/amd_static.dir/Source/amd_preprocess.c.obj
[ 81%] Building C object CMakeFiles/amd_static.dir/Source/amd_valid.c.obj
[ 86%] Linking C static library amd_static.lib
LINK: command "C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin\icx.exe /nologo @CMakeFiles\amd.dir\objects1 -LD /Qoption,link,/machine:x64 /INCREMENTAL:NO /Qoption,link,/DEF:CMakeFiles\amd.dir\exports.def D:\intel-run\SuiteSparse-dev2\lib\suitesparseconfig.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib -link /out:amd.dll /implib:amd.lib /pdb:D:\intel-run\SuiteSparse-dev2\AMD\build\amd.pdb /version:3.0 /MANIFEST /MANIFESTFILE:amd.dll.manifest" failed (exit code 1107) with the following output:
D:\intel-run\SuiteSparse-dev2\lib\suitesparseconfig.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x308
icx: error: linker command failed with exit code 1107 (use -v to see invocation)
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\CMakeFiles\amd.dir\build.make [amd.dll] Error 2
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\CMakeFiles\Makefile2 [CMakeFiles\amd.dir\all] Error 2
[ 86%] Built target amd_static
jom: D:\intel-run\SuiteSparse-dev2\AMD\build\Makefile [all] Error 2

D:\intel-run\SuiteSparse-dev2\AMD\build>copy *.* ..\..\lib
amd_static.lib
CMakeCache.txt
cmake_install.cmake
Makefile
        4 file(s) copied.

D:\intel-run\SuiteSparse-dev2\AMD\build>cd ..\..

this because create dll by linking another dll.
LNK1107 can also occur if pass a .NET executable module (A .dll or .netmodule file created with [/clr:noAssembly] to the linker. To resolve this issue, pass the .obj file instead. Or lib as before..

DrTimothyAldenDavis commented 1 year ago

OK, I think I might have an idea of what's going wrong.

I revised the "Find*.cmake" scripts, to ensure that the right libraries were found. Or I tried, at least. I think that's broken.

On Unix, a dynamic library is called libwhatever.so, and static is libwhatever.a, and to link with them, you link those files. Likewise on Mac, the dynamic library is libwhatever.dylib, and the static is libwhatever.a.

On Windows, at least in MSVC, it seems you don't link directly to a whatever.dll. You link against whatever.lib, which then connects to a companion whatever.dll. The confusing thing is that a static library has the same suffix: .lib. Thus the renaming of the static library to whatever_static.lib. However, my confusion is in the linking. I think the dll must be linked as whatever.lib, not whatever.dll, and where whatever.lib is a very small file that describes how to link with whatever.dll. I think that's why my Find*.cmake scripts are now broken.

See for example https://discourse.cmake.org/t/dll-linking/4805/10

I think I know what to do.

DrTimothyAldenDavis commented 1 year ago

You wrote:

_

LNK1107 can also occur if pass a .NET executable module (A .dll or .netmodule file created with [/clr:noAssembly] to the linker. To resolve this issue, pass the .obj file instead. Or lib as before.. _

Yes, I think that is my confusion.

DrTimothyAldenDavis commented 1 year ago

I just pushed an update to the dev2 branch that might fix this. I'll trigger the CI now, but it works on Linux and Mac, so far. I revised all of the Find*.cmake scripts, which were returning the .dll

realbabilu commented 1 year ago

I dont tested yet. But maybe static or dynamic shared is on the final product: say the umfpack. The lib will still main output of its module at least in win32 environments

Fabian188 commented 1 year ago

I just checked out dev2. Usually I use nmake, wich is a native Microsoft Build tool (and very slow). I don't use ninja here.

I already did a native build without explicit CMAKE_MAKE_GENERATOR, which results for me in Visual Studio 17 2022 build files. This works for SuiteSparse_config (takes very long and the default CMAKE_BUILD_TYPE is Release where it is Debug for nmake) and I can build with MSBuild.exe suitesparseconfig.sln

However, for AMD I get the same error as for nmake:

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD\build>cmake .. -G "NMake Makefiles"
-- Building AMD version: v3.0.3 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/AMD
-- Build:         C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/AMD/build
-- Build type:    Debug
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- CUDA: not enabled
-- major: #define SUITESPARSE_MAIN_VERSION    7
-- minor: #define SUITESPARSE_SUB_VERSION     0
-- patch: #define SUITESPARSE_SUBSUB_VERSION  0
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SuiteSparse_config (missing: SUITESPARSE_CONFIG_LIBRARY)
  (found suitable version "7.0.0", minimum required is "7.0.0")

      Reason given by package: result

Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake:114 (find_package_handle_standard_args)
  CMakeLists.txt:60 (find_package)
fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD>git branch
* dev2
  stable

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\AMD>git log
commit d1a80e00bdbd1d3ef3c9526dcd4bc3c3023cbd2c (HEAD -> dev2, origin/dev2)
Author: Tim Davis <davis@tamu.edu>
Date:   Tue Jan 3 13:38:58 2023 -0600

    revise Find*.cmake for Windows MSVC

For my testing all worked some revisions ago - we were at the stage of removing build warnings.

The error is from SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake:114

I added two outputs to the findpackage...

message("SUITESPARSE_CONFIG_LIBRARY ${SUITESPARSE_CONFIG_LIBRARY}")
message("REQUIRED_VARS ${REQUIRED_VARS}")
find_package_handle_standard_args ( SuiteSparse_config
    REQUIRED_VARS SUITESPARSE_CONFIG_LIBRARY SUITESPARSE_CONFIG_INCLUDE_DIR
    VERSION_VAR SUITESPARSE_CONFIG_VERSION
    REASON_FAILURE_MESSAGE result
)

Output is

SUITESPARSE_CONFIG_LIBRARY C:/Users/fabia/code/SuiteSparse-org/AMD/SUITESPARSE_CONFIG_LIBRARY-NOTFOUND
REQUIRED_VARS
Fabian188 commented 1 year ago

This comes very early:

# dynamic libraries for SuiteSparse_config
find_library ( SUITESPARSE_CONFIG_LIBRARY
    NAMES suitesparseconfig
    HINTS ${SUITESPARSE_CONFIG_ROOT}
    HINTS ENV SUITESPARSE_CONFIG_ROOT
    HINTS ${CMAKE_SOURCE_DIR}/..
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config
    PATH_SUFFIXES lib build
)
cmake_print_variables(SUITESPARSE_CONFIG_LIBRARY)

gives SUITESPARSE_CONFIG_LIBRARY="SUITESPARSE_CONFIG_LIBRARY-NOTFOUND" I suggest to check here for NOTFOUND.

The similar

find_path ( SUITESPARSE_CONFIG_INCLUDE_DIR
    NAMES SuiteSparse_config.h
    HINTS ${SUITESPARSE_CONFIG_ROOT}
    HINTS ENV SUITESPARSE_CONFIG_ROOT
    HINTS ${CMAKE_SOURCE_DIR}/..
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config
    PATH_SUFFIXES include Include
)
cmake_print_variables(SUITESPARSE_CONFIG_INCLUDE_DIR)

works with output SUITESPARSE_CONFIG_INCLUDE_DIR="C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config"

As it works for the include, the only difference is the NAME.

I have for nmake (which is the configuration it once worked) the content

Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build

01/04/2023  12:48 AM    <DIR>          .
01/04/2023  12:48 AM    <DIR>          ..
01/04/2023  12:48 AM            23,327 CMakeCache.txt
01/04/2023  12:48 AM    <DIR>          CMakeFiles
01/04/2023  12:48 AM             3,547 cmake_install.cmake
01/04/2023  12:48 AM             8,692 Makefile
01/04/2023  12:48 AM            58,880 suitesparseconfig.dll
01/04/2023  12:48 AM           542,232 suitesparseconfig.ilk
01/04/2023  12:48 AM           905,216 suitesparseconfig.pdb
01/04/2023  12:48 AM            35,554 suitesparseconfig_static.lib

When I change NAME to suitesparseconfig_static.lib or suitesparseconfig_static it works! Not for suitesparseconfig.dll I can then also compile amd!

So the fix is to set the proper name in

find_library ( SUITESPARSE_CONFIG_LIBRARY
    NAMES suitesparseconfig_static
    HINTS ${SUITESPARSE_CONFIG_ROOT}
    HINTS ENV SUITESPARSE_CONFIG_ROOT
    HINTS ${CMAKE_SOURCE_DIR}/..
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config
    PATH_SUFFIXES lib build
)

It should work to have both variants concurrently https://cmake.org/cmake/help/latest/command/find_library.html

and I suggest to check NOTFOUND there.

DrTimothyAldenDavis commented 1 year ago

Thanks for the update. The prior versions only partially worked -- they were limited to linking against the static libraries, even if my documentation said that you were getting the dynamic library. I'm trying to get the dynamic linking to work. And I'm trying to give control to the user so that they choose static or dynamic.

I suppose I could punt, and use a single find_library, with two names. I think this is OK:

find_library ( SUITESPARSE_CONFIG_LIBRARY
  NAMES suitesparseconfig suitesparseconfig_static
... )

Then find_library would either find the dynamic one (if it exists) and if not, it would find the static one.

This will likely "work" in a way. However, the build system created both the suitesparseconfig.dll (the dynamic library) and the suitesparseconfig_static.lib (the static library). The "NAMES suitesparse suitesparse_static" should give preference to the dynamic library, if it exsts, and then find the static one if the dynamic one doesn't exist. But I'm guessing in your case it would find the static one, even though suitesparseconfig.dll is built and in the right place.

I thought that the .dll would come with a small suitesparseconfig.lib that is the front-end to the dll. I'm not sure why it's not in your suitesparseconfig build folder.

DrTimothyAldenDavis commented 1 year ago

Let me try revising my Find*cmake script to change the first find_library to add the 2 names. It won't hurt for Linux or Mac, since suitesparseconfig_static.a won't exist on those platforms.

I would keep the 2nd find_library since that is looking only for the static library, if it's desired. But the first find_library would be nice if it were to first try to find the dynamic library, and if not found, find the static one. That is actually what would happen on Linux and Mac, since "find_library ( ... NAMES amd ...)" will first look for libamd.so (the dynamic library) and then for libamd.a (static) if the libamd.so does not exist.

This change makes sense, I think. If only the static library is built, then WHATEVER_LIBRARY should point to that library WHATEVER. My cmake scripts always build the dynamic library, but this make sense as a fall-back. It would also get all of SuiteSparse compiling for you (except GraphBLAS, where I do not build the static library by default, since it takes so long). It will just link against the static libraries even though I'm trying to give preference to the dynamic ones.

I'll give this a try.

DrTimothyAldenDavis commented 1 year ago

Can you send me the output of when SuiteSparse_config was built?

Fabian188 commented 1 year ago

I'm not a Windows developer, so I cannot help here. But what I don't understand from the discussion: It is about three kinds in Windows: dynamic, static and install. However I see not where the third kind shall be triggered?

Up to now I had to change also AMD and COLAMD. With that CHOLMOD worked, UMFPACK too and BTF.

DrTimothyAldenDavis commented 1 year ago

I don't know the "install" library.

Fabian188 commented 1 year ago

In my case it needs to be a static lib - why ever. But nmake is also setting default to Debug ...

This is the complete log for a clean build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>rmdir build /s
build, Are you sure (Y/N)? y

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>mkdir build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config>cd build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release 
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config 
-- Build:         C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- The C compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Install rpath:
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- Build type:    Release
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- The Fortran compiler identification is IntelLLVM 2023.0.0 with MSVC-like command-line
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- CUDA: not enabled
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_Fortran: -Qiopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- Looking for Intel 32-bit BLAS
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/co
mpiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/m
kl/latest/lib/intel64/mkl_core_dll.lib
-- Found Intel10_64lp 32-bit BLAS
-- OpenMP C libraries:       
-- OpenMP C include:         
-- OpenMP C flags:          -openmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/w
indows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel
/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Release
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS -openmp
-- C++ compiler:
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>nmake

Microsoft (R) Program Maintenance Utility, Version 14.34.31937.0
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

[ 25%] Building C object CMakeFiles/suitesparseconfig.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
[ 50%] Linking C shared library suitesparseconfig.dll
[ 50%] Built target suitesparseconfig
[ 75%] Building C object CMakeFiles/suitesparseconfig_static.dir/SuiteSparse_config.c.obj
SuiteSparse_config.c
[100%] Linking C static library suitesparseconfig_static.lib
[100%] Built target suitesparseconfig_static

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>dir
 Volume in drive C is Windows
 Volume Serial Number is 8EAD-1479

 Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build

01/04/2023  01:19 AM    <DIR>          .
01/04/2023  01:19 AM    <DIR>          ..
01/04/2023  01:19 AM            23,329 CMakeCache.txt
01/04/2023  01:19 AM    <DIR>          CMakeFiles
01/04/2023  01:19 AM             3,439 cmake_install.cmake
01/04/2023  01:19 AM             8,692 Makefile
01/04/2023  01:19 AM            10,752 suitesparseconfig.dll
01/04/2023  01:19 AM               381 suitesparseconfig.dll.manifest
01/04/2023  01:19 AM            16,364 suitesparseconfig_static.lib
               6 File(s)         62,957 bytes
               3 Dir(s)  193,337,499,648 bytes free

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>
DrTimothyAldenDavis commented 1 year ago

OK ... give dev2 a try. It should build all of SuiteSparse, with static libraries at least.

DrTimothyAldenDavis commented 1 year ago

The "import" library is just the shallow wrapper around the dynamic library. From wikipedia https://en.wikipedia.org/wiki/Dynamic-link_library :

Import libraries Like static libraries, import libraries for DLLs are noted by the .lib file extension. For example, kernel32.dll, the primary dynamic library for Windows's base functions such as file creation and memory management, is linked via kernel32.lib.

That's what I'm trying to do. So Windows really has two kinds of libraries: static ones (whatever.lib with no dll behind it), and what I have been calling dynamic ones (whatever.lib as an import library for whatever.dll). On Linux and Mac, the first is libwhatever.a, and is also a static library. Then the dynamic library is libwhatever.so on Linux (.dylib on Mac), and it's analogous to the Windows import library (the small .lib file that has the .dll to go with it).

With "add_library" in SuiteSparse_config/CMakeLists.txt, I'm asking to build both SHARED and STATIC. I'm not sure why the SHARED option on Windows MSVC creates the dll but no import whatever.lib for it. It doesn't make sense to build a bare *.dll file that can't be linked against.

Now that I have the right terminology (Windows "import" library is basically the Linux libwhatever.so, but as 2 files not 1, and the Windows "static" library is whatever.lib with no reference to a dll file), perhaps I can figure out how to get cmake to build both of them on Windows in MSVC.

Fabian188 commented 1 year ago

It works for CHOLMOD, and seems fine for UMFPACK (still building). For the other packages I do not know the proper order yet.

I need to stop for today - I can check for Visual Studio Build tomorrow.

You could consider the root CMakeLists.txt from my fork which automates these steps. I cannot use the root Makefile as this does not work on Windows but need to do all steps by hand. My central CMakeLists.txt does similar things as your Makefiles - it calls cmake in the build directories of all modules.

DrTimothyAldenDavis commented 1 year ago

A single top-level CMakeLists.txt would be nice, as long as it doesn't break each Package/CMakeLists.txt.

realbabilu commented 1 year ago

Here is the shared result https://pastebin.com/F2NtPwVJ and the static result https://pastebin.com/Ej7PgiiB (sorry wrong batch file name) All works creating exe lib dll demo works in cmake automatically Let me try linking manually the fortran with the wrapper via dll and lib updating... for linking manually

The Static linking must use /MD and not need .dll files this need MD use the multithread-specific and DLL-specific version of the run-time library because MT 'LIBCMT' that to use the multithread, static version of the run-time library, conflicts with use of other libs

D:\intel-run\SuiteSparse-dev2b>StaticFortran.bat

D:\intel-run\SuiteSparse-dev2b>mkdir STATICDEMO

D:\intel-run\SuiteSparse-dev2b>echo "all static dll lib copied in lib\static"
"all static dll lib copied in lib\static"

D:\intel-run\SuiteSparse-dev2b>echo "all shared dll lib copied in lib\shared"
"all shared dll lib copied in lib\shared"

D:\intel-run\SuiteSparse-dev2b>copy AMD\Include\*.h include
AMD\Include\amd.h
AMD\Include\amd_internal.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CAMD\Include\*.h  include
CAMD\Include\camd.h
CAMD\Include\camd_internal.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy COLAMD\Include\*.h include
COLAMD\Include\colamd.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CCOLAMD\Include\*.h  include
CCOLAMD\Include\ccolamd.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CHOLMOD\Include\*.h  include
CHOLMOD\Include\cholmod.h
CHOLMOD\Include\cholmod_internal.h
CHOLMOD\Include\cholmod_template.h
        3 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\Include\*.h  include
UMFPACK\Include\umfpack.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\*.h                STATICDEMO
UMFPACK\DEMO\umf4_f77wrapper_methods.h
UMFPACK\DEMO\umf4_f77zwrapper_methods.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\*.f                STATICDEMO
UMFPACK\DEMO\readhb.f
UMFPACK\DEMO\readhb_nozeros.f
UMFPACK\DEMO\readhb_size.f
UMFPACK\DEMO\umf4hb.f
UMFPACK\DEMO\umf4hb64.f
UMFPACK\DEMO\umf4zhb.f
UMFPACK\DEMO\umf4zhb64.f
        7 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\umf4_f77wrapper.c  STATICDEMO
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>cd STATICDEMO

D:\intel-run\SuiteSparse-dev2b\STATICDEMO>icl umf4_f77wrapper.c /c /I../include
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

icl: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '/Qdiag-disable:10441' to disable this message.
umf4_f77wrapper.c

D:\intel-run\SuiteSparse-dev2b\STATICDEMO>ifort umf4hb.f umf4_f77wrapper.obj  /I../include /Qmkl ..\lib\static\umfpack_static.lib  ..\lib\static\cholmod_static.lib  ..\lib\static\amd_static.lib ..\lib\static\camd_static.lib ..\lib\static\colamd_static.lib ..\lib\static\ccolamd_static.lib ..\lib\static\suitesparseconfig_static.lib /MD /traceback /check:bounds

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.33.31630.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:umf4hb.exe
-subsystem:console
-incremental:no
"-libpath:C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\intel64"
umf4hb.obj
umf4_f77wrapper.obj
..\lib\static\umfpack_static.lib
..\lib\static\cholmod_static.lib
..\lib\static\amd_static.lib
..\lib\static\camd_static.lib
..\lib\static\colamd_static.lib
..\lib\static\ccolamd_static.lib
..\lib\static\suitesparseconfig_static.lib
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

D:\intel-run\SuiteSparse-dev2b\STATICDEMO>copy ..\UMFPACK\DEMO\HB\*.rua
..\UMFPACK\DEMO\HB\arc130.rua
..\UMFPACK\DEMO\HB\fs_183_6.rua
..\UMFPACK\DEMO\HB\west0067.rua
        3 file(s) copied.

D:\intel-run\SuiteSparse-dev2b\STATICDEMO>umf4hb  0<arc130.rua
 Matrix key: ARC130
UMFPACK V6.0.3 (Jan 1, 2023), Control:
    Matrix entry defined as: double
    Int (generic integer) defined as: int32_t

    0: print level: 2
    1: dense row parameter:    0.2
        "dense" rows have    > max (16, (0.2)*16*sqrt(n_col) entries)
    2: dense column parameter: 0.2
        "dense" columns have > max (16, (0.2)*16*sqrt(n_row) entries)
    3: pivot tolerance: 0.1
    4: block size for dense matrix kernels: 32
    5: strategy: 0 (auto)
        Use symmetric strategy if symmetry > tsym and fraction of
        entries on diagonal >= tnnzdiag. Otherwise use unsymmetric
        strategy.
    9: tsym: 0.3
    12: tnnzdiag: 0.9
    10: ordering: 1 AMD/COLAMD
    11: singleton filter: enabled
    6: initial allocation ratio: 0.7
    7: max iterative refinement steps: 2
    13: Q fixed during numerical factorization: 0 (auto)
    14: AMD dense row/col parameter:    10
       "dense" rows/columns have > max (16, (10)*sqrt(n)) entries
        Only used if the AMD ordering is used.
    15: diagonal pivot tolerance: 0.001
        Only used if diagonal pivoting is attempted.
    16: scaling: 1 (divide each row by sum of abs. values in each row)
    17: frontal matrix allocation ratio: 0.5
    18: drop tolerance: 0
    19: AMD and COLAMD aggressive absorption: 1 (yes)

    The following options can only be changed at compile-time:
    8: BLAS library used:  Intel MKL 64lp BLAS (32-bit integers).  size of BLAS integer: 4
    compiled for ANSI C
    POSIX C clock_getttime.
    compiled with CHOLMOD ordering options
    computer/operating system: Microsoft Windows
    size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 8 (in bytes)

symbolic analysis:
   status:     0.
   time:      0.20E-03 (sec)
   estimates (upper bound) for numeric LU:
   size of LU:          0.10 (MB)
   memory needed:       0.21 (MB)
   flop count:      0.94E+05
   nnz (L):            1009.
   nnz (U):            7849.
numeric factorization:
   status:     0.
   time:      0.51E-02
   actual numeric LU statistics:
   size of LU:          0.01 (MB)
   memory needed:       0.07 (MB)
   flop count:      0.42E+04
   nnz (L):             417.
   nnz (U):             787.
forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source
umf4hb.exe         00007FF6E5B1EB97  Unknown               Unknown  Unknown
umf4hb.exe         00007FF6E5B17CB2  Unknown               Unknown  Unknown
umf4hb.exe         00007FF6E5B14219  Unknown               Unknown  Unknown
umf4hb.exe         00007FF6E5B12277  MAIN__                    167  umf4hb.f
umf4hb.exe         00007FF6E5B98CCE  Unknown               Unknown  Unknown
umf4hb.exe         00007FF6E5B99060  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFF6AD326BD  Unknown               Unknown  Unknown
ntdll.dll          00007FFF6B52DFB8  Unknown               Unknown  Unknown

D:\intel-run\SuiteSparse-dev2b\STATICDEMO>cd ..

if /MD not given the manual linking will be..

umfpack_static.lib(umfpack_di_load_numeric.c.obj) : error LNK2019: unresolved external symbol __imp_fread referenced in function umfpack_di_load_numeric
umfpack_static.lib(umfpack_di_load_symbolic.c.obj) : error LNK2001: unresolved external symbol __imp_fread
umfpack_static.lib(umfpack_di_load_numeric.c.obj) : error LNK2019: unresolved external symbol __imp_ferror referenced in function umfpack_di_load_numeric
umfpack_static.lib(umfpack_di_load_symbolic.c.obj) : error LNK2001: unresolved external symbol __imp_ferror
umf4hb.exe : fatal error LNK1120: 2 unresolved externals

And the Shared linking wuth smaller lib and calls the DLL

D:\intel-run\SuiteSparse-dev2b>SharedFortran.bat

D:\intel-run\SuiteSparse-dev2b>mkdir SHAREDDEMO

D:\intel-run\SuiteSparse-dev2b>echo "all static dll lib copied in lib\static"
"all static dll lib copied in lib\static"

D:\intel-run\SuiteSparse-dev2b>echo "all shared dll lib copied in lib\shared"
"all shared dll lib copied in lib\shared"

D:\intel-run\SuiteSparse-dev2b>copy AMD\Include\*.h include
AMD\Include\amd.h
AMD\Include\amd_internal.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CAMD\Include\*.h  include
CAMD\Include\camd.h
CAMD\Include\camd_internal.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy COLAMD\Include\*.h include
COLAMD\Include\colamd.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CCOLAMD\Include\*.h  include
CCOLAMD\Include\ccolamd.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy CHOLMOD\Include\*.h  include
CHOLMOD\Include\cholmod.h
CHOLMOD\Include\cholmod_internal.h
CHOLMOD\Include\cholmod_template.h
        3 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\Include\*.h  include
UMFPACK\Include\umfpack.h
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\*.h                SHAREDDEMO
UMFPACK\DEMO\umf4_f77wrapper_methods.h
UMFPACK\DEMO\umf4_f77zwrapper_methods.h
        2 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\*.f                SHAREDDEMO
UMFPACK\DEMO\readhb.f
UMFPACK\DEMO\readhb_nozeros.f
UMFPACK\DEMO\readhb_size.f
UMFPACK\DEMO\umf4hb.f
UMFPACK\DEMO\umf4hb64.f
UMFPACK\DEMO\umf4zhb.f
UMFPACK\DEMO\umf4zhb64.f
        7 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>copy UMFPACK\DEMO\umf4_f77wrapper.c  SHAREDDEMO
        1 file(s) copied.

D:\intel-run\SuiteSparse-dev2b>cd SHAREDDEMO

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>icl umf4_f77wrapper.c /c /I../include
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

icl: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '/Qdiag-disable:10441' to disable this message.
umf4_f77wrapper.c

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>ifort umf4hb.f umf4_f77wrapper.obj  /I../include /Qmkl ..\lib\shared\umfpack.lib /traceback /check:bounds
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.33.31630.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:umf4hb.exe
-subsystem:console
-incremental:no
"-libpath:C:\Program Files (x86)\Intel\oneAPI\mkl\latest\lib\intel64"
umf4hb.obj
umf4_f77wrapper.obj
..\lib\shared\umfpack.lib

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>copy ..\lib\shared\*.dll
..\lib\shared\amd.dll
..\lib\shared\btf.dll
..\lib\shared\camd.dll
..\lib\shared\ccolamd.dll
..\lib\shared\cholmod.dll
..\lib\shared\colamd.dll
..\lib\shared\csparse.dll
..\lib\shared\cxsparse.dll
..\lib\shared\klu.dll
..\lib\shared\klu_cholmod.dll
..\lib\shared\ldl.dll
..\lib\shared\mongoose.dll
..\lib\shared\rbio.dll
..\lib\shared\suitesparseconfig.dll
..\lib\shared\umfpack.dll
       15 file(s) copied.

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>copy ..\UMFPACK\DEMO\HB\*.rua
..\UMFPACK\DEMO\HB\arc130.rua
..\UMFPACK\DEMO\HB\fs_183_6.rua
..\UMFPACK\DEMO\HB\west0067.rua
        3 file(s) copied.

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>umf4hb  0<arc130.rua
 Matrix key: ARC130
UMFPACK V6.0.3 (Jan 1, 2023), Control:
    Matrix entry defined as: double
    Int (generic integer) defined as: int32_t

    0: print level: 2
    1: dense row parameter:    0.2
        "dense" rows have    > max (16, (0.2)*16*sqrt(n_col) entries)
    2: dense column parameter: 0.2
        "dense" columns have > max (16, (0.2)*16*sqrt(n_row) entries)
    3: pivot tolerance: 0.1
    4: block size for dense matrix kernels: 32
    5: strategy: 0 (auto)
        Use symmetric strategy if symmetry > tsym and fraction of
        entries on diagonal >= tnnzdiag. Otherwise use unsymmetric
        strategy.
    9: tsym: 0.3
    12: tnnzdiag: 0.9
    10: ordering: 1 AMD/COLAMD
    11: singleton filter: enabled
    6: initial allocation ratio: 0.7
    7: max iterative refinement steps: 2
    13: Q fixed during numerical factorization: 0 (auto)
    14: AMD dense row/col parameter:    10
       "dense" rows/columns have > max (16, (10)*sqrt(n)) entries
        Only used if the AMD ordering is used.
    15: diagonal pivot tolerance: 0.001
        Only used if diagonal pivoting is attempted.
    16: scaling: 1 (divide each row by sum of abs. values in each row)
    17: frontal matrix allocation ratio: 0.5
    18: drop tolerance: 0
    19: AMD and COLAMD aggressive absorption: 1 (yes)

    The following options can only be changed at compile-time:
    8: BLAS library used:  Intel MKL 64lp BLAS (32-bit integers).  size of BLAS integer: 4
    compiled for ANSI C
    POSIX C clock_getttime.
    compiled with CHOLMOD ordering options
    computer/operating system: Microsoft Windows
    size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 8 (in bytes)

symbolic analysis:
   status:     0.
   time:      0.11E-03 (sec)
   estimates (upper bound) for numeric LU:
   size of LU:          0.10 (MB)
   memory needed:       0.21 (MB)
   flop count:      0.94E+05
   nnz (L):            1009.
   nnz (U):            7849.
numeric factorization:
   status:     0.
   time:      0.37E-02
   actual numeric LU statistics:
   size of LU:          0.01 (MB)
   memory needed:       0.07 (MB)
   flop count:      0.42E+04
   nnz (L):             417.
   nnz (U):             787.
forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source
umfpack.dll        00007FFF1B602DE7  Unknown               Unknown  Unknown
umfpack.dll        00007FFF1B6861F2  Unknown               Unknown  Unknown
umf4hb.exe         00007FF768424219  Unknown               Unknown  Unknown
umf4hb.exe         00007FF768422277  MAIN__                    167  umf4hb.f
umf4hb.exe         00007FF768497CFE  Unknown               Unknown  Unknown
umf4hb.exe         00007FF7684980D0  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFF6AD326BD  Unknown               Unknown  Unknown
ntdll.dll          00007FFF6B52DFB8  Unknown               Unknown  Unknown

D:\intel-run\SuiteSparse-dev2b\SHAREDDEMO>
Fabian188 commented 1 year ago

I tried msbuild for Visual Studio build files which is what I get with just

fabia@LAPTOP-S9QEL64M C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build>cmake ..
-- Building SuiteSparse_config version: v7.0.0 (Jan 1, 2023)
-- Source:        C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config 
-- Build:         C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
-- Install rpath:  
-- Build   rpath: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build 
-- Build type:    Release
-- Fortran: C:/Program Files (x86)/Intel/oneAPI/compiler/2023.0.0/windows/bin/intel64/ifort.exe
-- CUDA: not enabled
-- Looking for Intel 32-bit BLAS
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/co
mpiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/m
kl/latest/lib/intel64/mkl_core_dll.lib
-- Found Intel10_64lp 32-bit BLAS
-- OpenMP C libraries:       
-- OpenMP C include:         
-- OpenMP C flags:          -openmp
-- BLAS libraries:      C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64_dll.lib;C:/Program Files (x86)/Intel/oneAPI/compiler/latest/w
indows/compiler/lib/intel64_win/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel
/oneAPI/mkl/latest/lib/intel64/mkl_core_dll.lib
-- BLAS linker flags:
-- BLAS include:
-- Installation will be system-wide (requires 'sudo make install')
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: suitesparseconfig
-- ------------------------------------------------------------------------
-- install in C:/Program Files (x86): true
-- install in SuiteSparse/lib and SuiteSparse/include: false
-- build type:           Release
-- NSTATIC:              false (build static library)
-- use OpenMP:           yes
-- C compiler:           C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- C flags:              /DWIN32 /D_WINDOWS -openmp
-- C++ compiler:
-- C++ flags:
-- C Flags release:      /O2 /Ob2 /DNDEBUG
-- C++ Flags release:
-- Fortran compiler:     C:/Program Files (x86)/Intel/oneAPI/compiler/2023.0.0/windows/bin/intel64/ifort.exe
-- compile definitions:  _CRT_SECURE_NO_WARNINGS;BLAS_Intel10_64lp
-- BLAS integer:         int32_t
-- ------------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/fabia/code/SuiteSparse-org/SuiteSparse_config/build

The generated structure is much different.

Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build

01/04/2023  12:02 PM    <DIR>          .
01/04/2023  12:02 PM    <DIR>          ..
01/04/2023  11:52 AM            27,004 ALL_BUILD.vcxproj
01/04/2023  11:52 AM               309 ALL_BUILD.vcxproj.filters
01/04/2023  11:51 AM            23,177 CMakeCache.txt
01/04/2023  12:02 PM    <DIR>          CMakeFiles
01/04/2023  11:52 AM             6,238 cmake_install.cmake
01/04/2023  12:02 PM    <DIR>          Debug
01/04/2023  11:52 AM            10,314 INSTALL.vcxproj
01/04/2023  11:52 AM               551 INSTALL.vcxproj.filters
01/04/2023  11:51 AM    <DIR>          suitesparseconfig.dir
01/04/2023  11:52 AM             5,212 suitesparseconfig.sln
01/04/2023  11:51 AM            42,290 suitesparseconfig.vcxproj
01/04/2023  11:51 AM               633 suitesparseconfig.vcxproj.filters
01/04/2023  12:02 PM    <DIR>          suitesparseconfig_static.dir
01/04/2023  11:52 AM            34,133 suitesparseconfig_static.vcxproj
01/04/2023  11:52 AM               633 suitesparseconfig_static.vcxproj.filters
01/04/2023  12:02 PM    <DIR>          x64
01/04/2023  11:51 AM            26,377 ZERO_CHECK.vcxproj
01/04/2023  11:51 AM               552 ZERO_CHECK.vcxproj.filters
              13 File(s)        177,423 bytes

And while suitesparse thinks, it's Release, a Debug is created with the following content (note the file size)

Directory of C:\Users\fabia\code\SuiteSparse-org\SuiteSparse_config\build\Debug

01/04/2023  12:02 PM    <DIR>          .
01/04/2023  12:02 PM    <DIR>          ..
01/04/2023  12:02 PM            60,928 suitesparseconfig.dll
01/04/2023  12:02 PM             6,510 suitesparseconfig.exp
01/04/2023  12:02 PM            11,444 suitesparseconfig.lib
01/04/2023  12:02 PM           872,448 suitesparseconfig.pdb
01/04/2023  12:02 PM            35,144 suitesparseconfig_static.lib
01/04/2023  12:02 PM            86,016 suitesparseconfig_static.pdb

It helps to add another hint with build and add Release and Debug to the possible Suffixes

find_library ( SUITESPARSE_CONFIG_LIBRARY
    NAMES suitesparseconfig suitesparseconfig_static
    HINTS ${SUITESPARSE_CONFIG_ROOT}
    HINTS ENV SUITESPARSE_CONFIG_ROOT
    HINTS ${CMAKE_SOURCE_DIR}/..
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config
    HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build
    PATH_SUFFIXES lib build Debug Release
)
mmuetzel commented 1 year ago

The "Debug/Release" selection for Visual Studio generators is when building (as opposed to when configuring) apparently. Try to add --config Release to your build command. See also: https://github.com/DrTimothyAldenDavis/SuiteSparse/pull/260/files#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1R439

Fabian188 commented 1 year ago

@mmuetzel Thanks, I was not aware of cmake --build.

It works also on cmd with cmake --build . --config Release

DrTimothyAldenDavis commented 1 year ago

This issue should be fixed with v7.0.0.beta1 as well. Can you give it a try to make sure it works for you?