Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
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
Analyze
Contributor 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
openfoam
Commits
bbc43dd6
Commit
bbc43dd6
authored
8 years ago
by
Henry Weller
Browse files
Options
Downloads
Patches
Plain Diff
wmakeCollect: Create the makefiles in the platforms directory
parent
02e14ffd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wmake/wmake
+8
-8
8 additions, 8 deletions
wmake/wmake
wmake/wmakeCollect
+13
-21
13 additions, 21 deletions
wmake/wmakeCollect
with
21 additions
and
29 deletions
wmake/wmake
+
8
−
8
View file @
bbc43dd6
...
@@ -347,14 +347,14 @@ scheduler="wmakeCollect"
...
@@ -347,14 +347,14 @@ scheduler="wmakeCollect"
if
[
"
$all
"
=
"queue"
]
if
[
"
$all
"
=
"queue"
]
then
then
(
\
(
\
wmakeLnIncludeAll
-j
$WM_NCOMPPROCS
\
wmakeLnIncludeAll
-j
$WM_NCOMPPROCS
\
&&
WM_
ID
=
${
PWD
////_
}
.
$WM_OPTIONS
\
&&
WM_
COLLECT_DIR
=
$WM_PROJECT_DIR
/platforms/
${
WM_OPTIONS
}
/
${
PWD
////_
}
\
WM_SCHEDULER
=
$scheduler
\
WM_SCHEDULER
=
$scheduler
\
trap
'$scheduler -kill'
TERM INT
;
\
trap
'$scheduler -kill'
TERM INT
;
\
$scheduler
-clean
\
$scheduler
-clean
\
&&
wmake
-all
objects
\
&&
wmake
-all
objects
\
&&
$scheduler
\
&&
$scheduler
\
)
&&
wmake
-all
)
&&
wmake
-all
exit
$?
exit
$?
fi
fi
...
...
This diff is collapsed.
Click to expand it.
wmake/wmakeCollect
+
13
−
21
View file @
bbc43dd6
...
@@ -50,11 +50,11 @@ Collecting scheduler for fast parallel compilation of large numbers of object
...
@@ -50,11 +50,11 @@ Collecting scheduler for fast parallel compilation of large numbers of object
files. Can be used in compiling OpenFOAM by setting the WM_SCHEDULER variable.
files. Can be used in compiling OpenFOAM by setting the WM_SCHEDULER variable.
When called with a compilation command it is written into a file in the
When called with a compilation command it is written into a file in the
directory
~.
\
$
WM_
PROJECT/.collect/
$WM_ID
.
directory
$WM_
COLLECT_DIR
.
When called without a command the files in the
~.
\
$
WM_
PROJECT/.collect/
$WM_ID
When called without a command the files in the
$WM_
COLLECT_DIR
directory are
are
combined into a single Makefile which is passed to make to compile all of
combined into a single Makefile which is passed to make to compile all of
the
the
object files in parallel.
object files
efficiently
in parallel.
Typical usage for compiling OpenFOAM:
Typical usage for compiling OpenFOAM:
...
@@ -92,29 +92,21 @@ do
...
@@ -92,29 +92,21 @@ do
done
done
if
[
-z
"
$WM_
ID
"
]
if
[
-z
"
$WM_
COLLECT_DIR
"
]
then
then
echo
"
$Script
error:
build ID variable WM_ID
not set"
echo
"
$Script
error:
WM_COLLECT_DIR
not set"
exit
1
exit
1
fi
fi
# Location of the wmakeCollect makefiles
wmakeCollectDir
=
$HOME
/.
$WM_PROJECT
/.collect
# Make sure directories exist
mkdir
-p
$wmakeCollectDir
# Location of the wmakeCollect makefiles for this build
collectDir
=
$wmakeCollectDir
/
$WM_ID
# Collected makefile for this build
# Collected makefile for this build
makefile
=
"
$
wmakeCollectDir
/
Makefile
.
$WM_ID
"
makefile
=
"
$
WM_COLLECT_DIR
.
Makefile"
# Clean-up files and exit
# Clean-up files and exit
if
[
-n
"
$cleanup
"
]
if
[
-n
"
$cleanup
"
]
then
then
rm
-rf
$
collectDir
rm
-rf
$
WM_COLLECT_DIR
rm
-f
$makefile
rm
-f
$makefile
exit
0
exit
0
fi
fi
...
@@ -123,13 +115,13 @@ fi
...
@@ -123,13 +115,13 @@ fi
if
[
"$#"
-gt
0
]
if
[
"$#"
-gt
0
]
then
then
# Make sure directories exist
# Make sure directories exist
mkdir
-p
$
collectDir
mkdir
-p
$
WM_COLLECT_DIR
# The current target
# The current target
object
=
"
${
@
:
-1
:1
}
"
object
=
"
${
@
:
-1
:1
}
"
# Create a unique name for the makefile from the object path
# Create a unique name for the makefile from the object path
file
=
$
collectDir
/
${
object
////_
}
file
=
$
WM_COLLECT_DIR
/
${
object
////_
}
# Add the current target to the list of objects
# Add the current target to the list of objects
echo
"OBJECTS +=
$object
"
>>
$file
echo
"OBJECTS +=
$object
"
>>
$file
...
@@ -140,16 +132,16 @@ then
...
@@ -140,16 +132,16 @@ then
echo
-e
"
\t
${
@
:1:
(
$#-1
)
}
$object
"
>>
$file
echo
-e
"
\t
${
@
:1:
(
$#-1
)
}
$object
"
>>
$file
echo
>>
$file
echo
>>
$file
else
else
if
[
-d
$
collectDir
]
if
[
-d
$
WM_COLLECT_DIR
]
then
then
# Collect all the makefiles into a single makefiles for this build
# Collect all the makefiles into a single makefiles for this build
cat
$
collectDir
/
*
>
$makefile
cat
$
WM_COLLECT_DIR
/
*
>
$makefile
# Add a build rule for all of the targets
# Add a build rule for all of the targets
echo
'all: $(OBJECTS)'
>>
$makefile
echo
'all: $(OBJECTS)'
>>
$makefile
# Clear out all of the target makefiles
# Clear out all of the target makefiles
rm
-rf
$
collectDir
rm
-rf
$
WM_COLLECT_DIR
# Run make on the collected makefile
# Run make on the collected makefile
make
-j
$WM_NCOMPPROCS
-f
$makefile
all
make
-j
$WM_NCOMPPROCS
-f
$makefile
all
...
...
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