YingyiLiu/HAMS

Compiling errors in Centos

Closed this issue · 10 comments

I am unable to compile HAMS source code using gfortran (v7.1.0) in Centos OS. I get following two errors:

**Warning: Unused variable ‘md’ declared at (1) [-Wunused-variable]
gfortran -g -m64 -c -O3 -fno-align-commons -fPIC -fdec-math -fbacktrace -fcheck=all -Wall -o AssbMatx_irr.o AssbMatx_irr.f90
AssbMatx_irr.f90:260:132:

      DIST=SQRT((iXYZ_P(IEL-NELEM,1)-XYZ_P(JEL,1))**2+(iXYZ_P(IEL-NELEM,2)-XYZ_P(JEL,2))**2+(iXYZ_P(IEL-NELEM,3)-XYZ_P(JEL,3))**2)
                                                                                                                                1

Error: Line truncated at (1) [-Werror=line-truncation]
AssbMatx_irr.f90:260:132:

      DIST=SQRT((iXYZ_P(IEL-NELEM,1)-XYZ_P(JEL,1))**2+(iXYZ_P(IEL-NELEM,2)-XYZ_P(JEL,2))**2+(iXYZ_P(IEL-NELEM,3)-XYZ_P(JEL,3))**2)
                                                                                                                                1

Error: Syntax error in argument list at (1)
AssbMatx_irr.f90:586:32:**

Yes, I was able to fix it. But raised the issue so it can be fixed.

With the latest code, I am getting an error (see below) while compiling.
Error: Function ‘atan2d’ at (1) has no IMPLICIT type.

Make sure you use the -fdec-math compiler option. This is activated in the makefile in the source directory. If you are using an old version of gfortran, that might also be an issue.

Sorry you are still having issues. That one is tough for me to help with remotely as you are using custom installs of Lapack. Maybe double cross check with the makefile flags that are working.

When I get around to setting up a CI workflow, maybe some of these issues will get ironed out.

Finally, I managed to compile HAMS without any errors by using another compiled version of Lapack from PETSC-3.12.0 module. I also able to run the Cylinder test case.

Congratulations, @ramisetti , could you share the link of that Lapack package, so that others can follow? Thanks.

I compiled the PETSC-3.12.0 library which also has Lapack package. The link for Petsc is https://www.mcs.anl.gov/petsc/download/index.html. However, I will not suggest this procedure to all users because in my case I was trying to use Lapack library (https://www.netlib.org/lapack/lug/node11.html) that I compiled from its source code. For some reason, HAMS is not working with this version. So I used the libraries from PETSC that I compiled for other codes.

In general, one can install the Lapack library files on their personal Linux machine if not already available. Then, I think they will be able to compile HAMS without any problem. For instance, on Ubuntu OS the following command in the terminal will install Lapack library.

sudo apt-get install liblapack-dev

It's been a while since I ran a RedHat/Centos machine, but Lapack should be available via your package manager too . .