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

Line length limit fortran compiler #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

louisl3grand
Copy link

Hi,

I am on a mac computer using the gfortran compiler version 11.3.0.
When compiling the code with make camb I got this error message

mkdir -p Release
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -cpp -ffree-form -JRelease -IRelease/ -c constants.f90 -o Release/constants.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -cpp -ffree-form -JRelease -IRelease/ -c inifile.f90 -o Release/inifile.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -cpp -ffree-form -JRelease -IRelease/ -c mgcamb.f90 -o Release/mgcamb.o
mgcamb.f90:1087:132:

 1087 |             mg_cache%grhov_t = 3._dl*mg_par_cache%h0_Mpc**2*mg_par_cache%omegav*a**(-1.d0-3.d0*w0DE-3.d0*waDE)*Exp(3.d0*waDE*(a-1.d0))
      |                                                                                                                                    1
Error: Line truncated at (1) [-Werror=line-truncation]
mgcamb.f90:1087:132:

 1087 |             mg_cache%grhov_t = 3._dl*mg_par_cache%h0_Mpc**2*mg_par_cache%omegav*a**(-1.d0-3.d0*w0DE-3.d0*waDE)*Exp(3.d0*waDE*(a-1.d0))
      |                                                                                                                                    1
Error: Expected a right parenthesis in expression at (1)
f951: some warnings being treated as errors
make: *** [Release/mgcamb.o] Error 1

This is due to the line being longer than the limit of 132 characters. Adding the flag -ffree-line-length-none in the Makefile solved this compilation issue for me.

@itrharrison
Copy link

@alexzucca90 any chance of getting this merged?

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

Successfully merging this pull request may close these issues.

2 participants