Opened 6 years ago

Last modified 6 years ago

#1111 new defect

Missing fortran compiler prevents CCTK_REAL8 from being defined.

Reported by: Steven R. Brandt Owned by:
Priority: minor Milestone:
Component: Cactus Version: development version
Keywords: Cc:


If the fortran compiler is missing or invalid, Cactus does not create the definition for CCTK_REAL8, CCTK_REAL4, etc.

Attachments (0)

Change History (9)

comment:1 Changed 6 years ago by Frank Löffler

Has someone a patch for this already?

comment:2 Changed 6 years ago by Frank Löffler

Milestone: Cactus_4.1.0ET_2012_11

Changing to ET milestone

comment:3 Changed 6 years ago by Frank Löffler

It works if F77/F90 are set to 'none' or it is unset. So, this problem only appears if the user did specify something as fortran compiler but that doesn't work. Thus, I think it is warrented to downgrade this ticket; please revert if you disagree.

However, the ticket itself should be left open because it is still an error.

In the case above you see in the configure output quite some warnings about things going wrong:

Unknown Linux f90 compiler 'dfadf'.
Please add appropriate information to
and send the updated file to CactusMaint
We will try anyway ...


Determining number of fortran underscores...
Compiling test file with sdfsa -fopenmp -g -fcray-pointer -m128bit-long-double ...
Failed to compile fname_test.f
Creating null fortran name conversion routine
Compiling test file with dfadf -fopenmp -g -fcray-pointer -m128bit-long-double ...
Failed to compile fname_test.f
Creating null fortran common name conversion routine.
Fortran compilation failed ...

One part of the problem is close to line 1121 in lib/make/

if test -n "$CCTK_REAL8" -a \( "x$F77" = 'xnone' -o \( "x$cctk_cv_have_fortran_real8" -a "x$cctk_cv_have_fortran_complex16" = 'xyes' \) \); then

In short: only define CCTK_REAL8 is C did find it and if either fortran did as well or F77 is set to 'none'.

Now the question is how to best handle this case. The user specified a non-working Fortran compiler (or used a standard option list but doesn't have the compiler installed). I suggest to let configure fail at the point of


with hints to either correct the F77/F90 entries in the optionlist or to either not set them or set them to 'none' of indeed no Fortran compiler is needed.

The following patch implements the message, but the return value of that script isn't checked for, so a patch aborting configure at that stage would need to be either at another place or more invasive.

---        (revision 4902)
+++        (working copy)
@@ -35,6 +35,9 @@
   print "Fortran compilation failed ...\n";
+  print " ! Apparently a Fortran compiler was specified (F77/F90), but it does not \n".
+        " ! seem to be working. Either make sure to specify a working Fortran compiler, \n".
+        " ! do not set F77/F90, or set them to 'none'.\n\n"; 
 sub test_fortran_name

comment:4 Changed 6 years ago by Frank Löffler

Milestone: ET_2012_11ET_2013_05
Priority: majorminor
Version: Cactus_4.0.0development version

comment:5 Changed 6 years ago by Ian Hinder

I agree. If the user has specified a Fortran compiler in their optionlist and that compiler does not exist, this should be an immediate fatal error. It indicates either that the user has made an error in the optionlist, that the machine configuration has changed, or that the optionlist is not suitable for that system. All of these should be caught as early as possible.

The only argument I can see for this not being an error is if the user wants to use a "generic" optionlist for C thorns only on a system which doesn't have a Fortran compiler. If we really want to support this case, then we need to ensure that the entire configuration stage works with an invalid Fortran compiler, and I think this is unnecessarily complicated. The user can easily work around that by either setting F90 = none on the command line, or editing the optionlist.

comment:6 Changed 6 years ago by Erik Schnetter

The suggested patch above uses the terms "F77" and "F90", but it is not clear what they mean. We should be specific and say that these are options. If F90 is set, then F77 is unused, so we should probably not mention it here. We should also mention the compiler options F90FLAGS, since these may also make a compilation fail.

We should exit with a failure return code, and check the return code in the caller, presumably, and then abort there as well.

comment:7 Changed 6 years ago by Frank Löffler

Does anyone have a ready-to-test solution?

comment:8 Changed 6 years ago by Erik Schnetter

I don't think this should be a release goal.

comment:9 Changed 6 years ago by Frank Löffler

Milestone: ET_2013_05

It shouldn't hold up the release, but it is sad that tickets like this don't receive the attention they should (including me here).

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
Next status will be 'confirmed'.
The owner will be changed from (none) to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.