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

Unterminated #endif in superlu_config.fh with CMake #126

Closed
ArmstrongJ opened this issue Nov 2, 2023 · 3 comments
Closed

Unterminated #endif in superlu_config.fh with CMake #126

ArmstrongJ opened this issue Nov 2, 2023 · 3 comments

Comments

@ArmstrongJ
Copy link
Contributor

When I build with CMake and -Denable_fortran=YES, the build will fail with


    2 | #ifndef SUPERLU_CONFIG_H
      |
Error: unterminated #ifndef
FORTRAN\CMakeFiles\dfexm.dir\build.make:88: recipe for target 'FORTRAN/CMakeFiles/dfexm.dir/hbcode1.F90.obj' failed

The error stems from the steps to regenerate superlu_config.fh. Specifically, the CMake-generate sed command in the Makefile:

cd /d C:\superlu\build64\FORTRAN && sed '/^\// d' < superlu_config.h > temp.fh

Testing the sed command, you'll see that it specifically strips the line:

#endif /* SUPERLU_CONFIG_H */

out of the file entirely since it has a C comment on it. The problem originates from FORTRAN/CMakeLists.txt:96 for reference.

Also, somewhat related, but generating a file in the source tree seems highly problematic as well. I would argue that superlu_config.fh should really be generated in the build directory (probably in the FORTRAN subdirectory).

@ArmstrongJ
Copy link
Contributor Author

Pull Request #127 should fix this issue as well as eliminate the generation of superlu_config.fh within the source tree when using CMake.

@gruenich
Copy link
Contributor

Fortran works for me on Linux with CMake. The header contains the #endif. Probably a Windows issues. That's why it got unnoticed.
Anyway, should be fixed!

@xiaoyeli
Copy link
Owner

This should be resolved from #135

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

No branches or pull requests

3 participants