lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
116 stars 48 forks source link

cmake compile errors using -m64 flag #247

Open millerta opened 1 year ago

millerta commented 1 year ago

Jeffrey ran into an error from gfortran using the -m64 flag. Turns out, gfortran has never recognized the -m64 flag, it just has been carried along with no effect.

The -m64 and -m32 flags are used with gcc in the lg_util library.

Additionally, as far as I can figure out, the -m64 flag was used only to generate the mm2000.h file for 64 bit machines. But Daniel changed this when he converted to cmake. Instead of

gcc -E -m64 -Dlinx64 mm2000_header.F -o mm2000.h

Now in Support for Clang/LLVM which doesn't support header generation from Fortran file

This process is now cp -p mm2000_m$(BIT_SIZE).h mm2000.h

So I think it will do no harm to remove the flag in the cmake files. This only issue may be with opsys.h which uses mm2000.h But it seems as long as mm2000.h is compiled correctly, opsys.h will not need the -m64 flag.

I will change cmake files to drop -m64 and test linux and mac compiles to make sure this works.

Note flags such as -linx64 and -macx64 are needed for #ifdef in lagrit codes.