acbecker / hotpants Goto Github PK
View Code? Open in Web Editor NEWhotpants
License: MIT License
hotpants
License: MIT License
I had trouble building this on CentOS 5-7 (both 32 and 64 bit). There were two separate issues:
gethostname()
function was not found in unistd.h
This is caused by a GNU feature macro requirement test. It can be fixed by adding -D_GNU_SOURCE
to the compiler options in the Makefile
. Another way to fix it is to change -std=c99
to -std=gnu99
. If you are worried about supporting very old compilers, then -D_GNU_SOURCE
is probably the safest option.
Here is the quote from the CentOS 7 gethostname
manual page:
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
gethostname():
Since glibc 2.12: _BSD_SOURCE || _XOPEN_SOURCE >= 500
|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200112L
Here is the compiler output before the fix:
gcc -funroll-loops -O3 -ansi -std=c99 -pedantic-errors -Wall -I/usr/include/cfitsio -c main.c
main.c: In function 'main':
main.c:251: error: implicit declaration of function 'gethostname'
main.c:21: warning: unused variable 'scatterksumSubstamps'
main.c:21: warning: unused variable 'meanksumSubstamps'
make: *** [main.o] Error 1
#include "globals.h"
in extractkern.c
This resulted in the following compiler errors:
gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio -c extractkern.c
extractkern.c: In function 'make_kernel':
extractkern.c:439: error: 'rPixX' undeclared (first use in this function)
extractkern.c:439: error: (Each undeclared identifier is reported only once
extractkern.c:439: error: for each function it appears in.)
extractkern.c:440: error: 'rPixY' undeclared (first use in this function)
make: *** [extractkern.o] Error 1
I added the missing #include
after the others in extractkern.c
, and the compile completed successfully.
Thanks!
Hello,
I am trying to install hotpants in OS environment of Ubuntu 22.04.
I set the cfitsio include and lib path like;
CFITSIOINCDIR = /usr/include/cfitsio/include
LIBDIR = /usr/include/cfitsio/lib
Referring the issue comment in #1,
I used the complier command changing c99 into gnu99;
gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio/include -D_GNU_SOURCE -c main.c
However, the "unused variable" error occurred.
/usr/local/hotpants-master# gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio/include -D_GNU_SOURCE -c main.c
main.c: In function ‘main’:
main.c:21:59: warning: "/*" within comment [-Wcomment]
21 | /*double meanksumSubstamps,scatterksumSubstamps; /* mean and scatter of ksum */
|
main.c:562:38: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 4 [-Wformat-overflow=]
562 | sprintf(ttype[k], "Region%d", k);
| ^~
main.c:562:31: note: directive argument in the range [0, 2147483646]
562 | sprintf(ttype[k], "Region%d", k);
| ^~~~~~~~~~
In file included from /usr/include/stdio.h:894,
from main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 8 and 17 bytes into a destination of size 10
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
main.c:1870:30: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
1870 | sprintf(hInfo, "%s %s", hInfo, argv[i]);
| ^
In file included from /usr/include/stdio.h:894,
from main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 2049) into a destination of size 2048
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
I found the unused variable error occurs when the defined variable is not used in the code.
Can somebody help me?
Hi, when i run make command in macos High Sierra(64 bit). I got this error.
gcc -funroll-loops -O3 -ansi -std=c99 -pedantic-errors -Wall -I../../cfitsio/include -D_GNU_SOURCE -c main.c
main.c:4:9: fatal error: 'malloc.h' file not found
#include<malloc.h>
^~~~~~~~~~
1 error generated.
make: *** [main.o] Error 1
can somebody help me how to resolve this.
I saw lots of thing like:
gcc main.o vargs.o alard.o functions.o -o hotpants -L. -lm -lcfitsio -funroll-loops -O3 -ansi -std=c99 -pedantic-errors -Wall -I. -D_GNU_SOURCE
/usr/bin/ld: vargs.o:(.bss+0x678): multiple definition of `image'; main.o:(.bss+0x678): first defined here
/usr/bin/ld: vargs.o:(.bss+0x680): multiple definition of `template'; main.o:(.bss+0x680): first defined here
/usr/bin/ld: vargs.o:(.bss+0x670): multiple definition of `outim'; main.o:(.bss+0x670): first defined here
/usr/bin/ld: vargs.o:(.bss+0x640): multiple definition of `tNoiseIm'; main.o:(.bss+0x640): first defined here
/usr/bin/ld: vargs.o:(.bss+0x638): multiple definition of `iNoiseIm'; main.o:(.bss+0x638): first defined here
/usr/bin/ld: vargs.o:(.bss+0x630): multiple definition of `tMaskIm'; main.o:(.bss+0x630): first defined here
/usr/bin/ld: vargs.o:(.bss+0x628): multiple definition of `iMaskIm'; main.o:(.bss+0x628): first defined here
/usr/bin/ld: vargs.o:(.bss+0x620): multiple definition of `kernelImIn'; main.o:(.bss+0x620): first defined here
And I found a solution in kr-colab/discoal#21 which shows:
gcc 10 use -fno-common by defaualt. Adding -fcommon flag makes it work again.
This modify in makefile helps a lot.
I wish somebody who uses the gcc-10 would see this issue.
Hi, when i run make command in ubuntu-22.10-desktop-amd64. I got this error:
collect2: error: ld returned 1 exit status
make: *** [Makefile:49:hotpants] error 1
can somebody help me how to resolve this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.