Starlink / starlink

Starlink Software Collection
162 stars 53 forks source link

starlink build on Debian 11 #75

Closed paulkerry1 closed 2 years ago

paulkerry1 commented 2 years ago

Hi all

I'm building starlink cloned from the latest git on the recently released Debian 11 64bit o/s. Debian 11 contains the newer gcc/g++/gfortran version 10.2.1 so I have to use ./configure -C FCFLAGS=-fallow-argument-mismatch otherwise I get ... Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) errors.

All is good with the build using the above, until "make world" stops with... cd applications/gaia \ && (make && make install) >make.log 2>make.log.err || { cat make.log.err; false; } /bin/ld: libgaia4.4.9.so: undefined reference to `ndfXgt0d'

Following the suggested make output, if I change line 2001 in {source}/applications/gaia/gaia/generic/gaiaNDF.c from... ndfXgt0d to... ndfXgt0l then make world works fine, as does gaia after it has built. I'm unsure if doing this is a good idea though! Any thoughts or suggestions please?

A similar issue occurs in the make world for smurf... smf_construct_smfDream.c:266:3: error: implicit declaration of function ‘ndfXgt0d’; did you mean ‘ndfXgt0l’? [-Wimp licit-function-declaration] but as we don't use smurf, I've removed it from the toplevel makefile.

Regards Paul

dsberry commented 2 years ago

@paulkerry1 Odd. We added -fallow-argument-mismatch about a year ago (see fb8a0ed) and sorted the ndfXgt0d issue last April (see 934c9b46). You're sure you've checked out master and not some other branch? As a sanity check, could you do:

% grep flt.clip $SMURF_DIR/smurf_makemap.def

You should see:

Name: flt.clip

than "flt.clip" times the RMS are set bad. If any such

flt.clip = 0.0

if you've got the latest stuff.

paulkerry1 commented 2 years ago

Hi David and thanks for the reply.

I did a "git clone git://github.com/Starlink/starlink.git" into a new directory and "git branch" shows I am on master. "git log" shows both of those commits you mention. I also see the grep command in the source just as you mention.

Regards Paul

dsberry commented 2 years ago

OK. I'll install Debian 11 on a VM here and see if I can sort the issues out.

paulkerry1 commented 2 years ago

Thanks David

I've started afresh again to make sure I'm not doing anything wrong. Following https://github.com/Starlink/starlink#readme verbatim, the first issue I get is with "make world"

cd applications/latexsupport \ && (make && make install) >make.log 2>make.log.err || { cat make.log.err; false; } cd applications/star2html \ && (make && make install) >make.log 2>make.log.err || { cat make.log.err; false; } /usr/bin/env: ‘starperl’: No such file or directory make[1]: [Makefile:822: sun199.htx_tar] Error 127 make: [Makefile.dependencies:2988: /star-2021.09.23/manifests/star2html] Error 1

so I did... setenv PATH $STARCONF_DEFAULT_STARLINK/bin:$PATH to pick up starperl and ran "make world" again, which succeeded, until this point...

cd libraries/pcs \ && (make && make install) >make.log 2>make.log.err || { cat make.log.err; false; } ar: u' modifier ignored sinceD' is the default (see U') ar:u' modifier ignored since D' is the default (seeU') ar: u' modifier ignored sinceD' is the default (see U') ar:u' modifier ignored since D' is the default (seeU') sup_curval.f:238:53:

202 | CALL DAT_GETL ( BOTLOC, 0, 0, LVAL(1), STATUS ) | 2
...... 238 | CALL DAT_GETL ( BOTLOC, ACTDIM, DIMS, LVAL, | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) sup_curval.f:248:53: [etc, etc]

If I grep in the build for "fallow-argument-mismatch", then I see it in many places.

Regards Paul.

paulkerry1 commented 2 years ago

Hi David Please hold off with setting up a VM - I'm making progress by using the sourceme-example.csh which is setting more things that I have been: make world is running beyond where it stopped last time. I'll report back when it's completed. Cheers Paul.

dsberry commented 2 years ago

I think I've sorted it. The test for the -fallow-argument-mismatch gfortran option was using the environment variable $FC to define the required fortran compiler, but in a way that only worked if FC was set by the user before doing the initial bootstrap. It should not be necessary to set FC before using bootstrap. I've just made a commit to github which should hopefully fix this so that the -fallow-argument-mismatch test is performed correctly even if the user does not set FC.

paulkerry1 commented 2 years ago

Hi David Thanks for your efforts: that makes sense about the FC as I've never set it until I used the sourceme file. I've started afresh with your changes and I am still having the "/bin/ld: libgaia4.4.9.so: undefined reference to `ndfXgt0d'" issue. In your initial reply, you mentioned commit 934c9b4 but that appears to be unrelated - is it another commit that hasn't been pushed? Searching in "git log", I see commit 510d0fe42187e22126e2bae158589681435d0838 Author: Graham Bell g.bell@eaobservatory.org Date: Fri May 10 12:40:34 2019 -1000 ndf: Add #define for ndfXgt0l

but nothing for ndfXgt0d

dsberry commented 2 years ago

The definition of macro ndfXgt0d should be near the end of file star/include/ndf_cgen.h. This include file is generated automatically when the NDF library is built. The script that builds the include file uses python, and accesses python using "/usr/bin/ev python". But on my debian 11 VM, there is no "python" command - there is "python3" and "python3.9" but no "python". So i've just tried doing:

% sudo ln -s /usr/bin/python3 /usr/bin/python

and then rebuilding the NDF library, and now the definition of ndfXgt0d is created successfully. Can you try something like this? It's a mystery to me why debian have decided to omit the simple "python" command.

paulkerry1 commented 2 years ago

Thanks David - I'll try that and report back. It might be because debian finally deprecated python2 for this release, which was linked to /usr/bin/python and I'm unsure why they haven't recreated the link for python3. Maybe they think scripts should be "#!/usr/bin/env python3" and not "#!/usr/bin/env python"?

paulkerry1 commented 2 years ago

That's worked perfectly David! Thanks very much for your time and effort. Can I suggest that the python3->python workaround is added to the "Prerequisites" section under a new "Debian 11:" section on https://github.com/Starlink/starlink/blob/master/README or elsewhere as you see fit? I didn't install any other packages compared to the "Debian 10:" section that I provided last time to Malcolm.

Regards Paul.

paulkerry1 commented 2 years ago

Hi all

I've come across an issue when building the git cloned (2022-03-03) starlink repo again on the same Debian 11 amd64 system.

"make world" fails with... cd thirdparty/kitware/vtk \ && (make && make install) >make.log 2>make.log.err || { cat make.log.err; false; } make[2]: No targets specified and no makefile found. Stop. make[1]: [Makefile:679: all] Error 2

and it looks like it fails because there is no makefile there.

If I... cd thirdparty/kitware/vtk/cmake cmake .

then go back up to the top level and "make world", everything works perfectly to completion.

BTW - since the earlier above messages, I've found that Debian 11 has the "python-is-python3" package, which creates the necessary /usr/bin/python -> python3 link.

Regards Paul.

dsberry commented 2 years ago

Thanks Paul. I've modified the main README to include python-is-python3 as a Debian prerequisite. There is already a general comment in there about the need for an unversioned "python" command.

paulkerry1 commented 2 years ago

David - you'll want to add a new Debian 11 section to that page and put python-is-python3 there (plus maybe referencing the earlier Debian 10 packages), as Debian 10 doesn't have that package: for Debian 10, /usr/bin/python is a symlink to /usr/bin/python2

dsberry commented 2 years ago

Thanks. Done.