Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
mpim-sw
libcdi
Commits
e8966bb3
Commit
e8966bb3
authored
10 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Add preprocessor wrapper for Cray Fortran compiler.
parent
9b0cb48f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
configure
+1
-0
1 addition, 0 deletions
configure
m4/starlink_fpp.m4
+1
-0
1 addition, 0 deletions
m4/starlink_fpp.m4
util/crayftnpreproc-wrapper
+108
-0
108 additions, 0 deletions
util/crayftnpreproc-wrapper
with
111 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
e8966bb3
...
...
@@ -373,6 +373,7 @@ tests/test_resource_copy.c -text
tests/test_resource_copy_mpi_run.in -text
tests/var_cksum.c -text
tests/var_cksum.h -text
util/crayftnpreproc-wrapper -text
util/mpi_launch_poe -text
util/serialrun.in -text
util/sunf95preproc-wrapper -text
...
...
This diff is collapsed.
Click to expand it.
configure
+
1
−
0
View file @
e8966bb3
...
...
@@ -15593,6 +15593,7 @@ fi
for ac_fpp in `cd $srcdir ; pwd`/util/sxpreproc-wrapper \
`cd $srcdir ; pwd`/util/xlfpreproc-wrapper \
`cd $srcdir ; pwd`/util/sunf95preproc-wrapper \
`cd $srcdir ; pwd`/util/crayftnpreproc-wrapper \
"$FC -F" "$FC -F -fpp" "$FC -E" "$FC -E" "$FC -E -cpp" \
"$FC $FCFLAGS -F" "$FC $FCFLAGS -E" "$FC $FCFLAGS -E" \
"$FC $FCFLAGS -E -cpp" "$FC $FCFLAGS -x f95-cpp-input -E -P" \
...
...
This diff is collapsed.
Click to expand it.
m4/starlink_fpp.m4
+
1
−
0
View file @
e8966bb3
...
...
@@ -313,6 +313,7 @@ AC_DEFUN([_ACX_SL_PROG_FPP],dnl
[for ac_fpp in `cd $srcdir ; pwd`/util/sxpreproc-wrapper \
`cd $srcdir ; pwd`/util/xlfpreproc-wrapper \
`cd $srcdir ; pwd`/util/sunf95preproc-wrapper \
`cd $srcdir ; pwd`/util/crayftnpreproc-wrapper \
"$FC -F" "$FC -F -fpp" "$FC -E" "$FC -E" "$FC -E -cpp" \
"$FC $FCFLAGS -F" "$FC $FCFLAGS -E" "$FC $FCFLAGS -E" \
"$FC $FCFLAGS -E -cpp" "$FC $FCFLAGS -x f95-cpp-input -E -P" \
...
...
This diff is collapsed.
Click to expand it.
util/crayftnpreproc-wrapper
0 → 100755
+
108
−
0
View file @
e8966bb3
#! /bin/bash
#
# crayftnpreproc-wrapper --- wrapper to produce Cray ftn style front-end
# preprocessor output on stdout
#
# Copyright (C) 2014 Nathanael Hübbe <nathanael.huebbe@informatik.uni-hamburg.de>
# Thomas Jahns <jahns@dkrz.de>
#
# Author: Nathanael Hübbe <nathanael.huebbe@informatik.uni-hamburg.de>
# Thomas Jahns <jahns@dkrz.de>
# Maintainer: Thomas Jahns <jahns@dkrz.de>
# URL: https://www.dkrz.de/redmine/projects/scales-ppm
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# Neither the name of the DKRZ GmbH nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Wrapper for the ftn command to write preprocessed fortran files to stdout.
#
set
-e
# create temp directory for intermediate .i-files
temporaries
=
"
$(
mktemp
-d
-t
)
"
trap
"rm -rf
$temporaries
"
EXIT
callDir
=
"
$PWD
"
declare
-a
inargs outargs preprocessedFiles
inargs
=(
"
$@
"
)
j
=
0
# filter -o option and argument from flags
for
((
i
=
0
;
i <
${#
inargs
[@]
}
;
i++
))
;
do
case
${
inargs
[
$i
]
}
in
(
-o
)
i
=
$((
i
+
1
))
;;
(
-o
*
)
;;
(
*
)
outargs[
$j
]=
"
${
inargs
[
$i
]
}
"
j
=
$((
j
+
1
))
;;
esac
done
# find non-option arguments at end of input and convert to absolute
# path if necessary
for
((
i
=
${#
outargs
[@]
}
- 1
;
i
>=
0
;
i--
))
;
do
[[
-r
"
${
outargs
[
$i
]
}
"
]]
||
break
case
"
${
outargs
[
$i
]
}
"
in
(
/
*
)
;;
(
*
)
outargs[
$i
]=
"
$callDir
/
${
outargs
[
$i
]
}
"
;;
esac
done
j
=
0
# use previous loop termination to build list of
# names of .i-files produced by compiler
for
((
i
=
i + 1
;
i <
${#
outargs
[@]
}
;
i++
))
;
do
preprocessedFiles[
$j
]=
"
${
outargs
[
$i
]%.*
}
.i"
preprocessedFiles[
$j
]=
"
${
preprocessedFiles
[
$j
]##*/
}
"
j
=
$((
j
+
1
))
done
# switch to temp directory to no pollute working directory
cd
"
$temporaries
"
# find compiler if not set
if
[
"
${
FC
+set
}
"
!=
set
]
;
then
for
F90C
in
ftn
''
;
do
test
-n
"
$F90C
"
||
exit
1
set
+e
F90BIN
=
`
which
$F90C
2>/dev/null
`
set
-e
test
!
-x
"
$F90BIN
"
||
break
done
fi
FC
=
${
FC
-
$F90C
}
# run compiler to produce preprocessor output
${
FC
}
-eP
"
${
outargs
[@]
}
"
# pipe sanitized preprocessor output to stdout
grep
-v
-h
'^#'
"
${
preprocessedFiles
[@]
}
"
#
# Local Variables:
# license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
# license-default: "bsd"
# End:
#
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