hdf5-cffi in quicklisp
I installed the hdf5-cffi using roswell as per the instructions. But hdf5-cffi compile process cannot find the location of hdf5.h and gives the following error,
Installing from github HDFGroup/hdf5-cffi
To load "hdf5-cffi":
Load 1 ASDF system:
hdf5-cffi
; Loading "hdf5-cffi"
; pkg-config hdf5 --cflags
; ERROR: Subprocess #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {10026BFED3}>
with command ("pkg-config" "hdf5" "--cflags")
exited with error code 1
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5' found
; Attempting to continue anyway.
[1/3] System 'hdf5-cffi' found. Loading the system..; gcc -o /Users/mohanamuraly/.cache/common-lisp/sbcl-1.5.4-macosx-x64/Users/mohanamuraly/.roswell/local-projects/HDFGroup/hdf5-cffi/src/h5-grovel__grovel-tmp5GEXGEG5.o -c -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3 -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.6 -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer -fPIC -I/Users/mohanamuraly/.roswell/lisp/quicklisp/dists/quicklisp/software/cffi_0.20.1/ /Users/mohanamuraly/.cache/common-lisp/sbcl-1.5.4-macosx-x64/Users/mohanamuraly/.roswell/local-projects/HDFGroup/hdf5-cffi/src/h5-grovel__grovel.c
/Users/mohanamuraly/.cache/common-lisp/sbcl-1.5.4-macosx-x64/Users/mohanamuraly/.roswell/local-projects/HDFGroup/hdf5-cffi/src/h5-grovel__grovel.c:7:10: fatal error:
'hdf5.h' file not found
#include <hdf5.h>
^~~~~~~~
1 error generated.
I installed hdf5 not using homebrew since I have multiple hdf5 builds that I want to maintain. But HDF5 is on the LD/DYLD_LIBRARY_PATH and C_INCLUDE_PATH.
Can you show the actual value of C_INCLUDE_PATH? Note that (as far as I remember) hdf5.h is in serial/ directory of hdf5 and just adding the root of hdf5 dir is not enough. That is why hdf5-cffi uses pkg-config to find the right path. Please also be specific about which HDF5 version you are using -- prebuilt binary from https://www.hdfgroup.org/downloads/hdf5/ or the source code release?
Minor note, you have installed hdf5-cffi from github, not from quicklisp. Since now it is in quicklisp, you don't need HDFGroup/ in ros install HDFGroup/hdf5-cffi.
The HDF5 version is 1.8.21 installed from source without MPI (serial version) on gcc-8.3. The C_INCLUDE_PATH points to the include folder of the HDF5 installation (/opt/hdf5/1.8.21/include). How do I specify this --cflags in the ("pkg-config" "hdf5" "--cflags")?
Note that I managed to get this compiled by wrapping my gcc as h5cc. But I am having difficulty in manually specifying the location using this --cflags.
--cflags is an option that tells pkg-config to emit options for a C compiler. It might seem like missing the required argument after --cflags, but it is not. That is the right arguments.
I advice you to configure PKG_CONFIG_PATH to include hdf5.pc in your installation.
HDF5 does not provide PKG_CONFIG files by itself. Do you mean I must make my own hdf5.pc?
If one has to manually specify, then HDF5-cffi should provide an example hdf5.pc for the user and add that to the installation instructions. This is non-trivial to understand! I found one here
https://github.com/mokus0/bindings-hdf5/blob/master/doc/hdf5.pc