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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
7557dfb7
Verified
Commit
7557dfb7
authored
Sep 25, 2023
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Meson: add install rules
parent
6417520c
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
meson.build
+33
-6
33 additions, 6 deletions
meson.build
with
33 additions
and
6 deletions
meson.build
+
33
−
6
View file @
7557dfb7
# TODO:
# TODO:
# - Install files in right location
# - alias_target for MEX files; use it in {windows,macOS}/build.sh
# - alias_target for MEX files; use it in {windows,macOS}/build.sh
# - find a way to set GSL_BLAS_LIB to an empty value when querying pkg-config
# - find a way to set GSL_BLAS_LIB to an empty value when querying pkg-config
# for gsl; otherwise there is a risk of overriding OpenBLAS/MKL (though
# for gsl; otherwise there is a risk of overriding OpenBLAS/MKL (though
...
@@ -34,13 +33,37 @@ c_compiler = meson.get_compiler('c')
...
@@ -34,13 +33,37 @@ c_compiler = meson.get_compiler('c')
subdir
(
'preprocessor/src'
)
subdir
(
'preprocessor/src'
)
### Generated M-file
# Compatibility symlink
# NB: the following my be improved if this wishlist item is done:
# https://github.com/mesonbuild/meson/issues/11519
install_symlink
(
'dynare_m'
+
(
host_machine
.
system
()
==
'windows'
?
'.exe'
:
''
),
install_dir
:
'lib/dynare/matlab/preprocessor64'
,
pointing_to
:
'../../../../bin/dynare-preprocessor'
+
(
host_machine
.
system
()
==
'windows'
?
'.exe'
:
''
))
### M files
install_subdir
(
'matlab'
,
install_dir
:
'lib/dynare'
,
exclude_files
:
[
'utilities/tests/.git'
,
'utilities/tests/.gitignore'
,
'modules/reporting/.git'
,
'modules/reporting/.gitignore'
,
'modules/reporting/.gitlab-ci.yml'
,
'modules/dseries/.git'
,
'modules/dseries/.gitignore'
,
'modules/dseries/src/modules/matlab-fame-io/.git'
,
'modules/dseries/src/modules/matlab-fame-io/.gitignore'
,
'modules/dseries/src/modules/matlab-fame-io/doc/.gitignore'
,
'modules/dseries/src/modules/matlab-fame-io/tests/FameDatabases/.gitignore'
,
'modules/dseries/.gitmodules'
,
'modules/dseries/.gitlab-ci.yml'
])
sed_exe
=
find_program
(
'sed'
)
sed_exe
=
find_program
(
'sed'
)
custom_target
(
output
:
'dynare_version.m'
,
input
:
'matlab/dynare_version.m.in'
,
custom_target
(
output
:
'dynare_version.m'
,
input
:
'matlab/dynare_version.m.in'
,
command
:
[
sed_exe
,
's/@PACKAGE_VERSION@/'
+
meson
.
project_version
()
+
'/'
,
'@INPUT@'
],
command
:
[
sed_exe
,
's/@PACKAGE_VERSION@/'
+
meson
.
project_version
()
+
'/'
,
'@INPUT@'
],
capture
:
true
,
capture
:
true
,
build_by_default
:
true
)
# FIXME: This option can be removed when “install” is set to true
install
:
true
,
install_dir
:
'lib/dynare/matlab'
)
### MEX files
### MEX files
...
@@ -126,7 +149,9 @@ if get_option('build_for') == 'matlab'
...
@@ -126,7 +149,9 @@ if get_option('build_for') == 'matlab'
'fortran_args'
:
matlab_defs
+
[
'-fexceptions'
]
+
get_variable
(
'arch_fortran_args'
,
[]),
'fortran_args'
:
matlab_defs
+
[
'-fexceptions'
]
+
get_variable
(
'arch_fortran_args'
,
[]),
'c_args'
:
matlab_defs
+
[
'-fexceptions'
],
'c_args'
:
matlab_defs
+
[
'-fexceptions'
],
'link_args'
:
[
export_link_arg
,
'-L'
+
(
matlab_path
/
'bin'
/
matlab_arch
),
'-lmx'
,
'-lmex'
,
'-lmat'
],
'link_args'
:
[
export_link_arg
,
'-L'
+
(
matlab_path
/
'bin'
/
matlab_arch
),
'-lmx'
,
'-lmex'
,
'-lmat'
],
'link_depends'
:
export_file
}
'link_depends'
:
export_file
,
'install'
:
true
,
'install_dir'
:
'lib/dynare/mex/matlab'
}
# For unit tests
# For unit tests
exe_rpath
=
matlab_path
/
'bin'
/
matlab_arch
exe_rpath
=
matlab_path
/
'bin'
/
matlab_arch
...
@@ -177,7 +202,9 @@ else # Octave build
...
@@ -177,7 +202,9 @@ else # Octave build
'cpp_args'
:
octave_incflags
+
octave_defs
,
'cpp_args'
:
octave_incflags
+
octave_defs
,
'fortran_args'
:
octave_incflags
+
octave_defs
,
'fortran_args'
:
octave_incflags
+
octave_defs
,
'c_args'
:
octave_incflags
+
octave_defs
,
'c_args'
:
octave_incflags
+
octave_defs
,
'link_args'
:
octave_link_args
}
'link_args'
:
octave_link_args
,
'install'
:
true
,
'install_dir'
:
'lib/dynare/mex/octave'
}
# The -L argument is useful when cross-compiling.
# The -L argument is useful when cross-compiling.
blas_dep
=
declare_dependency
(
link_args
:
[
'-L'
+
(
octlibdir
/
'../..'
)
]
+
run_command
(
mkoctfile_exe
,
'-p'
,
'BLAS_LIBS'
,
check
:
true
).
stdout
().
split
())
blas_dep
=
declare_dependency
(
link_args
:
[
'-L'
+
(
octlibdir
/
'../..'
)
]
+
run_command
(
mkoctfile_exe
,
'-p'
,
'BLAS_LIBS'
,
check
:
true
).
stdout
().
split
())
...
@@ -246,7 +273,7 @@ if get_option('prefer_static')
...
@@ -246,7 +273,7 @@ if get_option('prefer_static')
endif
endif
# For use when creating intermediate static libraries to be incorporated in MEX files
# For use when creating intermediate static libraries to be incorporated in MEX files
static_library_kwargs
=
mex_kwargs
+
{
'name_prefix'
:
[],
'name_suffix'
:
[],
'link_args'
:
[],
'pic'
:
true
}
static_library_kwargs
=
mex_kwargs
+
{
'name_prefix'
:
[],
'name_suffix'
:
[],
'link_args'
:
[],
'pic'
:
true
,
'install'
:
false
}
mex_blas_fortran_iface
=
[
'mex/sources/matlab_mex.F08'
,
'mex/sources/blas_lapack.F08'
]
mex_blas_fortran_iface
=
[
'mex/sources/matlab_mex.F08'
,
'mex/sources/blas_lapack.F08'
]
pthread_fortran_iface
=
[
'mex/sources/pthread.F08'
]
pthread_fortran_iface
=
[
'mex/sources/pthread.F08'
]
...
...
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