Installation hurdles

Issue #60 resolved
Markus Kempf created an issue

Tried to install PhoSim on a regular Ubuntu 22.04 system with bash as the default shell. A few prerequisites are not mentioned in the installation guide. First, you need a (t)csh installed to execute configure. Second, the bin/setup script is csh specific. I changed it to the export syntax used by bash. Third, there is small bug setting the PYTHON environment variable to “found.” Fourth, to run the GUI, tkinter needs to be installed. This should at least be documented or the install script changed to be more flexible. Otherwise it might cause frustration with inexperiences unix users. Finally it ran on my system, hurra, Looking forward to many interesting experiments with optical systems.

Comments (13)

  1. John Peterson

    Markus-

    A few questions:

    For point #1 and #2, do you mean you didn’t have csh in your linux distribution and therefore it failed? I am confused because you shouldn’t have to run bin/setup yourself even. If so, I am a little surprised you don’t have csh. I suppose we could switch it to bash permanently, but it's just so basic that this hasn’t come up before from anyone else. In other words, it should all work even if your shell is bash, but only fail if your linux distribution doesn’t recognize csh.

    For point #3, what bug for the PYTHON variable about found? I’m confused what you mean.

    Yes, for point #4 we should write that tk needs to be there.

    John

  2. Eugene Magnier

    I ran into the PYTHON environment variable problem as well.

    The problem is that the configure script does not correctly handle a failure to find python:

    which python | awk '{print "setenv PYTHON "$NF}' >! setup
    if ( ($?PYTHONPATH) ) then
    echo ${PYTHONPATH} | awk '{print "setenv PYTHONPATH "$1}' >> setup
    endif

    The ‘which python’ returns the value ‘python not found.’ if python is not found by that name. This then results in the env PYTHON getting set to ‘found.’

    In my case, python was installed only as ‘python3’, so the name ‘python’ did not exist. I fixed this by editing my setup/bin script, but it would be better if configure at least raised a warning or error if that ‘which python’ command fails.

    (As for the shell, these days Linux distributions are trending to only include bash. I always have to install csh and tcsh myself when I set up a new machine).

  3. Eugene Magnier

    I ran into a couple of other issues that are related to installation:

    1. On my Ubuntu 20.04 system, g77 does not seem to be supported for installation (or I failed to find the package). Instead, gfortran seems to be the modern name. This makes the build of fftw fail since the configure script for fftw requires the name g77. I solved this by going into the fftw installation directory and re-running configure with the fortran APIs disabled (this is an option to fftw configure, I think it is --disable-fortran). Then I re-ran your configure script selecting the option 'b' to let phosim find fftw and cfigsio.
    2. I originally tried to use an existing installation of CFITSIO. Like you, we have a version of CFITSIO that we include with the Pan-STARRS IPP build, so I always have that floating around. But, our version is kind of old (3.1), and it seems to trigger a segfault in the atm portion of phosim. I needed to build phosim with the supplied version of cfitsio. I didn’t explore the dependencies, but maybe a warning about at least this older version.

  4. John Peterson

    Ok, Gene and Markus. Made a lot of progress on this. Please checkout v6.0.10 at your convenience.

    1. Made the python finding more robust. First it checks for python, then python3, and then if it can’t find anything it will ask where your python is. This should fix the “found” bug.
    2. I converted the configure script, the make file, and phosim itself from csh to bash. Hopefully that will work, but I am curious if you can help test it.
    3. For the cfitsio, I just printed a warning that it should be a reasonably new version, but I am not sure exactly how old will be a problem.
    4. I didn’t do anything for fftw yet. I am thinking we could try “--disable-fortran” by default as you say, but haven’t tested it

  5. John Peterson

    So, “--disable-fortran” seems to work fine to resolve the fftw problem. We will update fftw & cfitsio and put this in the next major release.

    I think this ticket is resolved now. Please comment if there are any other problems. I’ll keep this open for a week or so.

  6. Markus Kempf reporter

    Hi John,

    tested it again with a fresh Ubuntu 22.04 in WSL. Configure with option a) and make work and bin/setup looks good. But executing phosim or phosim_gui still require a csh. With an installed csh I get this error message:

    markus@galileo8:~/phosim-phosim_release-c98d5afeb2be$ ./phosim_gui
    export: Command not found.
    export: Command not found.
    export: Command not found.
    export: Command not found.
    export: Command not found.
    export: Command not found.
    export: Command not found.
    Runing on Linux

    But the GUI does start.

    Markus

  7. Log in to comment