Skip to content

Intel fix #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
657b312
added interfaces and necessary build stuff
wassup05 Jun 7, 2025
f41dee4
implemented interfaces
wassup05 Jun 7, 2025
572ad46
example
wassup05 Jun 7, 2025
8a10f26
tests added
wassup05 Jun 7, 2025
1bd58b7
added specs
wassup05 Jun 7, 2025
ea71960
an edge case handled
wassup05 Jun 8, 2025
c561108
separated examples according to OS and functions
wassup05 Jun 12, 2025
272eb67
further split examples and fix some autodoc links issues due to wrong…
jalvesz Jun 15, 2025
5147094
misslocation of source file
jalvesz Jun 15, 2025
9e64094
fix example program names
jalvesz Jun 15, 2025
ca867f8
fix example_path_join.f90
wassup05 Jun 15, 2025
62bef00
Consistent naming
wassup05 Jun 19, 2025
1c87df9
windows test case for path with spaces
wassup05 Jun 21, 2025
45824b5
remove pre-processor parameters
wassup05 Jun 21, 2025
3501bc9
Merge branch 'master' of github.com:wassup05/stdlib into path
wassup05 Jul 6, 2025
e7a3a1f
added functions
wassup05 Jul 12, 2025
e182803
added tests
wassup05 Jul 12, 2025
5197a0c
update test
wassup05 Jul 12, 2025
ee40f44
typos and grammar
wassup05 Jul 13, 2025
e6add70
added new procedures to the interfaces
wassup05 Jul 14, 2025
616040d
implemented the new procedures
wassup05 Jul 14, 2025
812b5ed
modified the docs to add `type(string_type)` arguments
wassup05 Jul 14, 2025
a21a48b
`assignment(=)` => `move`
wassup05 Jul 16, 2025
2c47354
snake case names
wassup05 Jul 16, 2025
a932653
intel compiler hack
wassup05 Jul 17, 2025
96eed56
added specs
wassup05 Jul 18, 2025
4d1e6d0
added example
wassup05 Jul 18, 2025
03c76c9
capitalize functions + some doc changes
wassup05 Jul 20, 2025
a0d9e22
`stdlib_system`: essential path functionality (#999)
perazz Jul 22, 2025
873bb75
Merge branch 'master' into fs_error
perazz Jul 22, 2025
a2fadac
filesystem: `FS_ERROR` helper functions (#1015)
perazz Jul 22, 2025
05d99ae
Simple test for the failing CI.
loiseaujc Jul 22, 2025
5f95c5a
Merge pull request #4 from loiseaujc/master
loiseaujc Jul 22, 2025
1f9192d
Updated test name.
loiseaujc Jul 22, 2025
b014103
Turned back ci_BLAS.yml to its original.
loiseaujc Jul 22, 2025
8e2ff05
Nullify pointer in spmv
loiseaujc Jul 22, 2025
8b8de3a
Remove all the spmv tests.
loiseaujc Jul 22, 2025
6a53d13
Removed all the lines of code from test_tridiag_spmv
loiseaujc Jul 22, 2025
2c78e23
Add the matrices allocations back in test_tridiag_spmv
loiseaujc Jul 22, 2025
74988b3
Commented out the dense(tridiag)
loiseaujc Jul 22, 2025
d52141b
Incrementally add back allocations
loiseaujc Jul 23, 2025
ec88d61
Added real allocations back
loiseaujc Jul 23, 2025
60e6ad2
Added real tridiag allocation back
loiseaujc Jul 23, 2025
9ee5b13
Turned complex allocations back on.
loiseaujc Jul 23, 2025
7a7b1dd
Turned off complex random numbers.
loiseaujc Jul 23, 2025
7c01938
Turned back on allocation of main diagonal.
loiseaujc Jul 23, 2025
8ccbc94
Change syntax for creation of complex array.
loiseaujc Jul 23, 2025
8ffd6fe
Turned back on all complex allocations.
loiseaujc Jul 23, 2025
1ea3417
Turned on tridiag matrix allocation back on.
loiseaujc Jul 23, 2025
17cb20e
Turned back on tridiag_spmv test
loiseaujc Jul 23, 2025
4d17446
Turned back on tridiag_arithmetic test.
loiseaujc Jul 23, 2025
f85fc80
Turned back on error handling for tridiag matrices.
loiseaujc Jul 23, 2025
6dca2e6
Turned back on symtridiag arithmetic.
loiseaujc Jul 23, 2025
e5a457b
Turned back on symtridiag_spmv test.
loiseaujc Jul 23, 2025
6d9a041
Turned back on hermtridiag arithmetic test.
loiseaujc Jul 23, 2025
7927659
Turned back on hermtridiag_spmv test
loiseaujc Jul 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 262 additions & 11 deletions doc/specs/stdlib_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ The result is a real value representing the elapsed time in seconds, measured fr

### Syntax

`delta_t = ` [[stdlib_system(module):elapsed(subroutine)]] `(process)`
`delta_t = ` [[stdlib_system(module):elapsed(interface)]] `(process)`

### Arguments

Expand Down Expand Up @@ -212,7 +212,7 @@ in case of process hang or delay.

### Syntax

`call ` [[stdlib_system(module):wait(subroutine)]] `(process [, max_wait_time])`
`call ` [[stdlib_system(module):wait(interface)]] `(process [, max_wait_time])`

### Arguments

Expand Down Expand Up @@ -243,7 +243,7 @@ This is especially useful for monitoring asynchronous processes and retrieving t

### Syntax

`call ` [[stdlib_system(module):update(subroutine)]] `(process)`
`call ` [[stdlib_system(module):update(interface)]] `(process)`

### Arguments

Expand All @@ -269,7 +269,7 @@ This interface is useful when a process needs to be forcefully stopped, for exam

### Syntax

`call ` [[stdlib_system(module):kill(subroutine)]] `(process, success)`
`call ` [[stdlib_system(module):kill(interface)]] `(process, success)`

### Arguments

Expand Down Expand Up @@ -298,7 +298,7 @@ It ensures that the requested sleep duration is honored on both Windows and Unix

### Syntax

`call ` [[stdlib_system(module):sleep(subroutine)]] `(millisec)`
`call ` [[stdlib_system(module):sleep(interface)]] `(millisec)`

### Arguments

Expand All @@ -324,7 +324,7 @@ This function is highly efficient and works during the compilation phase, avoidi

### Syntax

`result = ` [[stdlib_system(module):is_windows(function)]] `()`
`result = ` [[stdlib_system(module):is_windows(interface)]] `()`

### Return Value

Expand Down Expand Up @@ -359,7 +359,7 @@ If the OS cannot be identified, the function returns `OS_UNKNOWN`.

### Syntax

`os = [[stdlib_system(module):get_runtime_os(function)]]()`
`os = ` [[stdlib_system(module):get_runtime_os(function)]] `()`

### Class

Expand Down Expand Up @@ -396,7 +396,7 @@ This caching mechanism ensures negligible overhead for repeated calls, unlike `g

### Syntax

`os = [[stdlib_system(module):OS_TYPE(function)]]()`
`os = ` [[stdlib_system(module):OS_TYPE(function)]]`()`

### Class

Expand All @@ -418,6 +418,85 @@ Returns one of the `integer` `OS_*` parameters representing the OS type, from th

---

## `FS_ERROR` - Helper function for error handling

### Status

Experimental

### Description

A helper function for returning the `type(state_type)` with the flag `STDLIB_FS_ERROR` set.

### Syntax

`err = FS_ERROR([a1,a2,a3,a4...... a20])`

### Class
Pure Function

### Arguments

`a1,a2,a3.....a20`(optional): They are of type `class(*), dimension(..), optional, intent(in)`.
An arbitrary list of `integer`, `real`, `complex`, `character` or `string_type` variables. Numeric variables may be provided as either scalars or rank-1 (array) inputs.

### Behavior

Formats all the arguments into a nice error message, utilizing the constructor of [[stdlib_system(module):state_type(type)]]

### Return values

`type(state_type)`

### Example

```fortran
{!example/system/example_fs_error.f90!}
```

---

## `FS_ERROR_CODE` - Helper function for error handling (with error code)

### Status

Experimental

### Description

A helper function for returning the `type(state_type)` with the flag `STDLIB_FS_ERROR` set.
It also formats and prefixes the `code` passed to it as the first argument.

### Syntax

`err = FS_ERROR_CODE(code [, a1,a2,a3,a4...... a19])`

### Class
Pure Function

### Arguments

`code`: An `integer` code.

`a1,a2,a3.....a19`(optional): They are of type `class(*), dimension(..), optional, intent(in)`.
An arbitrary list of `integer`, `real`, `complex`, `character` or `string_type` variables. Numeric variables may be provided as either scalars or rank-1 (array) inputs.

### Behavior

Formats all the arguments into a nice error message, utilizing the constructor of [[stdlib_system(module):state_type(type)]]

### Return values

`type(state_type)`

### Example

```fortran
{!example/system/example_fs_error.f90!}
```

---

## `is_directory` - Test if a path is a directory

### Status
Expand All @@ -431,7 +510,7 @@ It is designed to work across multiple platforms. On Windows, paths with both fo

### Syntax

`result = [[stdlib_system(module):is_directory(function)]] (path)`
`result = ` [[stdlib_system(module):is_directory(function)]]`(path)`

### Class

Expand Down Expand Up @@ -471,7 +550,7 @@ It reads as an empty file. The null device's path varies by operating system:

### Syntax

`path = [[stdlib_system(module):null_device(function)]]()`
`path = ` [[stdlib_system(module):null_device(function)]]`()`

### Class

Expand Down Expand Up @@ -506,7 +585,7 @@ The function provides an optional error-handling mechanism via the `state_type`

### Syntax

`call [[stdlib_system(module):delete_file(subroutine)]] (path [, err])`
`call ` [[stdlib_system(module):delete_file(subroutine)]]` (path [, err])`

### Class
Subroutine
Expand All @@ -532,3 +611,175 @@ The file is removed from the filesystem if the operation is successful. If the o
```fortran
{!example/system/example_delete_file.f90!}
```

## `join_path` - Joins the provided paths according to the OS

### Status

Experimental

### Description

This interface joins the paths provided to it according to the platform specific path-separator.
i.e `\` for windows and `/` for others

### Syntax

`res = ` [[stdlib_system(module):join_path(interface)]] ` (p1, p2)`

`res = ` [[stdlib_system(module):join_path(interface)]] ` (p)`

### Class
Pure function

### Arguments

`p1, p2`: Shall be a character string or `type(string_type)`. It is an `intent(in)` argument.
or
`p`: Shall be a list of character strings or list of `type(string_type)`. It is an `intent(in)` argument.

### Return values

The resultant path, either a character string or `type(string_type)`.

## `operator(/)`

Alternative syntax to`join_path` using an overloaded operator. Join two paths according to the platform specific path-separator.

### Status

Experimental

### Syntax

`p = lval / rval`

### Class

Pure function.

### Arguments

`lval`: A character string or `type(string_type)`. It is an `intent(in)` argument.

`rval`: A character string or `type(string_type)`. It is an `intent(in)` argument.

### Result value

The result is an `allocatable` character string or `type(string_type)`

#### Example

```fortran
{!example/system/example_path_join.f90!}
```

## `split_path` - splits a path immediately following the last separator

### Status

Experimental

### Description

This subroutine splits a path immediately following the last separator after removing the trailing separators
splitting it into most of the times a directory and a file name.

### Syntax

`call `[[stdlib_system(module):split_path(interface)]]`(p, head, tail)`

### Class
Subroutine

### Arguments

`p`: A character string or `type(string_type)` containing the path to be split. It is an `intent(in)` argument.
`head`: The first part of the path. Either a character string or `type(string_type)`. It is an `intent(out)` argument.
`tail`: The rest part of the path. Either a character string or `type(string_type)`. It is an `intent(out)` argument.

### Behavior

- If `p` is empty, `head` is set to `.` and `tail` is left empty.
- If `p` consists entirely of path-separators, `head` is set to the path-separator and `tail` is left empty.
- `head` ends with a path-separator if and only if `p` appears to be a root directory or child of one.

### Return values

The splitted path. `head` and `tail`.

### Example

```fortran
{!example/system/example_path_split_path.f90!}
```

## `base_name` - The last part of a path

### Status

Experimental

### Description

This function returns the last part of a path after removing trailing path separators.

### Syntax

`res = ` [[stdlib_system(module):base_name(interface)]]`(p)`

### Class
Function

### Arguments

`p`: the path, a character string or `type(string_type)`. It is an `intent(in)` argument.

### Behavior

- The `tail` of `[[stdlib_system(module):split_path(interface)]]` is exactly what is returned. Same Behavior.

### Return values

A character string or `type(string_type)`.

### Example

```fortran
{!example/system/example_path_base_name.f90!}
```

## `dir_name` - Everything except the last part of the path

### Status

Experimental

### Description

This function returns everything except the last part of a path.

### Syntax

`res = ` [[stdlib_system(module):dir_name(interface)]]`(p)`

### Class
Function

### Arguments

`p`: the path, a character string or `type(string_type)`. It is an `intent(in)` argument.

### Behavior

- The `head` of `[[stdlib_system(module):split_path(interface)]]` is exactly what is returned. Same Behavior.

### Return values

A character string or `type(string_type)`.

### Example

```fortran
{!example/system/example_path_dir_name.f90!}
```
6 changes: 6 additions & 0 deletions example/system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ ADD_EXAMPLE(process_5)
ADD_EXAMPLE(process_6)
ADD_EXAMPLE(process_7)
ADD_EXAMPLE(sleep)
ADD_EXAMPLE(fs_error)
ADD_EXAMPLE(path_join)
ADD_EXAMPLE(path_split_path)
ADD_EXAMPLE(path_base_name)
ADD_EXAMPLE(path_dir_name)

23 changes: 23 additions & 0 deletions example/system/example_fs_error.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
! Demonstrate usage of `FS_ERROR`, `FS_ERROR_CODE`
program example_fs_error
use stdlib_system, only: FS_ERROR, FS_ERROR_CODE
use stdlib_error, only: state_type, STDLIB_FS_ERROR
implicit none

type(state_type) :: err0, err1

err0 = FS_ERROR("Could not create directory", "`temp.dir`", "- Already exists")

if (err0%state == STDLIB_FS_ERROR) then
! Error encountered: Filesystem Error: Could not create directory `temp.dir` - Already exists
print *, err0%print()
end if

err1 = FS_ERROR_CODE(1, "Could not create directory", "`temp.dir`", "- Already exists")

if (err1%state == STDLIB_FS_ERROR) then
! Error encountered: Filesystem Error: code - 1, Could not create directory `temp.dir` - Already exists
print *, err1%print()
end if

end program example_fs_error
Loading
Loading