Cgnslib.h not found

Hi,
When I want to install cgns, I get an error which says cgnslib.h is not found. I think that should be fetched by pip since I am installing cgns. Isn’t that?

$ python3.6 -m pip install cgns

Collecting cgns
Using cached CGNS-2009.10.30.tar.gz
Building wheels for collected packages: cgns
Running setup.py bdist_wheel for cgns ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_28r5tm7/cgns/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp4vfl_nbopip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/CGNS
copying src/CGNS.py -> build/lib.linux-x86_64-3.6/CGNS
copying src/__init__.py -> build/lib.linux-x86_64-3.6/CGNS
running build_ext
building '_CGNS' extension
swigging src/cgnslib.i to src/cgnslib_wrap.c
swig -python -I/usr/include -o src/cgnslib_wrap.c src/cgnslib.i
src/cgnslib.i:38: Error: Unable to find 'cgnslib.h'
error: command 'swig' failed with exit status 1

Hi Mahmood,

Sorry, I have posted my reply to the wrong thread.

I would recommend to build and install from the source using cmake:
http://cgns.sourceforge.net/download.html

Then, export LD_LIBRARY_PATH=the path to libcgns.so.

It is also important to appropriately link HDF5 library in libcgns.so, which is discussed in the following thread:
https://groups.google.com/d/msg/pyfrmailinglist/qp5r3nlsONQ/4YzHuyGwEQAJ

Regarding the setup.py issue, adding “install” should work:
$ python3 setup.py install

Best regards,
Yoshiaki

It is also important to appropriately link HDF5 library in libcgns.so, which is discussed in the following thread:
https://groups.google.com/d/msg/pyfrmailinglist/qp5r3nlsONQ/4YzHuyGwEQAJ

After all, is it mandatory to install cgns?

Regards,
Mahmood

It is not mandatory to install cgns if you can use gmsh (.msh) format.

Regards,
Yoshiaki

In future versions of PyFR it is planned that the CGNS importer will no longer be supported