xiaoyeli / superlu

Supernodal sparse direct solver. https://portal.nersc.gov/project/sparse/superlu/
Other
281 stars 96 forks source link

Fix Fortran Include File Generation #127

Closed ArmstrongJ closed 12 months ago

ArmstrongJ commented 1 year ago

This request takes three major actions:

The first step simply eliminates a prebuilt header because it is hard-coded and would ignore the current build configuration. If a developer is using CMake, though, the Fortran compiler (at least GNU Fortran...) will default to reading the source directory's copy of _superluconfig.fh rather than one created in the build directory. This issue is especially problematic if we make the second change because...

The second change eliminates the generation of _superluconfig.fh in the source directory. I don't think anyone expects a CMake build process to modify the contents of the source directory.

Finally, the sed command to generate _FORTRAN/superluconfig.fh was broken because it would delete any line from _SRC/superluconfig.h that contains a C comment, including the closing #endif which contained one. The new sed command will delete any text including and following a forward slash (rather than just deleting any line with a forward slash).

xiaoyeli commented 1 year ago

FORTRAN/Makefile is invoked only using the manual 'make' command. But it is not used using CMake. So we still need to fix the sed command, in order for CMake to work.

gruenich commented 1 year ago

You are right, the header should be generated in the build directory. I would not rely on sed, but use CMake's configure_file. If you want, I can prepare an according pull request.

Leave the Makefile the way it is. I still hope that one day, we can drop the Makefiles and just rely on CMake.

xiaoyeli commented 1 year ago

@gruenich Please prepare a PR to use configure_file feature. Thanks.