Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
11abd220
Commit
11abd220
authored
3 weeks ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Make undected compiler messages silent and ensure CUBLAS is not invoked, if not found
parent
77735cdd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/configure.sh
+21
-12
21 additions, 12 deletions
build/configure.sh
with
21 additions
and
12 deletions
build/configure.sh
+
21
−
12
View file @
11abd220
...
@@ -26,15 +26,15 @@ OFFLOADFLAGS=""
...
@@ -26,15 +26,15 @@ OFFLOADFLAGS=""
# Function declarations
# Function declarations
function
guess_cxx
{
function
guess_cxx
{
# Guess the name of the C++ compiler
# Guess the name of the C++ compiler
result
=
$(
which mpicxx
)
result
=
$(
which mpicxx
2>/dev/null
)
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which g++
)
result
=
$(
which g++
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which clang
)
result
=
$(
which clang
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which icpx
)
result
=
$(
which icpx
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
"none"
result
=
"none"
...
@@ -44,21 +44,21 @@ function guess_cxx {
...
@@ -44,21 +44,21 @@ function guess_cxx {
function
guess_fc
{
function
guess_fc
{
# Guess the name of the FORTRAN compiler
# Guess the name of the FORTRAN compiler
result
=
$(
which mpif90
)
result
=
$(
which mpif90
2>/dev/null
)
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which gfortran
)
result
=
$(
which gfortran
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which f77
)
result
=
$(
which f77
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which flang
)
result
=
$(
which flang
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which flang-new
)
result
=
$(
which flang-new
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
$(
which ifx
)
result
=
$(
which ifx
2>/dev/null
)
fi
fi
if
[
"x
$result
"
=
"x"
]
;
then
if
[
"x
$result
"
=
"x"
]
;
then
result
=
"none"
result
=
"none"
...
@@ -626,6 +626,11 @@ if [ "x$CUBLAS" != "xno" ]; then
...
@@ -626,6 +626,11 @@ if [ "x$CUBLAS" != "xno" ]; then
cuda_pkg
=
$(
for
i
in
"
${
pkg_array
[@]
}
"
;
do
echo
"
$i
"
|
cut
--delimiter
=
" "
-f1
;
done
|
grep
cublas
)
cuda_pkg
=
$(
for
i
in
"
${
pkg_array
[@]
}
"
;
do
echo
"
$i
"
|
cut
--delimiter
=
" "
-f1
;
done
|
grep
cublas
)
CUDAFLAGS
=
$(
pkg-config
--cflags
${
cuda_pkg
}
)
CUDAFLAGS
=
$(
pkg-config
--cflags
${
cuda_pkg
}
)
CUDALDFLAGS
=
$(
pkg-config
--libs
${
cuda_pkg
}
)
CUDALDFLAGS
=
$(
pkg-config
--libs
${
cuda_pkg
}
)
else
# CUBLAS not detected
CUBLAS
=
"no"
CUDAFLAGS
=
""
CUDALDFLAGS
=
""
fi
# end of CUBLAS runtime decision tree
fi
# end of CUBLAS runtime decision tree
declare
-a
pkg_array
=
$(
pkg-config
--list-all
|
grep
cudart
)
declare
-a
pkg_array
=
$(
pkg-config
--list-all
|
grep
cudart
)
for
i
in
"
${
pkg_array
[@]
}
"
;
do
echo
"
$i
"
|
cut
--delimiter
=
" "
-f1
;
done
|
grep
cudart
>
/dev/null
for
i
in
"
${
pkg_array
[@]
}
"
;
do
echo
"
$i
"
|
cut
--delimiter
=
" "
-f1
;
done
|
grep
cudart
>
/dev/null
...
@@ -639,13 +644,17 @@ if [ "x$CUBLAS" != "xno" ]; then
...
@@ -639,13 +644,17 @@ if [ "x$CUBLAS" != "xno" ]; then
echo
$CUDALDFLAGS
|
grep
cublas
>
/dev/null
echo
$CUDALDFLAGS
|
grep
cublas
>
/dev/null
cudart_check
=
$?
cudart_check
=
$?
if
[
"x
${
cudart_check
}
"
!=
"x0"
]
;
then
if
[
"x
${
cudart_check
}
"
!=
"x0"
]
;
then
if
[
"x
${
CUBLAS
}
"
!=
"xno"
]
;
then
CUDALDFLAGS
=
"
$CUDALDFLAGS
-lcublas"
CUDALDFLAGS
=
"
$CUDALDFLAGS
-lcublas"
fi
fi
fi
echo
$CUDALDFLAGS
|
grep
cudart
>
/dev/null
echo
$CUDALDFLAGS
|
grep
cudart
>
/dev/null
cudart_check
=
$?
cudart_check
=
$?
if
[
"x
${
cudart_check
}
"
!=
"x0"
]
;
then
if
[
"x
${
cudart_check
}
"
!=
"x0"
]
;
then
if
[
"x
${
CUBLAS
}
"
!=
"xno"
]
;
then
CUDALDFLAGS
=
"
$CUDALDFLAGS
-lcudart"
CUDALDFLAGS
=
"
$CUDALDFLAGS
-lcudart"
fi
fi
fi
else
else
# pkg-config is not available
# pkg-config is not available
if
[
-f
/usr/local/cuda/include/cuda.h
]
;
then
if
[
-f
/usr/local/cuda/include/cuda.h
]
;
then
...
...
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