Caltech-IPAC / Montage

Image Mosaics for Astronomers
Other
111 stars 48 forks source link

compiling on Fedora 33 with gcc 10.2.1 #59

Open cnaw opened 3 years ago

cnaw commented 3 years ago

I tried installing Montage under Fedora 33 under gcc-10.2.1 and encountered the same issues that previous users had identified, plus several new ones. This is the list of fixes I had to make to have a successful compilation of Montage. Hopefully this will be of some use!

Christopher Willmer Steward Observatory, University of Arizona.

uname -r 5.11.15-200.fc33.x86_64 gcc --version gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)

git clone https://github.com/Caltech-IPAC/Montage.git

edit ~/Montage/Montage/Makefile.LINUX such that:

1) add -fcommon to CFLAGS - this was noted in Issue #49) CFLAGS = -g -I. -I../lib/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -fcommon

2) LIBS = -L../lib -lwcs -lcfitsio -lcoord -lmtbl -lsvc \ -lwww -lboundaries -lpixbounds -ltwoplane -lm (remove -lnsl - this was noted in Issue #48)

Since I was not using the development version, there are more instances of -lnsl which I fixed using

find * -name 'Makefile.LINUX' | xargs sed -i 's/-lnsl//g'

Other files had to be edited:

3) Edit ~/Montage/lib/src/coord/./coord.h so line 4 is extern int coord_debug;

4) edit ~/Montage/lib/src/coord/convertCoordinates.c: insert at line 5: int coord_debug actually (see comment by @virogozhin on 2022-07-18 below) int coord_debug ;

5) edit ~/Montage/util/MovingTarget/mMovingTarget.c setting line 89 to extern long nodeCount

6) edit ~/Montage/util/Search/mSearch.c commenting line 75: /long nodeCount; /

7) edit all instances (94!) of ~/Montage/MontageLib/MakeHdr/montageMakeHdr.c input -> hdr_input

8) edit ~/Montage/MontageLib/Subimage/montageSubimage.c : line 93 -> / int haveBlank / and insert at line 168 int haveBlank; (this will be inside braces of struct mSubimageReturn)

9) edit ~/Montage/MontageLib/TANHdr/montageTANHdr.c:109 by changing epoch -> char_epoch: original line # change
110 char char_epoch [80]; 1251 strcpy(char_epoch, ""); 1348 strcpy(char_epoch, value); 1371 if(haveEpoch) printf("epoch = [%s]\n", char_epoch); 1679 sprintf(temp, "EPOCH = %s", char_epoch );

With that I have a working version of Montage!

ralvarezz commented 2 years ago

Hi, I just want to thank you for your time writing this. I've been trying to fix the multiple installing errors for a few days now with no success. I'm glad I found this report. I was able to install Montage after fixing all the lines you mentioned.

Thanks a lot!!

cnaw commented 2 years ago

Cool!! I am happy this worked out! These instructions are also true for Fedora 34 running gcc 11.2.1.

ralvarezz commented 2 years ago

Oh I forgot to mention, if this is useful, I tested your instructions on Opensuse tumbleweed, with gcc 11.2.1. Thanks again!.

virogozhin commented 2 years ago

Thank you!!!

I was able to compile it on Ubuntu 11.3 under WSL Hope it will work well

Just to mention it could be helpfull to add ";" to "int coord_debug" in (4).

cnaw commented 2 years ago

Thanks @virogozhin! I updated the instructions.

rjansen15 commented 2 years ago

Thanks much for these detailed notes on what files to edit! For those running into the same compilation issues when trying to recompile Montage (v6.0) from the tar-ball on http://montage.ipac.caltech.edu/docs/download2.html, these edits allowed me to compile Montage using gcc version 11.2.0 on Ubuntu 22.04.1 LTS (kernel 5.14.0-1052).

yapus commented 1 year ago

Thanks to all contributors - just successfully compiled Montage_6.0 on Ubuntu 22.04 using these notes. 🙏🏻 Here's final patch just in case
https://gist.github.com/yapus/b2b62676940c28e484b78cc00dbb24b4