-
Notifications
You must be signed in to change notification settings - Fork 262
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
Build fails on FreeBSD due to handling of fileno() #2043
Comments
Try removing it from ncgen3/ncgeny.c (the actual parser). |
Sorry I missed this message earlier. If I remove the fileno declarations from the four files ncgen3/ncgen.l ncgen.y and ncgen/ncgen.l ncgen.y and run make makeparse in those two directories then the code can be compiled. But I don't know how to modify the netcdf build systems to do this. |
Ok, try changing the files ncgen3/ncgen
|
Protecting just the fileno in ncgen.l and ncgen.y does not work because the build with configure; make does not actually regenerate the .c files (which for some unclear reason are in the repository even though they seem to be generated files). If I remove all the fileno() extern from all the files including the .c then netcdf builds fine. I don't understand enough about the configure; make system to figure out why the .c files are not generated with the new values at configure; make time. BTW: I am building from a git clone but I don't think that should matter. |
They are not regenerated so that users without bison/flex installed and still use the library. |
Will this issue be fixed in the next point release of netcdf? This is preventing us from upgrading PETSc to use the latest NetCDF release and we don't want to be several releases behind. |
I thought I put it in one of the PR, but let me check and create a separate PR for it. |
1. Issue Unidata#2043 * FreeBSD build fails because of conflicts in defining the fileno() function. So removed all extern declarations of fileno. 2. Issue Unidata#2124 * There were a couple of problems here. * I was conflating msys with mingw and they need separate handling of paths. So treat mingw like windows. * memio.c was not always writing the full content of the memory to file. Untested fix by properly accounting for zero size writes. * Fix bug when skipping white space in tst_xcache.c 3. Issue Unidata#2105 * On MINGW, bash and other POSIX utilities use a mounted root directory, but executables compiled for Windows do not recognise the mount point. Ensure that Windows paths are used in tests of Windows executables. 4. Issue Unidata#2132 * Apparently the Intel C compiler on OSX defines isnan etc. So disable declaration in dutil.c under that condition. 5. Fix and re-enable test_rcmerge.sh by allowing override of where to look for .rc files 6. CMakeLists.txt suppresses certain ncdump directory tests because of differences in printing floats/doubles. * Extend the list to include those that also fail under mingw. * Suppress the mingw tests in ncdump/Makefile.am
Machine platform:
uname_result(system='FreeBSD', node='petsc-fbsd02', release='12.1-RELEASE-p1', version='FreeBSD 12.1-RELEASE-p1 GENERIC', machine='amd64', processor='amd64')
Python version:
3.6.9 (default, Dec 10 2019, 01:10:29)
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.1 (tags/RELEASE_601/final 335540)]
Error while building
ncgen.y:22:12: error: expected identifier or '(' before '!' token
22 | extern int fileno(FILE*);
| ^~~~~~
ncgen.l:28:12: error: expected identifier or '(' before '!' token
28 | extern int fileno(FILE*);
The problem comes from netcdf include files prototyping fileno() while the Freebsd includes provide fileno() as a macro under some conditions.
Attached is the entire configure and build process.
netcdf.log
The text was updated successfully, but these errors were encountered: