mbkumar / f90wrap_cmake_demo

Demo project to showcase integration of pip, CMake and f90wrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo of pip, setuptools, CMake and f90wrap

Prerequisites

C and Fortran compilers. Tested with gcc suite. Some flags are specific to gcc suite.

Compilation of the code

pip install .

Note that there is a dot after install.

Testing the code

Unfortunately even though the code is correctly installed at the correct location, few issues are still pending.

import cylinder  # should work
import cylinder.cyl # will fail

Pending Issues

  1. One of the intermediate library is not seamlessly loaded with out user intervention. Add the directory of installation to $LD_LIBRARY_PATH. The directory of the installation can be found from
python -c "import cylinder; print(cylinder.__path__)"
  1. Slight modification of the f90wrap generated cyl.py is required. Open the cyl.py from the path identified in the previous step and change the line containing import _cyl to import cylinder._cyl as _cyl or from . import _cyl. Now both lines should work
import cylinder  # should work
import cylinder.cyl # should work

Additional Details

For additional details, refer to https://github.com/jameskermode/f90wrap/tree/master/examples/cylinder. Replace Example in https://github.com/jameskermode/f90wrap/blob/master/examples/cylinder/tests.py with cylinder.cyl.

About

Demo project to showcase integration of pip, CMake and f90wrap


Languages

Language:Fortran 66.3%Language:C++ 17.2%Language:CMake 16.3%Language:Python 0.2%