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

compiling on Fedora 33 with gcc 10.2.1 #59

Open
cnaw opened this issue Jul 10, 2021 · 7 comments
Open

compiling on Fedora 33 with gcc 10.2.1 #59

cnaw opened this issue Jul 10, 2021 · 7 comments

Comments

@cnaw
Copy link

cnaw commented Jul 10, 2021

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 Montage fails to build from source with gcc-10 #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 unable to build montage #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:

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

  2. 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 ;

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

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

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

  6. 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)

  7. 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
Copy link

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
Copy link
Author

cnaw commented Nov 17, 2021

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

@ralvarezz
Copy link

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

@virogozhin
Copy link

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
Copy link
Author

cnaw commented Jul 18, 2022

Thanks @virogozhin! I updated the instructions.

@rjansen15
Copy link

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
Copy link

yapus commented Jul 6, 2023

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

ITV-107 added a commit to ITV-107/Montage that referenced this issue Jan 19, 2024
ITV-107 added a commit to ITV-107/Montage that referenced this issue Jan 19, 2024
…ch-IPAC#59) and attempting to apply profiling for gprof

This will help with generating the call-graphs and therefore the shape of the DAG.
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

5 participants