cgnslib.h not found

157 ogledov
Preskoči na prvo neprebrano sporočilo

Mahmood Naderan

neprebran,
21. mar. 2018, 15:35:1421. 3. 18
do PyFR Mailing List
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
 
  ----------------------------------------
  Failed building wheel for cgns
  Running setup.py clean for cgns
Failed to build cgns
Installing collected packages: cgns
  Running setup.py install 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'))" install --record /tmp/pip-n8fwlngl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    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
   
    ----------------------------------------
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'))" install --record /tmp/pip-n8fwlngl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-_28r5tm7/cgns/

Yoshiaki Abe

neprebran,
21. mar. 2018, 18:25:0221. 3. 18
do PyFR Mailing List
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

Mahmood Naderan

neprebran,
22. mar. 2018, 03:25:4122. 3. 18
do Yoshiaki Abe, pyfrmai...@googlegroups.com
>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

Yoshiaki Abe

neprebran,
22. mar. 2018, 03:54:1822. 3. 18
do PyFR Mailing List
It is not mandatory to install cgns if you can use gmsh (.msh) format.

Regards,
Yoshiaki
Odgovori vsem
Odgovori avtorju
Posreduj
0 novih sporočil