Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openmp-lab-exercises
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pdc-summer-school
openmp-lab-exercises
Commits
092d396e
Commit
092d396e
authored
Aug 15, 2018
by
Niclas Jansson
Browse files
Options
Downloads
Patches
Plain Diff
Set compiler flags depending on which PrgEnv is used
parent
24a24061
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
advanced_lab/c/Makefile
+9
-1
9 additions, 1 deletion
advanced_lab/c/Makefile
advanced_lab/f90/Makefile
+14
-3
14 additions, 3 deletions
advanced_lab/f90/Makefile
with
23 additions
and
4 deletions
advanced_lab/c/Makefile
+
9
−
1
View file @
092d396e
CC
=
cc
CC
=
cc
ifeq
($(CRAY_PRGENVCRAY), loaded)
CFLAGS
=
-O2
-homp
CFLAGS
=
-O2
-homp
else
ifeq
($(CRAY_PRGENVINTEL), loaded)
CFLAGS
=
-O2
-openmp
else
ifeq
($(CRAY_PRGENVGNU), loaded)
CFLAGS
=
-O2
-fopenmp
else
CFLAGS
=
-O2
endif
SRC
=
vtk_export.c shwater2d.c
SRC
=
vtk_export.c shwater2d.c
OBJS
=
${
SRC:.c
=
.o
}
OBJS
=
${
SRC:.c
=
.o
}
DEST
=
shwater2d
DEST
=
shwater2d
...
@@ -10,7 +18,7 @@ $(DEST): $(OBJS)
...
@@ -10,7 +18,7 @@ $(DEST): $(OBJS)
$(
CC
)
$(
CFLAGS
)
$(
OBJS
)
-o
$@
-lm
$(
CC
)
$(
CFLAGS
)
$(
OBJS
)
-o
$@
-lm
clean
:
clean
:
rm
-f
$(
DEST
)
*
.mod
*
.MOD
*
.o
rm
-f
$(
DEST
)
*
.o
%.o
:
%.c
%.o
:
%.c
$(
CC
)
$(
CFLAGS
)
-c
$<
$(
CC
)
$(
CFLAGS
)
-c
$<
...
...
This diff is collapsed.
Click to expand it.
advanced_lab/f90/Makefile
+
14
−
3
View file @
092d396e
F90
=
ftn
FC
=
ftn
ifeq
($(CRAY_PRGENVCRAY), loaded)
FFLAGS
=
-O2
-homp
FFLAGS
=
-O2
-homp
else
ifeq
($(CRAY_PRGENVINTEL), loaded)
FFLAGS
=
-O2
-openmp
else
ifeq
($(CRAY_PRGENVGNU), loaded)
ifeq
($(shell expr $(GCC_VERSION) '<' 5.0), 1)
$(
error
Unsupported GCC version, use at least v5.x
(
module swap gcc gcc/5.1.0
))
endif
FFLAGS
=
-O2
-fopenmp
else
FFLAGS
=
-O2
endif
SRC
=
vtk_export.f90 shwater2d.f90
SRC
=
vtk_export.f90 shwater2d.f90
OBJS
=
${
SRC:.f90
=
.o
}
OBJS
=
${
SRC:.f90
=
.o
}
DEST
=
shwater2d
DEST
=
shwater2d
...
@@ -7,11 +18,11 @@ DEST = shwater2d
...
@@ -7,11 +18,11 @@ DEST = shwater2d
all
:
$(DEST)
all
:
$(DEST)
$(DEST)
:
$(OBJS)
$(DEST)
:
$(OBJS)
$(
F
90
)
$(
FFLAGS
)
$(
OBJS
)
-o
$@
$(
F
C
)
$(
FFLAGS
)
$(
OBJS
)
-o
$@
clean
:
clean
:
rm
-f
$(
DEST
)
*
.mod
*
.MOD
*
.o
rm
-f
$(
DEST
)
*
.mod
*
.MOD
*
.o
%.o
:
%.f90
%.o
:
%.f90
$(
F
90
)
$(
FFLAGS
)
-c
$<
$(
F
C
)
$(
FFLAGS
)
-c
$<
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