Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows Complie Issue
#5
(11-17-2022, 09:50 PM)Admin Wrote: Thanks, what did you use to generate the files in Step 4? If the source code changes, how does one update all the steps? In other words, what steps stay the same and what has to change with the source code?

It was generated copy from VS build log. then converted to use gcc. So we can experimenting faster.
Yes it is only support 14.01 only. Any changes like from 13 not worked because the several files is different folder now than older mystran source.
Minus: Any new files need to be added manually. 

For all update mystran later...
UPDATE: For using CMAKE using GCC equation.com

---------------------------------------------------------------

1. Download GCC from equation.com - x64  Fortran, Fortran, C, C++ for Windows (equation.com) 
    http://www.equation.com/ftpdir/gcc/gcc-12.2.0-64.exe
    install at c:\gcc 

2. Download CMAKE latest binary windows - x64 Download | CMake  zipped file 
    https://github.com/Kitware/CMake/release...x86_64.zip    
    - Extract bin cmake.exe etc. at c:\gcc\bin
    - Extract share folder at c:\gcc\share
    - Extract man folder at C:\gcc\share\man
3. Create vars.bat in gcc folder that contain
Code:
path=C:\gcc\bin;%path%
  4. Extract mystran in any folder.
  5. Extract superlu in superlu mystran sub folder
  6. Go to command cmd.exe and run vars.bat
  Go to top root mystran folder that contain Cmakelist.txt and Build.md
  run in command file

  7A. If using CBLAS Superlu and LAPACK in Mystran
Code:
cmake -G"MinGW Makefiles"  -D"CMAKE_MAKE_PROGRAM=make.exe" -D"CMAKE_FORTRAN_COMPILER=gfortran.exe" -D"CMAKE_C_COMPILER=gcc.exe" -D"CMAKE_CXX_COMPILER=g++.exe"
make -j16 (or how many threads you have)
   
   7B. If Using OpenBlas binary https://github.com/xianyi/OpenBLAS/relea...21-x64.zip
   8B. Extract Openblas in c:\gcc\openblas ; all files not in different folder, make it same folder libopenblas.dll and its .h files also others in the same folder
   9B. the Cmake files  OpenBLASConfig.cmake and OpenBLASConfigVersion.cmake in the zipped Openblas putted in same folder c:\gcc\openblas
    and  folder cmake share like c:\gcc\share\cmake in the C:\gcc\share\cmake-3.25\Modules
   10B. Get modified BLAS Cmake Cmakelists.txt  that reside in mystran folder or mystran-main folder Cmakelists.txt - Pastebin.com
     this modified Cmakelists.txt also compatible be used for Intel Fortran etc. The original cmake list grab internal Lapack files so it need to be replaced if you re going to use pre built BLAS VENDOR like ATLAS, OpenBLAS. etc  

   11B. Go to top root mystran folder that contain Cmakelist.txt and Build.md and run in command file

Code:
cmake -G "MinGW Makefiles" -D"CMAKE_MAKE_PROGRAM:PATH=c:\gcc\bin\make.exe" -D"CMAKE_Fortran_COMPILER:PATH=c:\gcc\bin\gfortran.exe"  -D"TPL_BLAS_LIBRARIES:PATH=c:\gcc\openblas\libopenblas.DLL.a"  -D"BLAS_LIBRARIES:PATH=c:\gcc\openblas\libopenblas.DLL.a" -D"XSDK_ENABLE_Fortran=TRUE" -D"CMAKE_BUILD_TYPE=RELEASE" -DBLA_VENDOR=OpenBLAS -DUSE_XSDK_DEFAULTS=TRUE -DBUILD_SHARED_LIBS=FALSE

make -j16 (or whatever many threads you have)

----- FOR INTEL FORTRAN COMPILER / ONE API using CMAKE

  C For Command Line using CMAKE using Intel Fortran and existing BLAS 
    1. Extract mystran and superlu. superlu must reside in superlu folder
    2. Please edit  GET_MYSTRAN_DIR.F90
     
Code:
      !      GETENV not compatible 
      !      INTRINSIC                                    :: GETENV

      CALL GET_ENVironment_variable ( 'MYSTRAN_directory', MYSTRAN_DIR )
     
 
      3. Goto \SuperLU\TESTING folder, Delete all files and MATGEN folder also
       Put empty text file CMAKELISTS.TXT, this testing is just for testing and not used.
      4. Goto \SRC and \CBLAS
         Edit SLU_Cnames.h to call c obj as UPPERCASE call, not lowercase_ as default in C [ONLY FOR INTEL FORTRAN]
       
Code:
/* Fortran interface */
#define c_bridge_dgssv_ C_BRIDGE_DGSSV
#define c_fortran_sgssv_ C_FORTRAN_SGSSV
#define c_fortran_dgssv_ C_FORTRAN_DGSSV
#define c_fortran_cgssv_ C_FORTRAN_CGSSV
#define c_fortran_zgssv_ C_FORTRAN_ZGSSV

       
       5. Get modified CMakelists.txt in the root of mystran folder  Cmakelists.txt - Pastebin.com
       6. Download jom, put it in mystran folder, or any path folder, for faster compiling than nmake
       7A. Using Intel64 environment command line cmd.exe . O C:\Program Files (x86)\Intel\oneAPI\setvars,bat
         
Code:
cmake  -D"CMAKE_FORTRAN_COMPILER=ifort.exe" -D"CMAKE_C_COMPILER=icl.exe" -D"CMAKE_CXX_COMPILER=icl.exe" -G"NMake Makefiles JOM" -DUSE_XSDK_DEFAULTS=FALSE
jom /j16 (or whatever threads you have)
         
      
       7B. If using nmake or building
       
Code:
 
cmake  -D"CMAKE_FORTRAN_COMPILER=ifort.exe" -D"CMAKE_C_COMPILER=icl.exe" -D"CMAKE_CXX_COMPILER=icl.exe" -G"NMake Makefiles" -DUSE_XSDK_DEFAULTS=FALSE
nmake


       7C. For using Visual Studio Interface
       

Code:
cmake  -D"CMAKE_FORTRAN_COMPILER=ifort.exe" -D"CMAKE_C_COMPILER=icl.exe" -D"CMAKE_CXX_COMPILER=icl.exe" -G"Visual Studio 17 2022"
mystran.sln
         

    7D For Command Line using CMAKE using Intel Fortran and Intel MKL,  
   

Code:
cmake  -D"CMAKE_FORTRAN_COMPILER=ifort.exe" -D"CMAKE_C_COMPILER=icx.exe" -D"CMAKE_CXX_COMPILER=icx.exe" -G"NMake Makefiles JOM"  -Denable_internal_blaslib=FALSE -DBLA_VENDOR=Intel10_64lp -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE -DXSDK_ENABLE_Fortran=TRUE -DUSE_XSDK_DEFAULTS=TRUE
jom /j16   
   

   7E. For Command Line using CMAKE using Intel Fortran and OpenBLAS

   
Code:
cmake  -D"CMAKE_FORTRAN_COMPILER=ifort.exe" -D"CMAKE_C_COMPILER=icl.exe" -D"CMAKE_CXX_COMPILER=icl.exe" -G"NMake Makefiles JOM"  -Denable_internal_blaslib=FALSE -DBLA_VENDOR=Openblas -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE -DXSDK_ENABLE_Fortran=TRUE -D"TPL_BLAS_LIBRARIES=c:\gcc\openblas\libopenblas.dll.a" -D"BLAS_LIBRARIES=c:\gcc\openblas\libopenblas.dll.a" -USE_XSDK_DEFAULTS=TRUE
jom /j16
    
Sidenote:
a. use     -G"Nmake Makefiles"  for nmake OR      -G"Nmake Makefiles JOM" for jom OR    -G"Visual Studio 17 2022" for using Visual Studio Interface
b. f2c may be needed for MinGW, sometimes MSYS not compatible with it
c. In Release setup of Intel Fortran compile from CMAKE, the /DNDEBUG made NDEBUG variable became 1, and there is error, so it need to be removed from CMAKE.
d. The Ninja way not compatible with MinGW, and has some problems linking using Intel Compiler
 
 


 
Reply


Messages In This Thread
Windows Complie Issue - by Admin - 10-18-2022, 08:41 PM
RE: Windows Complie Issue - by Admin - 10-18-2022, 09:03 PM
RE: Windows Complie Issue - by realbabilu - 11-17-2022, 05:08 PM
RE: Windows Complie Issue - by Admin - 11-17-2022, 09:50 PM
RE: Windows Complie Issue - by realbabilu - 11-18-2022, 10:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)