Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Dynare
dynare
Commits
deba9cd4
Verified
Commit
deba9cd4
authored
1 month ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
CI: add job for creating MATLAB Online package
parent
33d4b0ec
Branches
Branches containing commit
No related tags found
No related merge requests found
Checking pipeline status
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+14
-0
14 additions, 0 deletions
.gitlab-ci.yml
scripts/matlab-online/packageDynare.m
+2
-2
2 additions, 2 deletions
scripts/matlab-online/packageDynare.m
scripts/matlab-online/packageDynare.sh
+20
-6
20 additions, 6 deletions
scripts/matlab-online/packageDynare.sh
with
36 additions
and
8 deletions
.gitlab-ci.yml
+
14
−
0
View file @
deba9cd4
...
@@ -142,6 +142,20 @@ pkg_macOS_arm64:
...
@@ -142,6 +142,20 @@ pkg_macOS_arm64:
expire_in
:
3 days
expire_in
:
3 days
needs
:
[
"
build_doc"
]
needs
:
[
"
build_doc"
]
pkg_matlab_online
:
stage
:
pkg
script
:
-
meson rewrite kwargs set project / version "$VERSION"
-
cd scripts/matlab-online && ./packageDynare.sh
tags
:
-
matlab-online
artifacts
:
paths
:
-
scripts/matlab-online/*.mltbx
expire_in
:
3 days
needs
:
[]
when
:
manual
test_matlab
:
test_matlab
:
stage
:
test
stage
:
test
script
:
script
:
...
...
This diff is collapsed.
Click to expand it.
scripts/matlab-online/packageDynare.m
+
2
−
2
View file @
deba9cd4
function
packageDynare
(
zipfile
,
version
,
logo
)
function
packageDynare
(
zipfile
,
version
,
version_sanitized
,
logo
)
tfolder
=
tempname
;
tfolder
=
tempname
;
mkdir
(
tfolder
)
mkdir
(
tfolder
)
...
@@ -10,7 +10,7 @@ unzip(zipfile,dynarefld)
...
@@ -10,7 +10,7 @@ unzip(zipfile,dynarefld)
% create tbx options
% create tbx options
opts
=
matlab
.
addons
.
toolbox
.
ToolboxOptions
(
dynarefld
,
"dynare"
,
...
opts
=
matlab
.
addons
.
toolbox
.
ToolboxOptions
(
dynarefld
,
"dynare"
,
...
ToolboxName
=
"Dynare"
,
...
ToolboxName
=
"Dynare"
,
...
ToolboxVersion
=
version
,
...
ToolboxVersion
=
version
_sanitized
,
...
Summary
=
"Solves, simulates and estimates a wide class of economic models"
,
...
Summary
=
"Solves, simulates and estimates a wide class of economic models"
,
...
AuthorName
=
"Dynare Team"
,
...
AuthorName
=
"Dynare Team"
,
...
ToolboxImageFile
=
logo
,
...
ToolboxImageFile
=
logo
,
...
...
...
This diff is collapsed.
Click to expand it.
scripts/matlab-online/packageDynare.sh
+
20
−
6
View file @
deba9cd4
#!/bin/bash
#!/bin/bash
set
-exo
pipefail
set
-exo
pipefail
# Creates a dynare-X.Y.mltbx in the current repository, using the settings below.
# Creates a dynare-X.Y.mltbx in the current repository, using the settings
# Needs to be run from Ubuntu 24.04 LTS, with the needed packages installed.
# below. Needs to be run from Ubuntu, with the needed packages installed.
# The required Ubuntu version can be obtained by running “!lsb_release -a” in
# MATLAB Online.
X13ASVER
=
1-1-b61
X13ASVER
=
1-1-b61
MATLABPATH
=
/opt/MATLAB/R2024b
MATLABVER
=
R2024b
MATLABPATH
=
/opt/MATLAB/
${
MATLABVER
}
# TODO: change size and put white background for better rendering in MATLAB Add-Ons browser
# TODO: change size and put white background for better rendering in MATLAB Add-Ons browser
DYNARE_PNG_LOGO
=
../../preprocessor/doc/logos/dlogo.png
DYNARE_PNG_LOGO
=
../../preprocessor/doc/logos/dlogo.png
...
@@ -18,13 +22,23 @@ cleanup ()
...
@@ -18,13 +22,23 @@ cleanup ()
trap
cleanup EXIT
trap
cleanup EXIT
pushd
../..
pushd
../..
meson setup
-Dmatlab_path
=
"
$MATLABPATH
"
-Dbuildtype
=
release
-Dprefer_static
=
true
"
$tmpdir
"
/build-matlab-online
meson setup
-Dbuild_for
=
matlab
-Dmatlab_path
=
"
$MATLABPATH
"
-Dbuildtype
=
release
-Dprefer_static
=
true
"
$tmpdir
"
/build-matlab-online
cd
"
$tmpdir
"
/build-matlab-online
cd
"
$tmpdir
"
/build-matlab-online
meson compile
meson compile
-v
meson
install
--destdir
"
$tmpdir
"
meson
install
--destdir
"
$tmpdir
"
DYNAREVER
=
$(
meson introspect
--projectinfo
| jq
-r
'.version'
)
DYNAREVER
=
$(
meson introspect
--projectinfo
| jq
-r
'.version'
)
# Sanitize the version number so that is corresponds to MATLAB toolbox
# requirements: the version must be a scalar string or character vector of the
# form Major.Minor.Bug.Build, where Bug and Build are optional.
# Hence remove any character which is not a number or a dot, and ensure that we
# have at least a minor version number.
DYNAREVER_SANITIZED
=
${
DYNAREVER
//[^0-9.]/
}
if
[[
${
DYNAREVER_SANITIZED
}
!=
*
.
*
]]
;
then
DYNAREVER_SANITIZED
=
${
DYNAREVER_SANITIZED
}
.0
fi
cd
..
cd
..
strip usr/local/bin/dynare-preprocessor
strip usr/local/bin/dynare-preprocessor
strip usr/local/lib/dynare/mex/matlab/
*
.mexa64
strip usr/local/lib/dynare/mex/matlab/
*
.mexa64
...
@@ -45,4 +59,4 @@ zip -q -r "$tmpdir"/dynare.zip *
...
@@ -45,4 +59,4 @@ zip -q -r "$tmpdir"/dynare.zip *
# make toolbox
# make toolbox
popd
popd
"
$MATLABPATH
/bin/matlab"
-batch
"packageDynare('
$tmpdir
/dynare.zip', '
$DYNAREVER
', '
$DYNARE_PNG_LOGO
')"
"
$MATLABPATH
/bin/matlab"
-batch
"packageDynare('
$tmpdir
/dynare.zip', '
$DYNAREVER
',
'
$DYNAREVER_SANITIZED
',
'
$DYNARE_PNG_LOGO
')"
This diff is collapsed.
Click to expand it.
Sébastien Villemot
@sebastien
mentioned in commit
15dfc4c7
·
1 month ago
mentioned in commit
15dfc4c7
mentioned in commit 15dfc4c74096b8c227f51953c855866ca62131bf
Toggle commit list
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