►
From YouTube: 04 Programming Environment and Compilation
Description
Part of the NERSC New User Training on June 16, 2020.
Please see https://www.nersc.gov/users/training/events/new-user-training-june-16-2020/ for the training day agenda and presentation slides.
A
A
A
So
with
the
pottery
program
environment,
so
they
are
Intel
Cano
and
create
compilers
and
Intel
is
the
default.
So
by
programming
environment
way
we
mean
those
compilers
and
the
end
of
the
matching
libraries
and
they
are.
The
module,
is
something
like
PRG
EMV
and
here
the
compiler
names
so
Intel
they
provides
user
friendly
programming
environment.
So
if
you
want
to
change
it
compilers
you
can
do
module,
swap
this
program.
Environment
module
to
get
the
whole
matching
environment
so
use
so
compiler
wrappers
provided
by
Cray.
A
A
So
as
rebecca
has
already
introduced
the
hardware-
and
we
have
two
types
of
processors
on
curry,
so
one
is
the
bigger
person
is
K&L
and
the
other
one
is
as
well
so
in
terms
of
companies,
and
you
need
to
be
aware.
The
binary
compatibility
so
has
well
binaries
run
on
K&L,
but
K&L
binary
will
not
run
on
as
well.
That's
because
K&L
supports
the
extended
instruction
sets
which
are
not
supported
on
as
well.
So
usually
we
recommend
the
separate
bills
for
as
well
and
okay.
A
Now
this
is
for
optimal
performance,
so
we
we
do
cross
complacent.
So
you
log
into
Cori,
then
the
login
node,
which
is
Haswell
notes
and
you
can
compile
for
a
Haswell
and
ok
on
our
computer
notes.
So
by
default
we
load
the
module
name,
the
crêpey
as
well,
so
this
one
will
set
an
environment
variable
called
cray
underscore
cpu
underscore
target
equal
to
as
well.
So
with
this
environment
variable.
And
if
you
use
compiler
wrappers
to
build
the
code,
then
the
binaries
will
be
optimized
for
hazard,
well
processors.
A
So
this
is
a
default
behavior
on
curries.
If
you
go
to
login
to
quarry
and
type
module
list,
you
can
see
a
lot
of
modules
and
among
them
you
need
to.
You
can
take
a
look
at
the
PRG
AMD
Intel
module.
This
is
loaded
by
default.
That's
what
we
mean
by
Intel.
Compiler
is
default,
or
this
you
can
see
Intel
compiler,
also
loaded
by
default,
and
in
addition
we
have
this
creepy
has
well
loaded.
So
that's
why,
if
you
use
compiler
wrappers
to
compile
the
resulting
binaries
will
be
optimized
for
as
well.
A
So
this
is
the
step.
So
if
you
want
to
compile
for
career
as
well,
that
is
easy.
You
don't
have
to
do
anything
but
to
switch
modules
and
and
those
things
you
just
do-
use
these
compiler
wrappers
and
specify
your
compilation,
flags
and
then
just
provided
the
source
code.
So
that's
how
you
use
Intel
compiler
to
use
creek
Cray
and
the
kernel
compiler.
You
need
to
swap
the
compiler
first,
so
you
do
a
module,
a
program
environment
swap
by
using
this
module
command
so
doing
this,
and
then
you
still
do
the
same
thing.
A
Use
the
compiler
rappers
to
do
the
compilation.
So
cray
is
the
same.
You
can
see
that
this
is
the
basics
for
how
to
compile
on
Cory.
So
I
want
to
point
out,
so
some
users
had
confusing
like
they
consider
they
thought
ft,
NC,
C
and
C++
compilers.
Actually
they
are
not
so
they
invoke
the
Intel
canoe
or
Cray
compilers
under
the
hood,
depending
on
the
low
D,
the
program
environment
module.
So
these
are
called
compiler
wrappers.
They
are
not
great
compiler
so
to
compile
for
Cory
K&L.
You
just
need
to
do
one
more
step.
A
A
So
next
I
will
talk
about
how
to
deal
with
the
compile
and
Link
line.
So
let's
look
at
the
compilers.
So
at
this
stage
I
think
you
are
new
to
we
suppose
you
neutral
curry,
and
we
don't
want
to
recommend
any
specific
compiler
for
you.
So
in
general,
these
are
the
comments
we
can
provide
so
for
Intel.
If
you
use
Intel
compiler,
you
will
have
a
better
chance
to
get
processor
specific
optimizations,
especially
for
the
newer
processor
types,
something
like
K&L.
A
We
consider
you
may
have
better
chance
to
getting.
You
know
more
process,
specific
optimizations
from
using
Intel
compiler
for
Korea
compiler,
actually
many
features
and
optimizations
supported
and
especially
Korea
compiler
is
very
strong
with
the
I
mean
with
the
fortune
so
and
there
are
like
usable
tools
like
reveal
they
work
with
the
Korea
compilers.
Only
so
you
may
consider
to
use
Korea
compiler
in
that
sense,
so
kono
is
widely
used
by
you
know
community,
so
many
open-source,
so
I
mean
open
software.
Are
they
they
use
I
mean
by
default?
A
They
usually
provide
Google,
compiler
configuring
and
make
file
and
all
sort
of
things.
So
our
recommendations,
you
start
with
the
compilers
that
vendor
or
call
the
developers
used
so
to
minimize
the
chance
to
hit
D
compiler
and
code
box,
and
then
you
can
explore
the
different
explore
different
the
compilers
for
optimal
performance.
A
So,
regarding
the
compiler
flags
we
want
we
prefer
to
recommend
more,
like
modest
compiler,
optimization
at
least
to
start
with,
so
we
usually
provide
a
default
optimization
level
for
Intel
and
the
correct
compiler.
But
you
know
compilers
default.
Optimization
is
low.
It
doesn't
do
any
optimization
by
default,
so
you
need
to
provide
at
least
the
old
true
level
of
you
know
optimization
for
that.
A
So
we
recommend
that
and
for
to
compile
OpenMP
code,
you
need
to
provide
extra
flags
so
for
Intel
you
needed
to
provide
this
flag
and
then
you
can
see
Cano
and
and
the
creators
different
the
flag.
So
one
thing
I
want
to
point
out
is
before
the
create
compiler
version.
9.0
Korea
uses
their
own
implementation,
back-end
for
both
Fortran
and
the
C
and
C++
compilers,
but
is
from
this
new
newer
version.
9.0
and
up
create
C++
compilers
now
use
this
claim
as
back-end.
A
So
if
you
use
the
C
and
C++
compilers
of
Korea
compiler
now,
then
you
need
to
use
those
matching
compiler
phlanagus.
Those
are
all
from
this
clang
compiler
options,
so
Craig
also
provided
a
classical
module
so
which
steer.
Support
to
the
older
I
mean
previous
C
and
C++
play
at
the
end,
and
we
recommend
you
switch
to
the
Newark
recommendation
from
them.
A
Just
one
on
to
add,
like
after
your
compiling
the
code
that
you
need
to
bury
that
validator
either
the
correctness
of
the
code.
So
usually
you
may
want
to
use
this
debug
flag
to
lower
the
optimization
and
see
if
you
get
the
same
result
with
using
the
optimization
flag
and
the
without
using
that
so
to
see
your
result
is
testable
and
also
I
want
to
point
out
I
pay
attention
to
the
the
different
compilers
default
behavior.
So
something
like
the
openmp
thread
use.
A
It
could
be
different
from
different
compilers,
so,
for
example,
Intel
and
the
gönül
they
default
to
I
use
the
number
of
open,
MP
stress
equal
to
the
number
of
CPU
slots
available,
while
Korea
compiler
only
use
one
by
default.
So
we
recommend
you
to
redo
the
compiler
main
page,
so
you
can
do
men
and
then
the
native,
a
compiler
code,
like
I
thought,
is
EPC
and
type
of
thing
to
get
the
compiler
more
information
about
the
compiler
flags
and
more
so
now.
A
Let's
look
at
the
house
to
the
one,
take
care
of
takes
care
of
the
link,
the
header
and
the
library
tests
and
the
library.
So
you
can
do
this
as
usual,
like
you
can
do
it
manually.
So
first
you
need
to
find
out
where
those
tests
are
and
then
where
the
libraries
reside
and
then
just
add
them
manually
on
your
compiled
in
client
by
using
minus
I
and
then
minus
capital
L
option.
But
this
can
be
done
also
automatically.
A
And
then
so,
when
you
switch
to
different
compilers
your
stereos,
you
can
still
use
the
same
compiler
replica.
You
can
still
use
FTN
for
Fortran
and
and
and
just
continue
to
use,
compiler
wrappers.
So
with
the
compiler
wrappers,
they
do
cross
compilation.
So
you
can
use
that
to
compile
for
Keanu
K&L
on
the
lovely
nose
and
in
some
of
the
cases
you
may
need
to
compile
codes
directly
on
K&L
node.
So
in
that
case
you
need
to
get
on
a
computer.
A
No,
the
first
you
can
use
this
interactive
QoS,
get
on
the
computer
node
first
and
then
compile
from
there.
So
compiler
wrappers
now
link
dynamic
dynamically
by
default.
So
not
long
ago,
I
mean
last
year
before
this
a
why
allocation
year
we
were
doing
I
mean
compiler
wrappers,
our
default
compiler
wrappers
were
doing
static
linking,
but
from
this
a
why
year,
it's
it
started
to
do
dynamic
linking
so
because
of
that,
so
you
need
to.
After
you
get
the
code
compiled.
You
need
to
take
care
of
the
runtime
environment.
A
Usually
you
need
to
use
this
load.
Library
under
scope
has
environment
variable
to
provide
where
your
share
the
library
is,
and
we
recommend
actually.
Alternatively,
if
you
use
this
our
pass
again
compiling,
then
you
don't
have
to
be.
You
know
you
don't
have
to
deal
with
this
low.
The
library
pass
environment.
A
So
one
thing
we
needed
to
notice
is
the
dynamically
linked.
The
applications
can
take
time
to
load
up
at
the
at
runtime.
So
if
you
are,
if
you
have
to
run
like
you,
you
run
your
application
at
a
larger
scale.
You
may
consider
to
build
your
applications
statically
using
this
environment
variable
before
compiling.
A
So
the
reason
we
recommend
the
compiler
wrappers.
We
can
list
a
couple
points
over
here.
So
first
it
it
has
some
architects,
a
specific
compiler
flags.
I
already
mentioned
this.
So
under
the
hood,
it
will
add
those
architecture,
specific
flags,
and
then
it
automatically
add
header
and
library,
pests
and
also
the
libraries
on
the
compiled
link
line
and
also
it
allows
you
to
provide
I
mean
it.
Allow
user
provided
options
to
take
the
precedence.
A
So
it
is,
it
does
go
to
things
for
you
by
default,
but
the
steer
you
can
overwrite
them
by
providing
explicit
in
your
options.
So
you
can
take
a
look:
the
verbals
output,
the
from
compiler
wrappers,
so
by
default
you
can
see
that
if
you
do
module
list,
you
can
see
some
modules
are
loaded,
something
like
krei,
MPT
library
and
also
creative
side
library.
This
provides
mass
libraries,
so
by
default,
the
compiler
records
will
link
to
this
MPI
and
this
lay
back
and
blast
libraries
by
default
automatically.
A
So
you
don't
have
to
worry
about
them
and
also
for
all
the
create
provided
the
libraries.
If
you
loaded
them,
you
can
get
them
linked
automatically.
So
you
can
take
a
look
at
the
compilers
or
bubbles
output,
it's
harder
to
read
like,
but
you
can
take
a
look.
What
the
I
mean
the
compiler
wrappers
link
under
the
hood.
So
you
can
see
many
libraries
LinkedIn,
although
you
didn't
provide
anything
like
you,
just
do
FTN
and
then
the
code
name,
but
under
the
hood
it
does
a
lot
of
thing
for
you.
So.
A
The
reason
I
want
to
point
out
these
verbals
output
is
because
it
can
provide
a
lot
of
information.
So
many
things.
Actually,
you
can
learn
from
its
output,
even
buddy.
Let's
say
if
you
want
to
manual
the
links
I'm
like
mkl
library,
you
may
not
know
like
exactly
what
the
library
needs
you
should
provide,
so
you
can
learn
from
that.
A
So
in
this
case
it
shows
you
can
see
the
libraries
mkl
libraries
enter
those
entered
in
the
link
line,
so
you
can
learn
a
lot
from
d
or
both
output
of
compiler
wrappers,
so
I'm
going
to
talk
about
so
available
libraries
and
provide
some
examples
in
this
section.
So
we
use
module
mechanisms
to
manage
our
software,
so
you
can
type
module
over
to
see
the
available
self
aware.
So
usually
we
have
two
types
of
supported.
Libraries,
one
is
from
Cray.
These
are
the
vendor
provided
packages
and
libraries.
A
They
usually
come
from
the
many
of
them
come
from
these
tests
and
then
you
can
type
emoji
overall
command
to
again.
You
see
the
seed
of
a
number
one,
and
here
nurses
staff
also
support
a
lot
of
reliable
release,
but
so
far
most
of
our
nurse
nurse
steps
the
party,
the
libraries
they
do
not
interact
with
the
correct
compiler
wrappers.
A
So
this
is
a
examples
of
linking
to
create
provided
libraries,
so
you
can
do
let's
say,
link
we
do
cray
and
peach
library
and
the
correct
scientific
libraries.
You
don't
have
to
do
anything
just
in
the
default
environment,
just
to
use
a
compiler
wrappers
and
then
provide
source
code
and
linking
to
the
cray
hdf5
and
the
netcdf
library
is
also
automatically
you
just
load
them
and
then
compile
without
worrying
about
the
compiling
crime.
So
again
you
can
use
this
burbles.
A
We
option
to
see
the
detail
of
the
linking,
so
something
similar
like
for
pet
CC
is
widely
used
to
the
library.
You
can
look
at
just
a
load,
the
your
choice
of
Craighead
to
see
module,
and
then
you
can
use
V
option
to
see
how
it
links
the
same
with
fftw.
So
those
are
you
know
how
your
so.
Basically,
if
you
use
compiler
wrappers,
then
linking
to
create,
provided
the
libraries
is
a
pretty
easily
so
linking
to
provided
the
libraries,
you
need
to
do
a
little
bit
of
manual
work.
A
A
So
this
is
an
example
of
linking
to
MK.
Literally,
we
recommend
these
MK
l
inclined
advisors
to
go
there,
providing
options,
but
your
choices.
Then
it
will
provide
the
things
that
the
link
line
for
you.
So
if
you
want
to,
for
some
reason,
use
Intel,
MPI
library,
then
you
can
just
you
need
to
load
this
separate
module
called
INPI
and
then
use
the
the
NPR
wrappers
provided
by
inhale
to
compile
your
MPI
code.
A
So
I
will
just
to
briefly
introduce
what
is
the
one
we
recently
provided
on
the
spec,
a
package
manager.
So
basically
we
want
this
package
manager
make
your
installation
work
easy.
So
it
has
a
lot
of
good
features
and
among
them
I
mean
the
the
spec
installation
is
easy
kind
of
to
it
always
take
care
of
your
dependencies
and
with
a
simple
command
like
spec
install.
It
can
do
many
things
under
the
hood
and
it
it
allows
you
to
specify
the
configuration
with
your
choices
of
compiler
in
runtime
ian
and
also
the
I'm.
A
Sorry,
your
choice
of
compiler
and
compile
time
options,
and
all
these
things
so
I
am
on
quarry.
We
provide
spec
module,
so
you
can
access
it
by
doing
module,
know
the
spec.
So
the
advantage
over
using
that
is
you
can
access
to
nurse
recommended
up-to-date
configuration
files,
but
you
can
overwrite
them.
A
Usually
you
to
spec,
find
and
then
package
the
name
you
can
find
if
its
installed
on
curry
and
if
not,
then
you
can
type
spec
install
and
then
provide
package
name
to
install.
So
these
are
some
examples
of
specific
packages,
but
you
can
take
a
look,
some
of
the
small
like
a
tools
like
nano
kind
of
canoe
plot
and
those
are
things:
if
you
want
the
specific
version,
it
will
be
very
easy
to
install.
A
So
if
it's
spec
install
fails,
we
hope
you.
We
recommend
you
to
open
issue
directly
at
the
developer
side
and
then
you
can
modify
that
on
your
own
and
then
build
on
our
system.
So
we
provide
like
a
step
7.
We
configured
our
module,
spec
module
with
different
local
repos.
So
this
is
the
place
you
can
put
the
package
the
file
and
do
modification
there.