Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output of source_flattener.py does not compile #14

Open
arahlin opened this issue Feb 24, 2022 · 0 comments
Open

Output of source_flattener.py does not compile #14

arahlin opened this issue Feb 24, 2022 · 0 comments

Comments

@arahlin
Copy link

arahlin commented Feb 24, 2022

Running source_flattener.py on the latest erfa release (2.0.0) creates the following errors when attempting to compile the result (this is with Apple clang 12.0 on OSX 10.15):

gcc -c -pedantic -Wall -O3 -g -fPIC -I. erfa.c -o erfa.o
In file included from erfa.c:1:
./erfa.h:634:21: error: unknown type name 'eraLEAPSECOND'
int eraDatini(const eraLEAPSECOND *builtin, int n_builtin,
                    ^
./erfa.h:635:15: error: unknown type name 'eraLEAPSECOND'
              eraLEAPSECOND **leapseconds);
              ^
./erfa.h:624:2: error: unterminated conditional directive
#ifndef _ERFA_DAT_EXTRA_H
 ^
./erfa.h:1:2: error: unterminated conditional directive
#ifndef ERFAHDEF
 ^
erfa.c:11911:10: error: use of undeclared identifier 'PACKAGE_VERSION'
  return PACKAGE_VERSION;
         ^
erfa.c:11916:10: error: use of undeclared identifier 'PACKAGE_VERSION_MAJOR'
  return PACKAGE_VERSION_MAJOR;
         ^
erfa.c:11921:10: error: use of undeclared identifier 'PACKAGE_VERSION_MINOR'
  return PACKAGE_VERSION_MINOR;
         ^
erfa.c:11926:10: error: use of undeclared identifier 'PACKAGE_VERSION_MICRO'
  return PACKAGE_VERSION_MICRO;
         ^
erfa.c:11931:10: error: use of undeclared identifier 'SOFA_VERSION'
  return SOFA_VERSION;
         ^
erfa.c:15638:21: error: use of undeclared identifier 'DBL_EPSILON'
   if ( (f-1.0) >= -DBL_EPSILON/4.0 ) {
                    ^
erfa.c:15645:13: error: use of undeclared identifier 'DBL_EPSILON'
      if ( -DBL_EPSILON/2.0 < f ) {
            ^
11 errors generated.
make[1]: *** [erfa.o] Error 1
make: *** [erfa] Error 2

It looks like the flattener creates a header file with the erfaextra.h and erfadatextra.h headers copied in the wrong order (the latter depends on the former), and with missing #endif directives (or without stripping the existing directives from the headers first). The erfa.c source file includes the version and leapsecond code, but also includes the testing code in t_erfa_c_extra.c. The source file is also missing the #include <float.h> that's required in jd2cal.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant