Skip to content

Commit e70ce36

Browse files
authored
Merge branch 'master' into Duplicate_module_definitions
2 parents 9a14cd1 + cb3337b commit e70ce36

File tree

30 files changed

+894
-392
lines changed

30 files changed

+894
-392
lines changed

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
# Fortran Package Manager
22

3-
This is the repository of the Fortran Package Manager (*fpm*). If you are
4-
looking for *fpm – packaging made simple* instead, see
5-
[jordansissel/fpm](https://github.com/jordansissel/fpm).
6-
7-
Fortran Package Manager is an early prototype. You can use it to build and
8-
package your Fortran projects, as well as to include supported Fortran
9-
dependency projects. As a prototype, changes to *fpm*’s behavior and inputs may
10-
occur as development continues. Please follow the
11-
[issues](https://github.com/fortran-lang/fpm/issues) to contribute and/or stay
12-
up to date with the development. As the prototype matures and we enter
13-
production, we will do our best to stay backwards compatible.
14-
15-
To report a bug report or suggest a feature, please read our
16-
[contributor guidelines](CONTRIBUTING.md).
3+
Fortran Package Manager (fpm) is a package manager and build system for Fortran.
4+
Its key goal is to improve the user experience of Fortran programmers.
5+
It does so by making it easier to build your Fortran program or library, run the
6+
executables, tests, and examples, and distribute it as a dependency to other
7+
Fortran projects.
8+
Fpm's user interface is modeled after [Rust's Cargo](https://crates.io/),
9+
so if you're familiar with that tool, you will feel at home with fpm.
10+
Fpm's long term vision is to nurture and grow the ecosystem of modern Fortran
11+
applications and libraries.
12+
13+
Fpm is an early prototype and is evolving rapidly.
14+
You can use it to build and package your Fortran projects, as well as to use
15+
existing fpm packages as dependencies.
16+
Fpm's behavior and user interface may change as it evolves, however as fpm
17+
matures and we enter production, we will aim to stay backwards compatible.
18+
Please follow the [issues](https://github.com/fortran-lang/fpm/issues) to
19+
contribute and/or stay up to date with the development.
20+
Before opening a bug report or a feature suggestion, please read our
21+
[Contributor Guide](CONTRIBUTING.md).
22+
23+
Fortran Package Manager is not to be confused with
24+
[Jordan Sissel's fpm](https://github.com/jordansissel/fpm), a more general,
25+
non-Fortran related package manager.
1726

1827
## Getting started
1928

ci/run_tests.bat

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ del /q /f build
3939
%fpm_path% build
4040
if errorlevel 1 exit 1
4141

42-
.\build\gfortran_debug\app\hello_world
42+
%fpm_path% run --target hello_world
4343
if errorlevel 1 exit 1
4444

4545
%fpm_path% run
@@ -53,7 +53,7 @@ del /q /f build
5353
%fpm_path% build
5454
if errorlevel 1 exit 1
5555

56-
.\build\gfortran_debug\app\hello_fpm
56+
%fpm_path% run --target hello_fpm
5757
if errorlevel 1 exit 1
5858

5959

@@ -83,16 +83,16 @@ if errorlevel 1 exit 1
8383
%fpm_path% test
8484
if errorlevel 1 exit 1
8585

86-
.\build\gfortran_debug\app\say_Hello
86+
%fpm_path% run --target say_Hello
8787
if errorlevel 1 exit 1
8888

89-
.\build\gfortran_debug\app\say_goodbye
89+
%fpm_path% run --target say_goodbye
9090
if errorlevel 1 exit 1
9191

92-
.\build\gfortran_debug\test\greet_test
92+
%fpm_path% test --target greet_test
9393
if errorlevel 1 exit 1
9494

95-
.\build\gfortran_debug\test\farewell_test
95+
%fpm_path% test --target farewell_test
9696
if errorlevel 1 exit 1
9797

9898

@@ -103,16 +103,16 @@ del /q /f build
103103
%fpm_path% build
104104
if errorlevel 1 exit 1
105105

106-
.\build\gfortran_debug\app\say_hello_world
106+
%fpm_path% run --target say_hello_world
107107
if errorlevel 1 exit 1
108108

109-
.\build\gfortran_debug\app\say_goodbye
109+
%fpm_path% run --target say_goodbye
110110
if errorlevel 1 exit 1
111111

112-
.\build\gfortran_debug\test\greet_test
112+
%fpm_path% test --target greet_test
113113
if errorlevel 1 exit 1
114114

115-
.\build\gfortran_debug\test\farewell_test
115+
%fpm_path% test --target farewell_test
116116

117117

118118
cd ..\with_examples
@@ -122,10 +122,10 @@ del /q /f build
122122
%fpm_path% build
123123
if errorlevel 1 exit 1
124124

125-
.\build\gfortran_debug\example\demo-prog
125+
%fpm_path% run --example --target demo-prog
126126
if errorlevel 1 exit 1
127127

128-
.\build\gfortran_debug\app\demo-prog
128+
%fpm_path% run --target demo-prog
129129
if errorlevel 1 exit 1
130130

131131

@@ -136,15 +136,15 @@ del /q /f build
136136
%fpm_path% build
137137
if errorlevel 1 exit 1
138138

139-
.\build\gfortran_debug\app\auto_discovery_off
139+
%fpm_path% run --target auto_discovery_off
140140
if errorlevel 1 exit 1
141141

142-
.\build\gfortran_debug\test\my_test
142+
%fpm_path% test --target my_test
143143
if errorlevel 1 exit 1
144144

145-
if exist .\build\gfortran_debug\app\unused exit /B 1
145+
if exist .\build\gfortran_*\app\unused exit /B 1
146146

147-
if exist .\build\gfortran_debug\test\unused_test exit /B 1
147+
if exist .\build\gfortran_*\test\unused_test exit /B 1
148148

149149

150150
cd ..\with_c
@@ -154,7 +154,7 @@ del /q /f build
154154
%fpm_path% build
155155
if errorlevel 1 exit 1
156156

157-
.\build\gfortran_debug\app\with_c
157+
%fpm_path% run --target with_c
158158
if errorlevel 1 exit 1
159159

160160

@@ -173,7 +173,7 @@ del /q /f build
173173
%fpm_path% build
174174
if errorlevel 1 exit 1
175175

176-
.\build\gfortran_debug\app\Program_with_module
176+
%fpm_path% run --target Program_with_module
177177
if errorlevel 1 exit 1
178178

179179

@@ -184,7 +184,31 @@ del /q /f build
184184
%fpm_path% build
185185
if errorlevel 1 exit 1
186186

187-
.\build\gfortran_debug\app\gomp_test
187+
%fpm_path% run --target gomp_test
188+
if errorlevel 1 exit 1
189+
190+
191+
cd ..\fortran_includes
192+
if errorlevel 1 exit 1
193+
194+
del /q /f build
195+
%fpm_path% build
196+
if errorlevel 1 exit 1
197+
198+
199+
cd ..\c_includes
200+
if errorlevel 1 exit 1
201+
202+
del /q /f build
203+
%fpm_path% build
204+
if errorlevel 1 exit 1
205+
206+
207+
cd ..\c_header_only
208+
if errorlevel 1 exit 1
209+
210+
del /q /f build
211+
%fpm_path% build
188212
if errorlevel 1 exit 1
189213

190214
cd ..\..

ci/run_tests.sh

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ rm -rf ./*/build
3030
cd hello_world
3131

3232
"${f_fpm_path}" build
33-
./build/gfortran_debug/app/hello_world
33+
"${f_fpm_path}" run --target hello_world
3434
"${f_fpm_path}" run
3535

3636
cd ../hello_fpm
3737
"${f_fpm_path}" build
38-
./build/gfortran_debug/app/hello_fpm
38+
"${f_fpm_path}" run --target hello_fpm
3939

4040
cd ../circular_test
4141
"${f_fpm_path}" build
@@ -46,48 +46,57 @@ cd ../circular_example
4646
cd ../hello_complex
4747
"${f_fpm_path}" build
4848
"${f_fpm_path}" test
49-
./build/gfortran_debug/app/say_Hello
50-
./build/gfortran_debug/app/say_goodbye
51-
./build/gfortran_debug/test/greet_test
52-
./build/gfortran_debug/test/farewell_test
49+
"${f_fpm_path}" run --target say_Hello
50+
"${f_fpm_path}" run --target say_goodbye
51+
"${f_fpm_path}" test --target greet_test
52+
"${f_fpm_path}" test --target farewell_test
5353

5454
cd ../hello_complex_2
5555
"${f_fpm_path}" build
56-
./build/gfortran_debug/app/say_hello_world
57-
./build/gfortran_debug/app/say_goodbye
58-
./build/gfortran_debug/test/greet_test
59-
./build/gfortran_debug/test/farewell_test
56+
"${f_fpm_path}" run --target say_hello_world
57+
"${f_fpm_path}" run --target say_goodbye
58+
"${f_fpm_path}" test --target greet_test
59+
"${f_fpm_path}" test --target farewell_test
6060

6161
cd ../with_examples
6262
"${f_fpm_path}" build
63-
./build/gfortran_debug/example/demo-prog
64-
./build/gfortran_debug/app/demo-prog
63+
"${f_fpm_path}" run --example --target demo-prog
64+
"${f_fpm_path}" run --target demo-prog
6565

6666
cd ../auto_discovery_off
6767
"${f_fpm_path}" build
68-
./build/gfortran_debug/app/auto_discovery_off
69-
./build/gfortran_debug/test/my_test
70-
test ! -x ./build/gfortran_debug/app/unused
71-
test ! -x ./build/gfortran_debug/test/unused_test
68+
"${f_fpm_path}" run --target auto_discovery_off
69+
"${f_fpm_path}" test --target my_test
70+
test ! -x ./build/gfortran_*/app/unused
71+
test ! -x ./build/gfortran_*/test/unused_test
7272

7373
cd ../with_c
7474
"${f_fpm_path}" build
75-
./build/gfortran_debug/app/with_c
75+
"${f_fpm_path}" run --target with_c
7676

7777
cd ../submodules
7878
"${f_fpm_path}" build
7979

8080
cd ../program_with_module
8181
"${f_fpm_path}" build
82-
./build/gfortran_debug/app/Program_with_module
82+
"${f_fpm_path}" run --target Program_with_module
8383

8484
cd ../link_external
8585
"${f_fpm_path}" build
86-
./build/gfortran_debug/app/link_external
86+
"${f_fpm_path}" run --target link_external
8787

8888
cd ../link_executable
8989
"${f_fpm_path}" build
90-
./build/gfortran_debug/app/gomp_test
90+
"${f_fpm_path}" run --target gomp_test
91+
92+
cd ../fortran_includes
93+
"${f_fpm_path}" build
94+
95+
cd ../c_includes
96+
"${f_fpm_path}" build
97+
98+
cd ../c_header_only
99+
"${f_fpm_path}" build
91100

92101
# Cleanup
93102
rm -rf ./*/build

example_packages/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ the features demonstrated in each package and which versions of fpm are supporte
77
| Name | Features | Bootstrap (Haskell) fpm | fpm |
88
|---------------------|---------------------------------------------------------------|:-----------------------:|:---:|
99
| auto_discovery_off | Default layout with auto-discovery disabled | N | Y |
10+
| c_header_only | C header-only library | N | Y |
11+
| c_includes | C library with c include directory and dependency includes | N | Y |
1012
| circular_example | Local path dependency; circular dependency | Y | Y |
1113
| circular_test | Local path dependency; circular dependency | Y | Y |
14+
| fortran_includes | Fortran library with explicit include directory | Y | N |
1215
| hello_complex | Non-standard directory layout; multiple tests and executables | Y | Y |
1316
| hello_complex_2 | Auto-discovery of tests and executables with modules | N | Y |
1417
| hello_fpm | App-only; local path dependency | Y | Y |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "c_header_only"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int printf ( const char * format, ... );
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*

example_packages/c_includes/fpm.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = "c_includes"
2+
3+
[dependencies]
4+
c_header_only = { path = "../c_header_only"}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Include from "c_header_only" dependency
2+
#include "c_header.h"
3+
4+
int test(const int a);

0 commit comments

Comments
 (0)