-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
155 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ on: | |
env: | ||
BUILD_DIR: _build | ||
INSTALL_DIR: _install | ||
EXPORT_BUILD_DIR: _build_export | ||
|
||
jobs: | ||
|
||
|
@@ -36,36 +35,39 @@ jobs: | |
echo "FC=ifx" >> ${GITHUB_ENV} | ||
echo "FPM_FC=ifx" >> ${GITHUB_ENV} | ||
- name: Setup CMake | ||
uses: jwlawson/[email protected] | ||
|
||
- name: Setup Ninja | ||
uses: ashutoshvarma/[email protected] | ||
- name: Setup build tools | ||
run: | | ||
pip install cmake fpm meson ninja | ||
- name: Build Fortuno | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
cmake -B ${BUILD_DIR} -G Ninja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} | ||
cmake --build ${BUILD_DIR} | ||
cmake --install ${BUILD_DIR} | ||
rm -rf ${BUILD_DIR} | ||
- name: Test CMake export | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${EXPORT_BUILD_DIR} -G Ninja test/export | ||
cmake --build ${EXPORT_BUILD_DIR} | ||
${EXPORT_BUILD_DIR}/testapp | ||
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${BUILD_DIR} -G Ninja test/export | ||
cmake --build ${BUILD_DIR} | ||
${BUILD_DIR}/testapp | ||
rm -rf ${BUILD_DIR} | ||
- name: Test PkgConfig export | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}" | ||
export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
export LD_LIBRARY_PATH="${PWD}/${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}" | ||
export PKG_CONFIG_PATH="${PWD}/${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
cflags="$(pkg-config --cflags fortuno)" | ||
lflags="$(pkg-config --libs fortuno)" | ||
ifx ${cflags} ${lflags} -o testapp test/export/app/testapp.f90 | ||
mkdir ${BUILD_DIR} | ||
pushd ${BUILD_DIR} | ||
ifx ${cflags} ${lflags} -o testapp ../test/export/app/testapp.f90 | ||
./testapp | ||
rm ./testapp | ||
popd | ||
rm -rf ${BUILD_DIR} | ||
- name: Setup fpm | ||
uses: fortran-lang/setup-fpm@v5 | ||
|
@@ -77,3 +79,33 @@ jobs: | |
source /opt/intel/oneapi/setvars.sh | ||
cd test/export | ||
fpm run testapp | ||
- name: Setup meson | ||
run: pip install meson | ||
|
||
- name: Test meson PkgConfig export | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
export PKG_CONFIG_PATH="${PWD}/${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
cd test/export | ||
meson setup -Dfortuno_subproject=false ${BUILD_DIR} | ||
ninja -C ${BUILD_DIR} | ||
${BUILD_DIR}/testapp | ||
rm -rf ./${BUILD_DIR} | ||
- name: Test meson subproject export | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
FORTUNO_DIR=${PWD} | ||
GIT_REV=$(git rev-parse HEAD) | ||
cd test/export | ||
mkdir subprojects | ||
echo -e "[wrap-git]\ndirectory=fortuno\n" > subprojects/fortuno.wrap | ||
echo -e "url=file://${FORTUNO_DIR}\nrevision=${GIT_REV}\n" >> subprojects/fortuno.wrap | ||
echo "== wrap ==" | ||
cat subprojects/fortuno.wrap | ||
echo "== end wrap ==" | ||
meson setup -Dfortuno_subproject=true ${BUILD_DIR} | ||
ninja -C ${BUILD_DIR} | ||
${BUILD_DIR}/testapp | ||
rm -rf subprojects ${BUILD_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 @@ | ||
example_mylib_lib = library( | ||
'mylib', | ||
sources: ['mylib.f90'], | ||
install: false | ||
) | ||
example_mylib_dep = declare_dependency( | ||
link_with: example_mylib_lib, | ||
) | ||
|
||
example_testapp_exe = executable( | ||
'testapp', | ||
sources: [ | ||
'fixtured_tests.f90', | ||
'simple_tests.f90', | ||
'testapp.f90', | ||
], | ||
dependencies: [example_mylib_dep, fortuno_dep], | ||
install: false, | ||
) |
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,31 @@ | ||
project( | ||
'fortuno', | ||
'fortran', | ||
version: '0.1.0', | ||
) | ||
|
||
sources = [] | ||
subdir('src') | ||
|
||
# Current Intel compiler crashes when building the library with optimization turned on. | ||
if meson.get_compiler('fortran').get_id() == 'intel-llvm' | ||
fortran_args = ['-O0'] | ||
else | ||
fortran_args = [] | ||
endif | ||
|
||
fortuno_lib = library( | ||
meson.project_name(), | ||
sources: sources, | ||
version: meson.project_version(), | ||
fortran_args: fortran_args | ||
) | ||
|
||
fortuno_dep = declare_dependency( | ||
link_with: fortuno_lib, | ||
) | ||
|
||
build_examples = get_option('build_examples') | ||
if build_examples | ||
subdir('example') | ||
endif |
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 @@ | ||
option('build_examples', type: 'boolean', value: false, description: 'Build examples') |
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,14 @@ | ||
sources += files( | ||
'argumentparser.f90', | ||
'basetypes.f90', | ||
'checkers.f90', | ||
'consolelogger.f90', | ||
'testcmdapp.f90', | ||
'testcontext.f90', | ||
'testdriver.f90', | ||
'testinfo.f90', | ||
'testlogger.f90', | ||
'utils.f90', | ||
'version.f90', | ||
) | ||
subdir('serial') |
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 @@ | ||
sources += files( | ||
'serialbasetypes.f90', | ||
'serialcase.f90', | ||
'serialcmdapp.f90', | ||
'serialconlogger.f90', | ||
'serialcontext.f90', | ||
'serialdriver.f90', | ||
'serialglobalctx.f90', | ||
'serialsuite.f90', | ||
) |
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,4 @@ | ||
sources += files( | ||
'fortuno.f90' | ||
) | ||
subdir('fortuno') |
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,3 @@ | ||
sources += files( | ||
'testapp.f90' | ||
) |
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,21 @@ | ||
project( | ||
'fortuno_test_export', | ||
'fortran', | ||
version: '0.0', | ||
) | ||
|
||
if get_option('fortuno_subproject') | ||
fortuno_subproject = subproject('fortuno') | ||
fortuno_dep = fortuno_subproject.get_variable('fortuno_dep') | ||
else | ||
fortuno_dep = dependency('fortuno') | ||
endif | ||
|
||
sources = [] | ||
subdir('app') | ||
|
||
testapp_exe = executable( | ||
'testapp', | ||
sources: sources, | ||
dependencies: [fortuno_dep], | ||
) |
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 @@ | ||
option( | ||
'fortuno_subproject', | ||
type: 'boolean', | ||
value: false, | ||
description: 'Obtain Fortuno from subproject not from external dependency' | ||
) |