You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions outside modules are handled just fine by normal FoBiS.py, but not in the generated Makefile.
Minimal example:
mymod.f90
program main
call print_outside_module()
end program
outside.f90
subroutine print_outside_module
print*, 'outside module'
end subroutine
Compiling the code works just fine:
FoBiS.py build -compiler gnu
./myprog
outside module
But not in the makefile...
FoBiS.py build -compiler gnu -m Makefile
make clean
make
Compiling myprog.f90
Assembling MYPROG
obj/myprog.o: In function `MAIN__':
myprog.f90:(.text+0xa): undefined reference to `print_outside_module_'
collect2: error: ld returned 1 exit status
make: *** [MYPROG] Error 1
I admit this is not a very clean coding style (maybe the compiler should have thrown an error in the first place...) but when working with legacy code there is not always a choice...
The text was updated successfully, but these errors were encountered:
I should have fixed this. Now, if you have non-module-libraries into your project, the make rules for compiling them are added as dependency for the linking rule of the target(s), thus the generated makefile works exactly as FoBiS.py.
Disclaimer
FoBiS.py, having implemented your feature for relax your building man... if something goes wrong keep going further..., can handle non-module-library in testing-dirty state, but the generated makefile not: if a compiling rule of a non-module-library fails, the linking rule of the target fails also. FoBiS.py 1 / Make 0 :-)
Functions outside modules are handled just fine by normal FoBiS.py, but not in the generated Makefile.
Minimal example:
Compiling the code works just fine:
But not in the makefile...
I admit this is not a very clean coding style (maybe the compiler should have thrown an error in the first place...) but when working with legacy code there is not always a choice...
The text was updated successfully, but these errors were encountered: