Advertisement
AnttiLehikoinen

Compiling SuiteSparse on Win64

Jun 8th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.95 KB | None | 0 0
  1. #How to compile suitesparse on Win64
  2. #(How I did it, at least)
  3.  
  4. #download msys2 from
  5. #http://www.msys2.org/
  6. #Remember to download the x86_64 version
  7. #Get stuff up to date as described on the website:
  8. pacman -Syu
  9. #probably need to close the program at this point, then restart and
  10. pacman -Syu
  11.  
  12. #install make
  13. pacman -S make
  14.  
  15. #install gcc toolchain, you can search available packages with
  16. pacman -Ss gcc
  17. #for me, the latest version was
  18. pacman -S mingw64/mingw-w64-x86_64-gcc
  19. #again, remember to get the 64bit version (NOT i686)
  20.  
  21. #see e.g. https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2 for more info
  22.  
  23. #install fortran toolchain
  24. #either by searching
  25. pacman -Ss fortran
  26. #or directly
  27. pacman -S mingw64/mingw-w64-x86_64-gcc-fortran
  28.  
  29. #download openblas 64 bit binaries, or alternatively compile from source by simply opening mingw64,
  30. #travelling to the source directory and typing make
  31. #http://www.openblas.net/
  32.  
  33. #download compiled binaries for LAPACK if you wanna use CHOLMOD, from
  34. #http://icl.cs.utk.edu/lapack-for-windows/lapack/index.html#libraries
  35. #for typical electrical-machine-size problems UMFPACK+AMD alone works just as well.
  36.  
  37. #download compiled binaries for metis if you wanna use it with CHOLMOD
  38. #http://www.opentelemac.org/index.php/component/jdownloads/summary/23-installation-files/158-metis-5-0-2-compiled-on-windows-with-mingw-s-gfortran-64bit?Itemid=54
  39.  
  40. ######################################################
  41. # configuring suitesparse makefile
  42.  
  43. #download suitesparse source
  44. #make the following modifications to SuiteSparse_config/SuiteSparse_config.mk:
  45.  
  46. #add -DNTIMER flag to the compiler flags (CF) (otherwise compiler throws an error about clock_monotonic)
  47. #you might need to add -mwindows to the flags too, I'm not sure.
  48.  
  49. #add -shared to LDLIBS
  50. #add also -Wl,--out-implib,$(LIBRARY).a if you want .a files that gcc can link (if used with Matlab)
  51.  
  52. #specify BLAS and LAPACK paths in the end of the # required libraries section, e.g.
  53.     BLAS= -Lc:/Antti/Software/OB/lib -lopenblas -lpthread -lgfortran
  54.     LAPACK= -Lc:/Antti/Software/LAPACK/ -llapack
  55. #you might need to use quotation marks if your path contains whitespaces, I dunno
  56.  
  57. #under Shell commands section, specify compilers:
  58.     CC = gcc
  59.     F77 = gfortran
  60.    
  61. #if you don't wanna use CHOLMOD with UMFPACK, under section UMFPACK Configuration set
  62. UMFPACK_CONFIG = -DNCHOLMOD
  63.  
  64. #if you don't wanna use metis with CHOLMOD, under CHOLMOD Configuration append the flag
  65. -DNPARTITION
  66. #to CHOLMOD_CONFIG
  67.  
  68. ##################################
  69. # now the compiling:
  70.  
  71. #if you only need UMFPACK, the following suffices.
  72. #Open MinGW and travel to the suitesparse main directory
  73. cd SuiteSparse_config
  74. make
  75. cd ..
  76. cd AMD
  77. make library #demos don't works
  78. cd ..
  79. cd UMFPACK
  80. make library
  81.  
  82. #if you need entire suitesparse (you'll need LAPACK for this, plus either download metis, or disable it with -DNPARTITION), simply type
  83. make library
  84. #in the main suitesparse directory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement