szaghi / FLAP

Fortran command Line Arguments Parser for poor people
151 stars 34 forks source link

fobs file doesn’t actually build anything #34

Closed zbeekman closed 9 years ago

zbeekman commented 9 years ago

I’m trying to integrate this with my project but I am having some issues.

If I try to build with fobos nothing happens. I’m not sure if this is an issue with the fobos file or with FoBiS.py:

$ FoBiS.py build -mode static-gnu
$ tree static
static
├── mod
└── obj

2 directories, 0 files

If I try to build with the included Makefile I get errors: https://gist.github.com/zbeekman/5be2392f0fe05ddcaaa4

If I tell CMake where the Data_Type_Command_Line_Interface.F90 and IR_Precision.F90 files are and try to let CMake’s dependency resolution handle everything else, I get a catastrophic compiler error with gfortran 5.1:

/Users/ibeekman/Sandbox/passmap/FLAP/src/Data_Type_Command_Line_Interface.F90:2406:0:

   if (allocated(rhs%examples)) lhs%examples   = rhs%examples
 ^
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1797

/Users/ibeekman/Sandbox/passmap/FLAP/src/Data_Type_Command_Line_Interface.F90:2406:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/Homebrew/homebrew/issues> for instructions.
make[3]: *** [src/CMakeFiles/passmap.dir/__/FLAP/src/Data_Type_Command_Line_Interface.F90.o] Error 4
make[2]: *** [src/CMakeFiles/passmap.dir/__/FLAP/src/Data_Type_Command_Line_Interface.F90.o.provides] Error 2
make[1]: *** [src/CMakeFiles/passmap.dir/all] Error 2
make: *** [all] Error 2
zbeekman commented 9 years ago

The problem of the broken Makefile and FoBiS.py not building the library still exists, but I figured out the source of the errors when using CMake… there is a gfortran work around that needs to be enabled with -DGNU… there’s a better way to do this, see here: http://fortranwiki.org/fortran/show/Predefined+preprocessor+macros

Basically you don’t need to pass a user definition to let the source code know which compiler is building it; compilers already include predefined macros to do this. I’ll work up a PR to eliminate this from FLAP which will make it a little bit more robust.

szaghi commented 9 years ago

@zbeekman

It is probably fobos to have not up-to-date contents for building the library (in yhe last weeks I build only the drivers).

Thanks for the PR. By the next hours I will merge your PR and correct the fobos.

szaghi commented 9 years ago

Got it. The fobos file had still the .f90 extension for the library that is now .F90.

The new fobos file has the correct extension.

P.S. note that the makefile provided is for only Test_Driver program: FoBiS.py does not support the production of makefile for building libraries (a new feature request about this on FoBiS.py is now open).

zbeekman commented 9 years ago

Great, thanks so much for fixing this!

victorsndvg commented 9 years ago

If you are interested, I can try to create a CMake script to compile the FLAP library and executables as two separate targets. This option could coexist with the FoBoS script. What do you think?

szaghi commented 9 years ago

Hi victor,

thank you very much. Yes it is useful.

P.S. the next week our lib will progress...

zbeekman commented 9 years ago

I’m not sure there is a need to maintain an additional build script, but it’s up to you and Stefano. I am adding FLAP to my project with CMake already and it is very easy to just tell CMake to compile a library from the two source files.

@szaghi thanks for fixing the fobos file. If I had noticed the filename extensions issue I would have included it in my PR…

On Fri, Jun 26, 2015 at 7:56 AM victorsndvg notifications@github.com wrote:

If you are interested, I can try to create a CMake script to compile the FLAP library and executables as two separate targets. This option could coexist with the FoBoS script. What do you think?

— Reply to this email directly or view it on GitHub https://github.com/szaghi/FLAP/issues/34#issuecomment-115655436.

szaghi commented 9 years ago

@zbeekman do not worry. Let me know about the -- option