Project

General

Profile

fatal error: 'core/ppm_xfuncs.h' file not found

Added by ep gupal over 2 years ago

I am trying to build CDO and I am getting the following error

@...

./lib/yac/utils.h:73:10: fatal error: 'core/ppm_xfuncs.h' file not found
#include "core/ppm_xfuncs.h"
^~~~~~~~~~~~~~~~~
...@

I can not find where this ppm_xfuncs.h reside in. How do I fix this error?

The following is the configuration for the build.

@pkg_name="cdo"
pkg_ver="2.0.0"
install_dir="/home/orangke/tools/pkgs"
cc_dir="/home/orangke/tools/bin"
netcdf_dir="/home/orangke/tools/pkgs/netcdf-c-4.8.1"
udunits_dir="/home/orangke/tools/pkgs/udunits-2.2.28"

CC=${cc_dir}/clang CXX=${cc_dir}/clang++ \
CFLAGS=-march=znver2 CXXFLAGS=-march=znver2 \
./configure --prefix=${install_dir}/${pkg_name}-${pkg_ver} \
--with-netcdf=${netcdf_dir} \
--with-udunits2=${udunits_dir} @

Thanks.


Replies (12)

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by Ralf Mueller over 2 years ago

hi!

  • Why do you want to build CDO? if you are on linux, there is a good chance that there is a pre-build binary
  • for proper help, you need to upload the config.log file created by the configure call

the related code is

#ifdef CDO
#include <stdint.h> // uint64_t
#include <limits.h> // SIZE_MAX
#define UNUSED(x) (void)(x)
#define xmalloc(size) malloc(size)
#define xrealloc(ptr,size) realloc(ptr,size)
#define xcalloc(nmemb,size) calloc(nmemb,size)
#define XT_INT_MAX SIZE_MAX
typedef size_t yac_int;
#else
#include "core/ppm_xfuncs.h" 
#include "core/core.h" 
#endif

So you see to build yac in a way which was not intended by the CDO building system. Please, let me know what your are doing. what is your operating system?

cheers
ralf

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

I am using different compilers and different versions of required dependencies for the CDO. This is why I am trying to compile CDO from the source.

My operating system is Arch Linux with a kernel version of 5.15.2.

I am attaching the config.log.

Thank you.

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

Ralf Mueller wrote in RE: fatal error: 'core/ppm_xfuncs.h' file not found:

hi!

  • Why do you want to build CDO? if you are on linux, there is a good chance that there is a pre-build binary
  • for proper help, you need to upload the config.log file created by the configure call

the related code is[...]

So you see to build yac in a way which was not intended by the CDO building system. Please, let me know what your are doing. what is your operating system?

cheers
ralf

I can't quite understand what you said by "So you see to build yac in a way which was not intended by the CDO building system".

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by Ralf Mueller over 2 years ago

I meant seem instead of see, sry

Are you aware that there is an AUR package for cdo? so in case you just want CDO, I'd recommend to use this package https://aur.archlinux.org/packages/cdo

So how I see it, you experiment with a different compiler. in your uploaded config.log there is a `define` for CDO: https://code.mpimet.mpg.de/attachments/26500#L2344
Hence the initial compile error should not occur because the corresponding code is deactivated with CPP.

you could

  • check the content of ./src/config.h there should be line with define CDO 2.0.0
  • check the compile commands by using verbose output for make :
    make V=1
    or
    make VERBOSE=1
    (I never manage to keep in mind which is the right one ...)
  • X-check the configure/make build-routine with the system compiler and compare the config.h and compile commands

This is more Compiler/Compiler-installation lesson than a problem with CDO in my opinion. Basically you are debugging the compiler, for which CDO might no be the best tool.

cheers
ralf

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

Hmm. Are yac or yacc hard required dependencies for CDO to work? What I mean is could this be omitted during the configuration stage by something like --disable-yac ?

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by Ralf Mueller over 2 years ago

yac is a coupling/interpolation library for earth system science data/models. yacc is a parser generator for building compilers. CDO-2.0.0 depends on yac - no way to disable it in the 2.0.0 version.

Your compiling toolchain does something wrong, when it fails with CDO, but the system GCC can build CDO.

I still don't fully understand, what you want to do:
  • If the compiler does not work for CDO, may be CDO is to complicated for the compilers and you start with something different
  • Is Arch Linux a supported operating system of the AMD clang compiler? I doubt it - no vendor supports Arch Linux since it is a moving target. Keep in mind, that you might use the compiler in an environment, for which it was never tested.
  • If you want to test CDO with this compiler, I recommend to use a supported OS. Check the AMD site for more information
  • If you want to test AMD clang, start with a smaller codebase than CDO

LLVM comes with its own testing suite. There are tons of examples to go through for a compiler before you take a real world project like CDO or any other code with 100k+ lines of code

cheers
ralf

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

Okay. Yeah. I think I forgot to install yac and mention it to the configuration.

AMD clang worked fine for hdf5, openmpi, netcdf, udunits, and NCO. Though I needed to go through some hurdles in order to make it work. The reason why I want to build the CDO with AMD clang is because I would like to see if there is any tangible performance difference between GCC and AMD version of clang, since I am using AMD CPU.

I'll report back if the compilation of CDO works or not with the yac installed.

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by Ralf Mueller over 2 years ago

you don't need to install yac - all you need (apart from external dependencies) is already in the release tar ball. installing yac will not solve your problem since CDO does now take advantage of any external yac installation.

if you build fails, it does it for good reason. I think you have to analyze the situation on your system in more depth before taking further measures.

best wished
ralf

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

Ahh... okay. I got it. I'll perform the build process with your suggested method of adding verbose output.

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

I did some work on this matter, and this is what I found out.

  • With system compiler (gcc), I still get the same error of fatal error: 'core/ppm_xfuncs.h' file not found.
  • ./src/config.h for both AMD clang and gcc looks very similar (hardly no difference other than the compiler info).

So, I looked into yac library, and it seems like the directory hierarchy for the build process of yac does have a directory named 'core' and it has that ppm_xfuncs.h header file in it. I tried creating the core directory inside ./src/lib/yac and placed the ppm_xfuncs.h and I was able to move forward with the build process. Yet, it was asking for another required header files and other files in order to build the yac.

It seems that CDO does not ship with this header file nor it has required file in order to build yac. Is this intended?

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

Ahhhh. Disregard what I said above. I think I kinda know what the problem is.

RE: fatal error: 'core/ppm_xfuncs.h' file not found - Added by ep gupal over 2 years ago

I just commented out the part where it says ifdef CDO and else. It is a hacky solution but it worked, and the CDO is running fine.

//#ifdef CDO
#include <stdint.h> // uint64_t
#include <limits.h> // SIZE_MAX
#define UNUSED(x) (void)(x)
#define xmalloc(size) malloc(size)
#define xrealloc(ptr,size) realloc(ptr,size)
#define xcalloc(nmemb,size) calloc(nmemb,size)
#define XT_INT_MAX SIZE_MAX
typedef size_t yac_int;
//#else
//#include "core/ppm_xfuncs.h" 
//#include "core/core.h" 
//#endif
    (1-12/12)