-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use micromamba to install dependencies
- Loading branch information
Showing
8 changed files
with
208 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: docs | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python | ||
- numpy | ||
- matplotlib-base | ||
- ford | ||
- graphviz | ||
- gfortran |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: devel | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- fpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: devel | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- meson | ||
- ninja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
|
||
from os import environ, listdir, makedirs | ||
from os.path import join, isdir, exists | ||
from sys import argv | ||
from shutil import copy | ||
|
||
build_dir = environ["MESON_BUILD_ROOT"] | ||
if "MESON_INSTALL_DESTDIR_PREFIX" in environ: | ||
install_dir = environ["MESON_INSTALL_DESTDIR_PREFIX"] | ||
else: | ||
install_dir = environ["MESON_INSTALL_PREFIX"] | ||
|
||
include_dir = argv[1] if len(argv) > 1 else "include" | ||
module_dir = join(install_dir, include_dir) | ||
|
||
modules = [] | ||
for d in listdir(build_dir): | ||
bd = join(build_dir, d) | ||
if isdir(bd): | ||
for f in listdir(bd): | ||
if f.endswith(".mod"): | ||
modules.append(join(bd, f)) | ||
|
||
if not exists(module_dir): | ||
makedirs(module_dir) | ||
|
||
for mod in modules: | ||
print("Installing", mod, "to", module_dir) | ||
copy(mod, module_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
tests = [ | ||
'hybrd', | ||
'hybrd1', | ||
'lmder1', | ||
'lmdif1', | ||
'primes', | ||
] | ||
|
||
foreach t : tests | ||
test( | ||
t, | ||
executable( | ||
'example-@0@'.format(t), | ||
sources: files('example_@[email protected]'.format(t.underscorify())), | ||
dependencies: minpack_dep, | ||
), | ||
suite: 'example', | ||
) | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
project( | ||
'minpack', | ||
'fortran', | ||
version: '2.0.0', | ||
meson_version: '>=0.55', | ||
default_options: [ | ||
'default_library=both', | ||
'buildtype=debugoptimized', | ||
], | ||
) | ||
|
||
minpack_lib = library( | ||
meson.project_name(), | ||
sources: files( | ||
'src/minpack.f90', | ||
'src/minpack_capi.f90', | ||
), | ||
install: true, | ||
) | ||
|
||
minpack_inc = minpack_lib.private_dir_include() | ||
minpack_dep = declare_dependency( | ||
link_with: minpack_lib, | ||
include_directories: [minpack_inc, include_directories('include')], | ||
) | ||
|
||
minpack_lic = files( | ||
'LICENSE.txt', | ||
) | ||
|
||
minpack_header = files( | ||
'include/minpack.h', | ||
) | ||
|
||
install_data( | ||
minpack_lic, | ||
install_dir: get_option('datadir')/'licenses'/meson.project_name() | ||
) | ||
|
||
install_headers( | ||
minpack_header, | ||
) | ||
|
||
module_id = meson.project_name() | ||
meson.add_install_script( | ||
find_program(files('config'/'install-mod.py')), | ||
get_option('includedir') / module_id, | ||
) | ||
|
||
pkg = import('pkgconfig') | ||
pkg.generate( | ||
minpack_lib, | ||
description: 'Solver for nonlinear equations and least squares problems', | ||
subdirs: ['', module_id], | ||
) | ||
|
||
# add examples | ||
subdir('examples') | ||
|
||
# add the testsuite | ||
subdir('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
tests = [ | ||
'chkder', | ||
'hybrd', | ||
'hybrj', | ||
'lmder', | ||
'lmdif', | ||
'lmstr', | ||
] | ||
|
||
foreach t : tests | ||
test( | ||
t, | ||
executable( | ||
'test-@0@'.format(t), | ||
sources: files('test_@[email protected]'.format(t.underscorify())), | ||
dependencies: minpack_dep, | ||
), | ||
suite: 'unit', | ||
) | ||
endforeach | ||
|
||
if add_languages('c', required: false, native: false) | ||
test( | ||
'c-api', | ||
executable( | ||
'c-tester', | ||
sources: files('api/tester.c'), | ||
dependencies: minpack_dep, | ||
), | ||
suite: 'api', | ||
) | ||
endif |