Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
ThirdParty-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Development
ThirdParty-common
Commits
adfe2833
Commit
adfe2833
authored
6 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
CONFIG: additional llvm configuration for mesa build (
#41
)
parent
3fe5c2be
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
makeMesa
+59
-23
59 additions, 23 deletions
makeMesa
with
59 additions
and
23 deletions
makeMesa
+
59
−
23
View file @
adfe2833
...
...
@@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2016-201
9
OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
...
...
@@ -34,7 +34,7 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
unset
vtk_version mesa_version
# Purge current values
unset
vtk_version mesa_version
mesa_llvm
# Purge current values
# mesa version from OpenFOAM etc/config.sh file:
_foamConfig vtk
...
...
@@ -50,6 +50,7 @@ usage() {
usage:
${
0
##*/
}
[OPTION] mesa-VERSION [-- configure-options]
options:
-gcc Force gcc/g++ instead of using
\$
WM_CC,
\$
WM_CXX
-llvm VER llvm version (in ThirdParty) or 'system' to use system
-help
* build Mesa with
...
...
@@ -60,14 +61,26 @@ USAGE
}
#------------------------------------------------------------------------------
exportCompiler
# Compiler info for CMake/configure
unset
withLLVM
# Non-standard location for clang?
case
"
$WM_COMPILER_TYPE
-
$WM_COMPILER
"
in
ThirdParty-Clang
*
)
thirdPartyClang
=
true
(
ThirdParty-Clang
*
)
withLLVM
=
true
# 'true' means find on path
;;
*
)
unset
thirdPartyClang
(
system-Clang
*
)
withLLVM
=
system
# 'system' means find on path
;;
(
*
)
if
_foamIsNone
"
$mesa_llvm
"
then
withLLVM
=
false
elif
_foamIsSystem
"
$mesa_llvm
"
then
withLLVM
=
system
# 'system' means find on path
else
withLLVM
=
"
$mesa_llvm
"
# Take value from mesa config
fi
;;
esac
...
...
@@ -80,12 +93,19 @@ do
-h
|
-help
)
usage
;;
-gcc
)
useGcc
unset
thirdPartyClang
unset
withLLVM
;;
-llvm
)
[
"$#"
-ge
2
]
||
die
"'
$1
' option requires an argument"
withLLVM
=
"
$2
"
shift
;;
llvm-
*
)
withLLVM
=
"
$1
"
;;
mesa-
*
)
mesaPACKAGE
=
"
${
1
%%/
}
"
;;
*
)
die
"unknown option/argument: '
$1
'"
;;
...
...
@@ -108,27 +128,43 @@ fi
#------------------------------------------------------------------------------
# Locate third-party clang as required
if
[
"
$thirdPartyClang
"
=
true
]
then
thirdPartyClang
=
$(
command
-v
clang
)
||
{
echo
"Error: could not properly locate clang"
case
"
$withLLVM
"
in
(
true
|
system
)
LLVM_ARCH_PATH
=
"
$(
command
-v
clang
)
"
||
{
echo
"Error: could not properly locate
llvm/
clang"
exit
2
}
# Root installation directory
thirdPartyClang
=
${
thirdPartyClang
%/bin/clang
}
LLVM_ARCH_PATH
=
"
${
LLVM_ARCH_PATH
%/bin/clang
}
"
[
-d
"
$
thirdPartyClang
"
]
||
{
echo
"Error: could not properly locate clang"
[
-d
"
$
LLVM_ARCH_PATH
"
]
||
{
echo
"Error: could not properly locate
llvm/
clang"
exit
2
}
fi
;;
(
''
|
none
|
false
)
withLLVM
=
none
echo
"No llvm"
;;
(
llvm-
*
)
echo
"check llvm =
$withLLVM
"
LLVM_ARCH_PATH
=
"
$WM_THIRD_PARTY_DIR
/platforms/
$WM_ARCH
/
$withLLVM
"
[
-d
"
$LLVM_ARCH_PATH
"
]
||
{
echo
"Error: could not properly locate llvm/clang"
exit
2
}
;;
esac
#------------------------------------------------------------------------------
#
# Build MESA
# For 64-bit
# - MESA itself will normally build into 'lib64'.
# - MESA itself will normally build into 'lib64'
(depends on autoconfig)
.
#
# MESA_SOURCE_DIR : location of the original sources
# MESA_ARCH_DIR : installation directory
...
...
@@ -151,9 +187,9 @@ adjustMESA()
# Configuration options:
unset
configOpt
if
[
-d
"
$
thirdPartyClang
"
]
if
[
-d
"
$
LLVM_ARCH_PATH
"
]
then
configOpt
=
"
$configOpt
--with-llvm-prefix=
$
thirdPartyClang
"
configOpt
=
"
$configOpt
--with-llvm-prefix=
$
LLVM_ARCH_PATH
"
fi
# Additional configure options
...
...
@@ -178,11 +214,11 @@ adjustMESA()
echo
"----"
echo
"Building
$mesaPACKAGE
"
echo
" Source
:
$MESA_SOURCE_DIR
"
echo
" Target
:
$MESA_ARCH_PATH
"
if
[
-d
"
$
thirdPartyClang
"
]
echo
" Source :
$MESA_SOURCE_DIR
"
echo
" Target :
$MESA_ARCH_PATH
"
if
[
-d
"
$
LLVM_ARCH_PATH
"
]
then
echo
"
Clang :
$thirdPartyClang
"
echo
"
llvm :
$LLVM_ARCH_PATH
"
fi
echo
"----"
...
...
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