sirocco-rt / sirocco

This is the repository for Sirocco, the radiative transfer code used to model winds in AGN and other systems
https://sirocco-rt.readthedocs.io/en/latest/
GNU General Public License v3.0
30 stars 24 forks source link

Makefile updated as part of initial installation #1088

Open kslong opened 4 months ago

kslong commented 4 months ago

Right now if you install a fresh version of Python and try to switch to another branch, you are asked to commit changes in Makefile. I think this is because the configure step modifies the source/Makefile.

While one can do this, it seems odd and likely to lead to confusion. I don't really understand it though, because the Makefile in the dev branch is unchanged.

@Edward-RSE do you understand this? I think you may have worked on the Makefiles as part of your study last fall.

jhmatthews commented 4 months ago

Hmm, is there something funny going on with line endings still @Edward-RSE @smangham ?

Edward-RSE commented 4 months ago

That sounds like the issue we were having with the documentation branch during the last meet up. Although if you do use ./configure --with-cuda then I think that does modify one of the makefiles.

jhmatthews commented 4 months ago

I think this line bit of code is also slightly modifying the code without cuda by adding a space after NVCC

# when --with-cuda is enabled, we gotta do something to modify the Makefiles
if [ "$with_cuda" = true ]; then
    printf "Checking for nvcc..."
    if hash nvcc 2>/dev/null; then
        printf "yes\n"
        sed -i -e "s/^NVCC =.*/NVCC = nvcc/" source/Makefile
    else
        printf "no\n"
        sed -i -e "s/^NVCC =.*/NVCC = /" source/Makefile
    fi
else
    sed -i -e "s/^NVCC =.*/NVCC = /" source/Makefile
fi
jhmatthews commented 4 months ago

I think the solution is to make these sed lines: sed -i -e "s/^NVCC =.*/NVCC =/" source/Makefile i.e. remove the space after the equals sign. I don't fully understand the sed syntax here though.