Skip to content

Commit

Permalink
Merge pull request #15 from shoubhikraj/master
Browse files Browse the repository at this point in the history
Fixes for native compile of stda on Windows
  • Loading branch information
mdewergi authored May 19, 2022
2 parents 0ac37d5 + e8b693e commit 600702f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
14 changes: 10 additions & 4 deletions main.f
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ program acis_prog
character*8 method
integer imethod,inpchk,mform,nvec
logical molden,da,chkinp,xtbinp

call system('date')
integer, dimension(8) :: datetimevals

call date_and_time(VALUES=datetimevals)
print '(I0,"-",I0,"-",I0,1X,I0,":",I0,":",I0,".",I3)',
. datetimevals(1:3), datetimevals(5:8)

write(*,'(//
. 17x,''*********************************************'')')
write(*,'(17x,''* *'')')
Expand Down Expand Up @@ -512,8 +516,10 @@ program acis_prog
call sutda(ncent,nmo,nao,xyz,cc,eps,occ,ccspin,iaoat,thre,
. thrp,ax,alpha,beta,ptlim,nvec)
endif

call system('date')

call date_and_time(VALUES=datetimevals)
print '(I0,"-",I0,"-",I0,1X,I0,":",I0,":",I0,".",I3)',
. datetimevals(1:3), datetimevals(5:8)

end

Expand Down
35 changes: 29 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU Lesser General Public License
# along with xtb4stda. If not, see <https://www.gnu.org/licenses/>.

# modified to include options for Windows with Intel Fortran only (Shoubhik Maiti, April 2022)

project('stda', 'fortran',
version: '1.6.1',
license: 'LGPL3',
Expand All @@ -34,23 +36,40 @@ if fc.get_id() == 'gcc'
endif
elif fc.get_id() == 'intel'
add_project_arguments('-axAVX2', language: 'fortran')
add_project_arguments('-traceback', language: 'fortran')
if get_option('buildtype') == 'debug'
add_project_arguments('-traceback', language: 'fortran')
endif
if get_option('interface') == '64'
add_project_arguments('-i8', language: 'fortran')
endif
if get_option('static')
add_project_link_arguments('-static', language: 'fortran')
endif
elif fc.get_id() == 'intel-cl' # for Windows with Intel Fortran
add_project_arguments('-QaxCORE-AVX2', language: 'fortran')
if get_option('buildtype') == 'debug'
add_project_arguments('-traceback', language: 'fortran')
endif
if get_option('interface') == '64'
add_project_arguments('-integer-size:64', language: 'fortran')
endif
if get_option('static')
add_project_arguments('-MT', language: 'fortran') # linker does not need MT
endif
endif

dependencies = []

la_backend = get_option('la_backend')
if la_backend == 'mkl'
libmkl = [fc.find_library('pthread')]
libmkl += fc.find_library('m')
libmkl += fc.find_library('dl')
if fc.get_id() == 'intel'
if host_machine.system() == 'windows'
libmkl = [fc.find_library('libiomp5md')]
else
libmkl = [fc.find_library('pthread')]
libmkl += fc.find_library('m')
libmkl += fc.find_library('dl')
endif
if (fc.get_id() == 'intel') or (fc.get_id() == 'intel-cl')
if get_option('interface') == '64'
libmkl += fc.find_library('mkl_intel_ilp64')
else
Expand All @@ -66,7 +85,9 @@ if la_backend == 'mkl'
libmkl += fc.find_library('mkl_gnu_thread')
endif
libmkl += fc.find_library('mkl_core')
libmkl += fc.find_library('iomp5')
if host_machine.system() != 'windows'
libmkl += fc.find_library('iomp5')
endif
dependencies += libmkl
elif la_backend == 'openblas'
dependencies += fc.find_library('openblas', required : true)
Expand All @@ -84,6 +105,8 @@ if get_option('openmp')
if fc.get_id() == 'intel'
add_project_arguments('-qopenmp', language : 'fortran')
add_project_link_arguments('-qopenmp', language : 'fortran')
elif fc.get_id() == 'intel-cl'
add_project_arguments('-Qopenmp', language : 'fortran')
else
add_project_arguments('-fopenmp', language : 'fortran')
add_project_link_arguments('-fopenmp', language : 'fortran')
Expand Down

0 comments on commit 600702f

Please sign in to comment.