Skip to content

Commit

Permalink
Merge branch 'main' into custom-path-to-config
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 committed Apr 27, 2024
2 parents bfd3917 + d3dd5d4 commit 8ddb50f
Show file tree
Hide file tree
Showing 54 changed files with 6,108 additions and 428 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
10 changes: 5 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
gcc_v: [10] # Version of GFortran we want to use.
gcc_v: [10,11,12,13] # Version of GFortran we want to use.
include:
- os: ubuntu-latest
os-arch: linux-x86_64
Expand All @@ -43,7 +43,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install GFortran macOS
if: contains(matrix.os, 'macos')
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

# Phase 1: Bootstrap fpm with existing version
- name: Install fpm
uses: fortran-lang/setup-fpm@v3
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.8.0'

Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
- build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
env:
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH && contains(github.ref, secrets.DEPLOY_BRANCH) && 1 || 0 }}

- uses: actions/checkout@v2
- uses: actions/checkout@v4
if: ${{ github.event_name == 'push' }}

- name: Download Artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ jobs:
mpi: openmpi
- os: ubuntu-latest
mpi: mpich
- os: windows-latest
mpi: msmpi
- os: macos-latest
mpi: openmpi
- os: macos-latest
Expand All @@ -45,7 +43,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: (Ubuntu) setup gcc version
if: contains(matrix.os,'ubuntu')
Expand All @@ -69,7 +67,6 @@ jobs:
wget
unzip
curl
gcc-fortran
- name: (Windows) Setup VS Build environment
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
Expand All @@ -87,7 +84,7 @@ jobs:
Remove-Item "oneAPI" -Force -Recurse
- name: (Ubuntu) Install gfortran
if: contains(matrix.os,'ubuntu') && (!contains(matrix.mpi,'intel'))
if: contains(matrix.os,'ubuntu')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
Expand All @@ -107,16 +104,14 @@ jobs:
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
timeout-minutes: 1
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: (Ubuntu) Install Intel oneAPI
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build
timeout-minutes: 15
run: sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2023.1.0 intel-oneapi-compiler-fortran-2023.1.0 intel-oneapi-mpi-devel ninja-build

- name: (Ubuntu) Setup Intel oneAPI environment
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
Expand Down Expand Up @@ -153,6 +148,7 @@ jobs:
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
run: |
echo "C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "/c/Program Files/Microsoft MPI/Bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: (Windows) load OneAPI environment variables
Expand Down Expand Up @@ -203,7 +199,7 @@ jobs:
# Phase 1: Bootstrap fpm with existing version
- name: Install fpm
uses: fortran-lang/setup-fpm@v3
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.8.0'

Expand All @@ -213,14 +209,6 @@ jobs:
mv $(which fpm) fpm-bootstrap${{ matrix.exe }}
echo "BOOTSTRAP=$PWD/fpm-bootstrap" >> $GITHUB_ENV
- name: Use Intel compiler for the metapackage tests
if: contains(matrix.mpi,'intel')
shell: bash
run: |
echo "FPM_FC=ifort" >> $GITHUB_ENV
echo "FPM_CC=icc" >> $GITHUB_ENV
echo "FPM_CXX=icpc" >> $GITHUB_ENV
- name: (macOS) Use gcc/g++ instead of Clang for C/C++
if: contains(matrix.os,'macOS')
shell: bash
Expand Down Expand Up @@ -304,6 +292,14 @@ jobs:
env:
EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }}

- name: Use Intel compiler for the metapackage tests
if: contains(matrix.mpi,'intel')
shell: bash
run: |
echo "FPM_FC=ifx" >> $GITHUB_ENV
echo "FPM_CC=icx" >> $GITHUB_ENV
echo "FPM_CXX=icpx" >> $GITHUB_ENV
- name: Run metapackage tests using the release version
shell: bash
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
FORMAT: ${{ matrix.format }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -67,7 +67,7 @@ jobs:
patch -p1 < ./ci/single-file.patch
- name: Install fpm
uses: fortran-lang/setup-fpm@v3
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.8.0'

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
env:
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH && contains(github.ref, secrets.DEPLOY_BRANCH) && 1 || 0 }}

- uses: actions/checkout@v2
- uses: actions/checkout@v4
if: ${{ github.event_name == 'push' }}

- name: Download Artifacts
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ non-Fortran related package manager.

**Website: <https://fpm.fortran-lang.org/>**

## [Download](https://fpm.fortran-lang.org/en/install/index.html)
## [Download](https://fpm.fortran-lang.org/install/index.html)

Fpm is available on many platforms and through multiple package managers, see our Documentation
webpage for a list of **[All Supported Installations](https://fpm.fortran-lang.org/en/install/index.html)**.
webpage for a list of **[All Supported Installations](https://fpm.fortran-lang.org/install/index.html)**.

The easiest installation routes are shown below.

Expand Down Expand Up @@ -86,9 +86,9 @@ Binary distributions are available for MacOS 11 (Catalina) and 12 (Big Sur) for
Fpm should be available and functional after those steps.
For more details checkout the tap [here](https://github.com/fortran-lang/homebrew-fortran).

## [Get started](https://fpm.fortran-lang.org/en/tutorial/index.html)
## [Get started](https://fpm.fortran-lang.org/tutorial/index.html)

**Follow our [Quickstart Tutorial](https://fpm.fortran-lang.org/en/tutorial/hello-fpm.html) to get familiar with fpm**.
**Follow our [Quickstart Tutorial](https://fpm.fortran-lang.org/tutorial/hello-fpm.html) to get familiar with fpm**.

### Start a new project

Expand Down Expand Up @@ -118,7 +118,7 @@ arguments can also be passed to the executable(s) or test(s) with the option
`-- some arguments`.

See additional instructions in the [Packaging guide](PACKAGING.md) or
the [manifest reference](https://fpm.fortran-lang.org/en/spec/manifest.html).
the [manifest reference](https://fpm.fortran-lang.org/spec/manifest.html).

<!--
### Bootstrapping instructions
Expand Down
4 changes: 4 additions & 0 deletions app/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ program main
fpm_cmd_settings, &
fpm_new_settings, &
fpm_build_settings, &
fpm_export_settings, &
fpm_run_settings, &
fpm_test_settings, &
fpm_install_settings, &
Expand All @@ -15,6 +16,7 @@ program main
use fpm_filesystem, only: exists, parent_dir, join_path
use fpm, only: cmd_build, cmd_run, cmd_clean
use fpm_cmd_install, only: cmd_install
use fpm_cmd_export, only: cmd_export
use fpm_cmd_new, only: cmd_new
use fpm_cmd_update, only : cmd_update
use fpm_cmd_publish, only: cmd_publish
Expand Down Expand Up @@ -76,6 +78,8 @@ program main
call cmd_run(settings,test=.false.)
type is (fpm_test_settings)
call cmd_run(settings,test=.true.)
type is (fpm_export_settings)
call cmd_export(settings)
type is (fpm_install_settings)
call cmd_install(settings)
type is (fpm_update_settings)
Expand Down
8 changes: 8 additions & 0 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ pushd preprocess_cpp_deps
"$fpm" build
popd

pushd preprocess_cpp_suffix
"$fpm" run
popd

pushd preprocess_per_dependency
"$fpm" run
popd

pushd preprocess_hello
"$fpm" build
popd
Expand Down
1 change: 1 addition & 0 deletions example_packages/preprocess_cpp_suffix/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
8 changes: 8 additions & 0 deletions example_packages/preprocess_cpp_suffix/app/main.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
program test_preprocess_suffix
use preprocess_cpp
#ifndef TESTMACRO
stop -1
#else
stop 0
#endif
end program test_preprocess_suffix
7 changes: 7 additions & 0 deletions example_packages/preprocess_cpp_suffix/fpm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name = "preprocess_cpp_suffix"
version = "1"

[preprocess]
[preprocess.cpp]
macros = ["TESTMACRO", "TESTMACRO2=3", "TESTMACRO3={version}"]
suffixes = ["fpp"]
22 changes: 22 additions & 0 deletions example_packages/preprocess_cpp_suffix/src/preprocess_cpp.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module preprocess_cpp
implicit none
private

public :: say_hello
contains
subroutine say_hello
print *, "Hello, preprocess_cpp!"
#ifndef TESTMACRO
This breaks the build.
#endif

#if TESTMACRO2 != 3
This breaks the build.
#endif

#if TESTMACRO3 != 1
This breaks the build.
#endif

end subroutine say_hello
end module preprocess_cpp
8 changes: 8 additions & 0 deletions example_packages/preprocess_per_dependency/app/main.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
program hello_fpm
use utils, only: say_hello
integer :: ierr

call say_hello(ierr)
stop ierr ! ierr==0 if DEPENDENCY_MACRO is defined

end program hello_fpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name = "utils"

[preprocess]
[preprocess.cpp]
macros = ["X=1"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module utils

implicit none

contains

subroutine say_hello(ierr)
integer, intent(out) :: ierr

ierr = -1
#ifdef DEPENDENCY_MACRO
ierr = 0
#endif

print *, "Dependency macro ", merge(" IS","NOT",ierr==0)," defined"

end subroutine say_hello

end module utils
4 changes: 4 additions & 0 deletions example_packages/preprocess_per_dependency/fpm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "preprocess_cpp_deps"

[dependencies]
utils = { path = "crate/utils" , preprocess.cpp.macros=["DEPENDENCY_MACRO"] }
6 changes: 4 additions & 2 deletions fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "fpm"
version = "0.9.0"
version = "0.10.1"
license = "MIT"
author = "fpm maintainers"
maintainer = ""
Expand All @@ -17,7 +17,9 @@ M_CLI2.rev = "7264878cdb1baff7323cc48596d829ccfe7751b8"
fortran-regex.git = "https://github.com/perazz/fortran-regex"
fortran-regex.tag = "1.1.2"
jonquil.git = "https://github.com/toml-f/jonquil"
jonquil.rev = "4c27c8c1e411fa8790dffcf8c3fa7a27b6322273"
jonquil.rev = "4fbd4cf34d577c0fd25e32667ee9e41bf231ece8"
fortran-shlex.git = "https://github.com/perazz/fortran-shlex"
fortran-shlex.tag = "1.0.1"

[[test]]
name = "cli-test"
Expand Down
Empty file modified install.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion manifest-reference.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 301 - Moved

This document now lives at https://fpm.fortran-lang.org/en/spec/manifest.html.
This document now lives at https://fpm.fortran-lang.org/spec/manifest.html
2 changes: 1 addition & 1 deletion src/filesystem_utilities.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <sys/stat.h>
#include <dirent.h>

#if defined(__APPLE__) && !defined(__aarch64__) && !defined(__POWERPC__)
#if defined(__APPLE__) && !defined(__aarch64__) && !defined(__ppc__) && !defined(__i386__)
DIR * opendir$INODE64( const char * dirName );
struct dirent * readdir$INODE64( DIR * dir );
#define opendir opendir$INODE64
Expand Down
Loading

0 comments on commit 8ddb50f

Please sign in to comment.