ecmwf-ifs / loki

Freely programmable source-to-source translation for Fortran
https://sites.ecmwf.int/docs/loki/
Apache License 2.0
22 stars 11 forks source link

Fix gitless installation with CMake #304

Open reuterbal opened 2 months ago

reuterbal commented 2 months ago

PR #302 fixes the Loki installation from a non-VCS copy (e.g. tarball) with the install script or manual pip installs. However, in the CMake bundled installation, it fails when not performing an EDITABLE install. It's unclear why that is, but the following reproduces the problem on Atos HPCF:

module reset
module load cmake python3 ecbuild

git clone https://github.com/ecmwf-ifs/loki gitless_install
cd gitless_install
rm -rf .git
mkdir build
cd build
cmake ..
loki_env/bin/python -c "import loki; print(loki.__version__); print(loki.sourcefile.Sourcefile.from_source('subroutine my_routine\ninteger i\nend subroutine my_routine').to_fortran());"

The symptom is that the venv will only contain the Python files in the top level directoy and not the subdirectories...