Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
cython
Commits
9ea4207ed984
Commit
9ea4207ed984
authored
15 years ago
by
Kurt Smith
Browse files
Options
Downloads
Patches
Plain Diff
added fwrap.py commandline script
parent
255c970b8714
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tools/fwrap/Main.py
+18
-2
18 additions, 2 deletions
Tools/fwrap/Main.py
Tools/fwrap/fwrap.py
+4
-0
4 additions, 0 deletions
Tools/fwrap/fwrap.py
with
22 additions
and
2 deletions
Tools/fwrap/Main.py
+
18
−
2
View file @
9ea4207e
import
os
,
sys
import
os
,
sys
,
shutil
from
fparser
import
api
from
fparser
import
api
from
fparser
import
block_statements
from
fparser
import
block_statements
from
Visitor
import
PrintTree
,
KindResolutionVisitor
,
\
from
Visitor
import
PrintTree
,
KindResolutionVisitor
,
\
...
@@ -6,6 +6,18 @@
...
@@ -6,6 +6,18 @@
CHeaderGenerator
,
PxdGenerator
,
CyHeaderGenerator
,
\
CHeaderGenerator
,
PxdGenerator
,
CyHeaderGenerator
,
\
CyImplGenerator
CyImplGenerator
def
main
():
from
optparse
import
OptionParser
parser
=
OptionParser
()
parser
.
add_option
(
'
--outdir
'
,
dest
=
'
outdir
'
,
default
=
os
.
path
.
curdir
,
help
=
'
base of output directory
'
)
parser
.
add_option
(
'
--indir
'
,
dest
=
'
indir
'
,
default
=
os
.
path
.
curdir
,
help
=
'
directory of fortran source files
'
)
parser
.
add_option
(
'
--projname
'
,
dest
=
'
projectname
'
,
default
=
'
fwrap_default
'
,
help
=
'
name of fwrap project -- will be the name of the directory.
'
)
options
,
sources
=
parser
.
parse_args
()
wrap
(
sources
,
options
.
outdir
,
options
.
indir
,
options
.
projectname
)
def
setup_project
(
projectname
,
src_dir
,
outdir
):
def
setup_project
(
projectname
,
src_dir
,
outdir
):
fq_projdir
=
os
.
path
.
join
(
outdir
,
projectname
)
fq_projdir
=
os
.
path
.
join
(
outdir
,
projectname
)
if
os
.
path
.
isdir
(
fq_projdir
):
if
os
.
path
.
isdir
(
fq_projdir
):
...
@@ -17,7 +29,7 @@
...
@@ -17,7 +29,7 @@
def
wrap
(
filenames
,
directory
,
outdir
,
projectname
):
def
wrap
(
filenames
,
directory
,
outdir
,
projectname
):
projectname
=
projectname
.
lower
().
strip
()
projectname
=
projectname
.
strip
()
projdir
=
setup_project
(
projectname
,
directory
,
outdir
)
projdir
=
setup_project
(
projectname
,
directory
,
outdir
)
...
@@ -50,6 +62,10 @@
...
@@ -50,6 +62,10 @@
# write out the makefile
# write out the makefile
gen_makefile
(
projectname
,
filenames
,
directory
,
projdir
)
gen_makefile
(
projectname
,
filenames
,
directory
,
projdir
)
# copy the fortran source files to the project dir.
for
fname
in
filenames
:
shutil
.
copy
(
fname
,
projdir
)
def
gen_makefile
(
projname
,
src_files
,
src_dir
,
out_dir
):
def
gen_makefile
(
projname
,
src_files
,
src_dir
,
out_dir
):
import
sys
import
sys
PYTHON
=
'
/usr/bin/python2.6
'
PYTHON
=
'
/usr/bin/python2.6
'
...
...
This diff is collapsed.
Click to expand it.
Tools/fwrap/fwrap.py
0 → 100755
+
4
−
0
View file @
9ea4207e
#! /usr/bin/env python
from
Main
import
main
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment