-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake built error in static win msvc intel due linking static.lib : wrongname and cant linking mkl when create #895
Comments
Thank you for your report. Which version of CMake do you use? |
MSVC-like compilers use the same default suffix for static libraries and import libraries. Instead of checking whether a compiler is MSVC or simulates it, directly check whether these default suffices clash. That potentially fixes issue DrTimothyAldenDavis#895. (And even in case it does not, the updated condition is much more to the point.
See #896 for a potential fix. @realbabilu: Does that change avoid the issue for you? |
C:\Program Files (x86)\Intel\oneAPI>cmake --version CMake suite maintained and supported by Kitware (kitware.com/cmake). |
no. one way around is edit manually the build.make inside cmakefiles cmake -G "NMake Makefiles" -DBLA_VENDOR=Intel10_64lp -DCMAKE_BUILD_TYPE=RELEASE -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd;umfpack" -DCHOLMOD_PARTITION=OFF -DBUILD_STATIC_LIBS=ON -DSUITESPARSE_USE_FORTRAN=on .. -DCMAKE_CXX_COMPILER=icx.exe -DCMAKE_C_SIMULATE_ID=MSVC nmake ... |
@realbabilu: Thank you for providing that information. I'm not entirely sure what the error Could you please check if you still see this error with a different CMake generator? E.g., could you please test the following:
|
woah no problem here. eventhough i just only changed cmakelist.txt of sparsesuite.config,amd,camd,colamd,ccolamd,cholmod,umfpack. ninja rocks C:\fortran\SuiteSparse\build>ninja C:\fortran\SuiteSparse\build>dir |
Thank you for reporting back. Yeah, I prefer Ninja over any of the other generators. Especially on Windows. If it's working with Ninja but not with NMake, I'd be inclined to say that it is an issue with the NMake generator of CMake or with NMake itself. Either way, it's probably not an issue in the build rules of SuiteSparse. In any case, it is good to know that NMake might be having this issue. 👍 |
@realbabilu: I forgot to ask: Did you run your test using the Ninja generator with the original CMakeLists.txt files? Or with the ones including the changes from #896? |
Yesterday was ok with new Cmakefiles.txt How to get compile demo in umfpack with cmake? |
just asking. why the resulting static_lib is cant direct linked, it need /MD slash in compile which means /MD[d] = use dynamically-loaded, multithread C runtime, but no dll is required to run. without /MD
so second, can umfpack can eat directly rectangular B matrix or right hand side matrix, instead per column. |
|
cmake --fresh -GNinja -DBLA_VENDOR=Intel10_64lp -DCMAKE_BUILD_TYPE=RELEASE -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd;umfpack" -DCHOLMOD_PARTITION=OFF -DBUILD_STATIC_LIBS=ON -DSUITESPARSE_USE_FORTRAN=on .. -DCMAKE_CXX_COMPILER=icx.exe -DSUITESPARSE_HAS_FORTRAN=on -DSUITESPARSE_HAS_FORTRAN=on -DSUITESPARSE_DEMOS=on -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded |
Describe the bug
Microsoft (R) Program Maintenance Utility Version 14.42.34436.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 0%] Built target SuiteSparseConfig
[ 1%] Built target SuiteSparseConfig_static
NMAKE : fatal error U1073: don't know how to make 'SuiteSparse_config\suitesparseconfig.lib'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -s -f AMD\CMakeFiles\AMD.dir\build.make /nologo -SL AMD\CMakeFiles\AMD.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S all' : return code '0x2'
Stop.
;
it should be 'SuiteSparse_config\suitesparseconfig.lib' SuiteSparse_config\suitesparseconfig._static.lib'
To Reproduce
Steps to reproduce the behavior.
cmake -G "NMake Makefiles" -DBLA_VENDOR=Intel10_64lp -DCMAKE_BUILD_TYPE=RELEASE -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd;umfpack" -DCHOLMOD_PARTITION=OFF -DBUILD_STATIC_LIBS=ON -DSUITESPARSE_USE_FORTRAN=on .. -DCMAKE_CXX_COMPILER=icx.exe
Expected behavior
A clear and concise description of what you expected to happen.
in build.make in AMD.dir should be
AMD\amd.dll: SuiteSparse_config\suitesparseconfig_static.lib
\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\AMD.dir --rc=C:\PROGRA
2\WI3CF21\10\bin\1002261.0\x64\rc.exe --mt=C:\PROGRA2\WI3CF21\10\bin\1002261.0\x64\mt.exe --manifests -- C:\PROGRA1\MIB0551\2022\PROFES1\VC\Tools\MSVC\14421.344\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\AMD.dir\objects1.rsp @<</out:amd.dll /implib:amd.lib /pdb:C:\fortran\SuiteSparse\Build\AMD\amd.pdb /dll /version:3.3 /machine:x64 /INCREMENTAL:NO /Qoption,link,/DEF:CMakeFiles\AMD.dir\exports.def ..\SuiteSparse_config\suitesparseconfig_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
not suitesparseconfig.lib
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
colamd,ccolamd,camd also affected.
just edit manually in each build.make for temporary solution. cmake bug?
in cholmod should be
CHOLMOD\cholmod.dll: AMD\amd_static.lib
CHOLMOD\cholmod.dll: COLAMD\colamd_static.lib
CHOLMOD\cholmod.dll: CAMD\camd_static.lib
CHOLMOD\cholmod.dll: CCOLAMD\ccolamd_static.lib
then in cholmod_di_demo
cholmod_static.lib
CHOLMOD\cholmod.dll: AMD\amd_static.lib
CHOLMOD\cholmod.dll: COLAMD\colamd_static.lib
CHOLMOD\cholmod.dll: CAMD\camd_static.lib
CHOLMOD\cholmod.dll: CCOLAMD\ccolamd_static.lib
---if fixed then,,, when linking
Microsoft (R) Program Maintenance Utility Version 14.42.34436.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 1%] Built target SuiteSparseConfig
[ 1%] Built target SuiteSparseConfig_static
[ 2%] Built target AMD
[ 4%] Built target AMD_static
[ 6%] Built target CAMD
[ 8%] Built target CAMD_static
[ 8%] Built target CCOLAMD
[ 8%] Built target CCOLAMD_static
[ 9%] Built target COLAMD
[ 9%] Built target COLAMD_static
[ 24%] Built target CHOLMOD
[ 38%] Built target CHOLMOD_static
[ 38%] Linking C executable cholmod_di_demo.exe
LINK: command "C:\PROGRA
1\MIB0551\2022\PROFES1\VC\Tools\MSVC\14421.344\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cholmod_di_demo.dir\objects1.rsp /out:cholmod_di_demo.exe /implib:cholmod_di_demo.lib /pdb:C:\fortran\SuiteSparse\Build\CHOLMOD\cholmod_di_demo.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console cholmod_static.lib ..\AMD\amd_static.lib ..\COLAMD\colamd_static.lib ..\CAMD\camd_static.lib ..\CCOLAMD\ccolamd_static.lib ..\SuiteSparse_config\suitesparseconfig_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output:cholmod_static.lib(cholmod_super_numeric.c.obj) : error LNK2019: unresolved external symbol DTRSM referenced in function rd_cholmod_super_numeric_worker
looks like not see intel mkl ??
eventhough cmake config see..
-- Looking for 32-BLAS: Intel10_64lp
-- Found Intel10_64lp 32-bit BLAS
-- Specific BLAS: Intel10_64lp found: TRUE
-- BLAS integer size: 4
The text was updated successfully, but these errors were encountered: