10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2025-01-07 03:43:03 +01:00

Merge branch 'master' of github.com:scemama/irpf90

This commit is contained in:
Anthony Scemama 2017-07-11 23:58:19 +02:00
commit 3eef718b68
8 changed files with 93 additions and 82 deletions

View File

@ -1,7 +1,21 @@
PYTHON=python PYTHON=python
PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])")
HAS_CYTHON=$(shell bash -c "which cython &> /dev/null && echo 1 || echo 0")
ifneq ($(HAS_CYTHON),0)
../bin/irpf90: irpf90.so
rm ../bin/irpf90 ; cd ../bin ; ln -s ../src/irpf90_python.exe irpf90
irpf90.so : $(wildcard *.py) irpf90.c
./cython_setup.py build_ext --inplace
irpf90.c: irpf90.py
cython --embed irpf90.py
else
../bin/irpf90: irpf90_python.exe ../bin/irpf90: irpf90_python.exe
rm ../bin/irpf90 ; cd ../bin ; ln -s ../src/irpf90_python.exe irpf90 rm ../bin/irpf90 ; cd ../bin ; ln -s ../src/irpf90_python.exe irpf90
endif
clean: clean:
rm -f *.c *.so *.pyc *.pyo 2>/dev/null rm -f *.c *.so *.pyc *.pyo 2>/dev/null

View File

@ -215,12 +215,12 @@ def create_build_compile(t, l_module, l_ext_modfile=[], ninja=True):
list_of_includes = ' ' list_of_includes = ' '
l_build = [ l_build = [
"build {target_o}: compile_fortran_{irp_id} {target_F90} | {list_of_includes} {list_of_modules} {list_of_modules_irp}", "build {target_o}: compile_fortran_{irp_id} {target_F90} | ../Makefile {list_of_includes} {list_of_modules} {list_of_modules_irp}",
" short_in = {short_target_F90}", " short_out = {short_target}", "" " short_in = {short_target_F90}", " short_out = {short_target}", ""
] ]
l_build_make = [ l_build_make = [
"{target_o}: {target_F90} | {list_of_includes} {list_of_modules} {list_of_modules_irp}", "{target_o}: {target_F90} | ../Makefile {list_of_includes} {list_of_modules} {list_of_modules_irp}",
'\t@printf "F: {short_target_F90} -> {short_target}\\n"', "\t@$(FC) $(FCFLAGS) -c $^ -o $@", '\t@printf "F: {short_target_F90} -> {short_target}\\n"', "\t@$(FC) $(FCFLAGS) -c $^ -o $@",
"" ""
] ]

View File

@ -169,9 +169,6 @@ def main():
if not command_line.do_run: if not command_line.do_run:
return return
import irp_stack
irp_stack.create()
comm_world.create_buildfile(command_line.do_ninja) comm_world.create_buildfile(command_line.do_ninja)
comm_world.write_modules() comm_world.write_modules()

View File

@ -218,7 +218,7 @@ def move_to_top_list(text, it):
- The permutation neeed to be done following `it` order - The permutation neeed to be done following `it` order
- We can have `nested` subroutine / Function. (Because of interface) - We can have `nested` subroutine / Function. (Because of interface)
- This function is called way to much. Is need to be efficient - This function is called way to much. Is need to be efficient
- This function is Impure - This function is Unpure
- One pass over `text` - One pass over `text`
@ -284,7 +284,7 @@ def move_interface(parsed_text, s_type=(Use, Implicit, Declaration, Subroutine,
'''Move everything containt into 'interface' below the first instance of s_type who preced it '''Move everything containt into 'interface' below the first instance of s_type who preced it
Note: Note:
= This function is impure = This function is unpur
''' '''
# Get the born of the interface # Get the born of the interface
@ -311,7 +311,7 @@ def build_sub_needs(parsed_text, d_subroutine):
'''Set the needs, and provides arguements of Routine present in parsed_text '''Set the needs, and provides arguements of Routine present in parsed_text
Note: Note:
This function is impure This function is unpure
''' '''
l_buffer = [] l_buffer = []

View File

@ -418,7 +418,7 @@ def remove_comments(text, form):
'''Remove all comments '''Remove all comments
Note: Note:
This function is impure This function is unpur
''' '''
result = [] result = []