-
Notifications
You must be signed in to change notification settings - Fork 140
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
Compile error in affinity.c #276
Comments
There's more info about this issue here: #196 The short answer is that Linux defines its own It's been solved in the mainline repository by running autotools (i.e. But if (like me) you're not yet using the new autotools build system, then you can temporarily solve the problem by deleting the |
Thank you @marshallward. And thanks for pointing to that issue. Yes removing static keyword solved the problem, temporarily. Since in UFS we pull FMS as a submodule and compile it using UFS's cmake (or gnu make) build. We do not use autotools. Just curious, why do you think definition of
|
I think you may have solved the mystery: the system call has been around for ages (which is why I had been confused) but the interface was only recently added to GNU libc. I also noticed this on the manpage:
As for the error, I think it's just an incompatible header. If you have a generic header like this:
then you get an error. I suppose one reason for the error is to avoid logical inconsistency, since |
Thank you, @marshallward for pointing @DusanJovic-NOAA toward the related issue, and for clarifying possible reasons for the error. |
as C5's environment contains its own gettid Linux system call available in the GNU standard library. The intel-classic environment does not have the gettid system function defined. More details: NOAA-GFDL/FMS#276 The error one sees is: src/FMS/affinity/affinity.c:55:14: error: static declaration of 'gettid' follows non-static declaration static pid_t gettid(void) ^ /usr/include/bits/unistd_ext.h:34:16: note: previous declaration is here extern __pid_t gettid (void) __THROW; ^ 1 error generated.
C5's environment contains its own gettid Linux system call available in the GNU standard library. More details: NOAA-GFDL/FMS#276 The error one sees is: src/FMS/affinity/affinity.c:55:14: error: static declaration of 'gettid' follows non-static declaration static pid_t gettid(void) ^ /usr/include/bits/unistd_ext.h:34:16: note: previous declaration is here extern __pid_t gettid (void) __THROW; ^ 1 error generated.
C5's environment contains its own gettid Linux system call available in the GNU standard library More details: NOAA-GFDL/FMS#276
Describe the bug
I am building FMS (as part of ufs-weather-model) on Ubuntu 19.10. I get this error:
We use FMS tag 2019.01.01
To Reproduce
Build FMS on Ubuntu 19.10
Expected behavior
Compile without error
System Environment
Describe the system environment, include:
The text was updated successfully, but these errors were encountered: