Open
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ project: Fortran-lang/stdlib
summary: A community driven standard library for (modern) Fortran
src_dir: src
include: src
include
exclude_dir: src/tests
output_dir: API-doc
page_dir: doc
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ list(
"-DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}"
"-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}"
"-DPROJECT_VERSION_=${PROJECT_VERSION_}"
"-I${PROJECT_SOURCE_DIR}/include"
)

add_subdirectory(src)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,21 @@ To use `stdlib` within your `fpm` project, add the following lines to your `fpm.
stdlib = { git="https://.com/fortran-lang/stdlib", branch="stdlib-fpm" }
```

### Build with [fypp-script](https://.com/fortran-lang/fpm/pull/729)

Fortran Package Manager has a compiler wrapper `fypp-script` that can be used to compile stdlib without
switching to `stdlib-fpm` branch.

```sh
git clone https://.com/fortran-lang/fpm.git
```
Comment on lines +207 to +209
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that provided? IMO a link to fpm should be sufficient.


```
fpm run -- build --compiler "$PWD/fypp-gfortran.py" -C stdlib
```

**Note** : At this stage, building using `stdlib-fpm` branch should be the preferred way of using `stdlib` with `fpm`.

## Using stdlib in your project

The stdlib project exports CMake package files and pkg-config files to make stdlib usable for other projects.
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,17 +27,14 @@ include=(

# Files to remove from collection
prune=(
"$destdir/test/test_always_fail.f90"
"$destdir/test/test_always_skip.f90"
"$destdir/test/test_hash_functions.f90"
"$destdir/src/common.f90"
"$destdir/src/f18estop.f90"
)

major=$(cut -d. -f1 VERSION)
minor=$(cut -d. -f2 VERSION)
=$(cut -d. -f3 VERSION)
fyflags="${fyflags} -DPROJECT_VERSION_MAJOR=${major} -DPROJECT_VERSION_MINOR=${minor} -DPROJECT_VERSION_=${}"
fyflags="${fyflags} -DPROJECT_VERSION_MAJOR=${major} -DPROJECT_VERSION_MINOR=${minor} -DPROJECT_VERSION_=${} -I include"

mkdir -p "$destdir/src" "$destdir/test" "$destdir/example"

Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
name = "stdlib"

[dev-dependencies]
test-drive.git = "https://.com/fortran-lang/test-drive.git"

[build]
auto-examples = false
auto-tests = true

[preprocess.cpp]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be

Suggested change
[preprocess.cpp]
[preprocess.fypp]

?
As far as I remember, CPP is not used within stdlib.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is not used. But, we have not enabled fypp inside fpm as of now. So, it cannot identity it as a valid preprocessor. Considering fypp-gfortran.py as a temporary solution, I think when we have fypp integrated inside fpm then I think we should rename it as fypp instead of cpp.

macros = [
"PROJECT_VERSION_MAJOR=0",
"PROJECT_VERSION_MINOR=1",
"PROJECT_VERSION_=0",
Comment on lines +12 to +14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support extracting those values automatically in fpm?

Copy link
Member Author

@arteevraina arteevraina Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should add support to extract them for the version number ?
I will take up this task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR created for this fortran-lang/fpm#766

"MAXRANK=4",
]
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
submodule (stdlib_error) estop
submodule (stdlib_error) f18estop

implicit none

Expand DownExpand Up@@ -26,4 +26,4 @@
endif
end procedure

end submodule estop
end submodule f18estop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,11 +10,6 @@ macro(ADDTEST name)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endmacro(ADDTEST)

list(
APPEND fyppFlags
"-I${PROJECT_SOURCE_DIR}/src"
)

add_subdirectory(array)
add_subdirectory(ascii)
add_subdirectory(bitsets)
Expand All@@ -34,8 +29,3 @@ add_subdirectory(system)
add_subdirectory(quadrature)
add_subdirectory(math)
add_subdirectory(stringlist)

ADDTEST(always_skip)
set_tests_properties(always_skip PROPERTIES SKIP_RETURN_CODE 77)
ADDTEST(always_fail)
set_tests_properties(always_fail PROPERTIES WILL_FAIL true)
Loading