Skip to content

Commit

Permalink
Merge cbd85cb into f02f40a
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmorgan committed Jan 29, 2019
2 parents f02f40a + cbd85cb commit 2a7696b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ crystal_torture/devel
*.swp
*pyc
crystal_torture/.f2py_f2cmap
crystal_torture/_tort*
check_run.py
check_doping.py
*/*so
Expand Down
Binary file removed crystal_torture/tort_mod.mod
Binary file not shown.
32 changes: 16 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ def setup_tort_ext(args,parent_package='',top_path=''):
tort_src = [join('crystal_torture/','tort.f90')]

config.add_library('_tort', sources=tort_src,
extra_f90_compile_args = [ args["compile_args"]],
extra_link_args=[args["link_args"]])
extra_f90_compile_args = args["compile_args"],
extra_link_args=args["link_args"])

sources = [join('crystal_torture','f90wrap_tort.f90')]

config.add_extension(name='_tort',
sources=sources,
extra_f90_compile_args = [ args["compile_args"]],
extra_link_args=[args["link_args"]],
extra_f90_compile_args = args["compile_args"],
extra_link_args=args["link_args"],
libraries=['_tort'],
include_dirs=['build/temp.' + return_include_dir()])

dist_src = [join('crystal_torture/','dist.f90')]
config.add_extension(name='dist',
sources=dist_src,
extra_f90_compile_args = [ args["compile_args"]],
extra_link_args=[args["link_args"]])
extra_f90_compile_args = args["compile_args"],
extra_link_args=args["link_args"])


return config
Expand All @@ -58,24 +58,24 @@ def check_f2py_compiler():

if 'GNU' in str(result):
print('Found gnu compiler. Setting OpenMP flag to \'-fopenmp\'')
compile_args = '-fopenmp -lgomp -O3'
link_args = '-lgomp'
compile_args = ['-fopenmp', '-lgomp', '-O3']
link_args = ['-lgomp']
elif 'Intel' in str(result):
print('Found intel compiler. Setting OpenMP flag to \'-openmp\'')
compile_args = '-openmp -O3'
link_args = ''
compile_args = ['-openmp', '-O3']
link_args = []
elif 'Portland' in str(result):
print('Found portland compiler. Setting OpenMP flag to \'-mp\'')
compile_args = '-mp -O3'
link_args = ''
compile_args = ['-mp', '-O3']
link_args = []
elif 'NAG' in str(result):
print('Found NAG compiler. Setting OpenMP flag to \'-openmp\'')
compile_args = '-openmp -O3'
link_args = ''
compile_args = ['-openmp', '-O3']
link_args = []
else:
print('Not sure what compiler f2py uses. Speculatively setting OpenMP flag to \'-openmp\'')
compile_args = '-openmp -O3'
link_args = ''
compile_args = ['-openmp', '-O3']
link_args = []

args = {'link_args':link_args,'compile_args':compile_args}

Expand Down

0 comments on commit 2a7696b

Please sign in to comment.