-
Notifications
You must be signed in to change notification settings - Fork 134
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
How to use the externalize
option?
#676
Comments
It sounds to me like you are using it as intended. It may be that the externalize function does not properly deal with type-bound procedures. I guess, those are not tested in that setting. |
The test for external projects does contain a type bound procedure:
Can you share some sample code that causes the error? |
Does #677 help? |
Sure thing! This is my fundamental class, called module gc_pointers_h
implicit none
private
public :: pointers
type :: pointers
contains
procedure :: check
end type pointers
interface pointers
module procedure pointers_constructor
end interface pointers
interface
module function pointers_constructor( gencat )result( this )
class(*), pointer, intent( in ) :: gencat
type( pointers ) :: this
end function pointers_constructor
module subroutine check( self )
class( pointers ), intent( in ) :: self
end subroutine check
end interface
CONTAINS
end module gc_pointers_h Then, the base code specifies a module gc_method_h
use gc_pointers_h, only: pointers
implicit none
private
public :: t_method, method_constructor
type, extends(pointers) :: t_method
contains
procedure :: init, run
end type t_method
abstract interface
function method_constructor(ptr, nwords, words) result(this)
import t_method
class(t_method), pointer :: this
class(*), intent(in) :: ptr
integer, intent(in) :: nwords
character(*), intent(in) :: words(:)
end function method_constructor
end interface
CONTAINS
function init(self) result(ierr)
class(t_method), intent(inout) :: self
integer :: ierr
end function init
function run(self) result(ierr)
class(t_method), intent(inout) :: self
integer :: ierr
end function run
end module gc_method_h And finally, in my plugin code i create an extension of the module gc_method_fks_h
use gc_method_h, only : t_method
implicit none
public :: t_method_fks, method_fks_constructor
private
!> |cmd| `method fks`
type, extends( t_method ) :: t_method_fks
contains
procedure :: init => method_fks_init
procedure :: run => method_fks_run
final :: method_fks_destroy
end type t_method_fks
interface method_fks_
module procedure :: method_fks_constructor
end interface method_fks_
interface
module function method_fks_constructor( ptr, nwords, words )result( this )
class( t_method ), pointer :: this
class(*), intent(in) :: ptr
integer, intent( in ) :: nwords
character(*), intent( in ) :: words(:)
end function method_fks_constructor
module function method_fks_init( self )result(ierr)
class( t_method_fks ), intent( inout ) :: self
integer :: ierr
end function method_fks_init
module function method_fks_run( self )result(ierr)
class( t_method_fks ), intent( inout ) :: self
integer :: ierr
end function method_fks_run
module subroutine method_fks_destroy( self )
type( t_method_fks ), intent(inout) :: self
end subroutine method_fks_destroy
end interface
CONTAINS
end module gc_method_fks_h I managed to track down something, when i comment out the |
It does not. |
Thanks! I can reproduce the bug and will have a look. |
I've now pushed some changes to #677, which makes it work for me. Can you please give it a try? |
Yeah that seems to work. Awesome, thanks! There seems to be some small inconsistency however, in that the directory specified in |
In 6fe3fb2 I now changed the external definition to be relative to the project directory (if it is relative). |
That seems to work for me, thanks! Is it possible to have several paths for the Also, is it desirable to have a hard-stop error when the needed file |
Yes. See for example the Ateles source repository.
It could, but that may well go unnoticed. I think, if it was requested by the user in the project, it is justified to abort when that database isn't found. |
Nice, thanks!
Yes, understandable. How can I pass the command via the command line |
This should work with:
|
Is it possible to add the external modules into the search index? |
This may depend on the extend of what to add to the search. The search iterates over the generated pages and adds them to the search. Adding all pages from the subprojects into the search appears a little counterproductive to me. I guess it would be possible to iterate over all Fortran objects that have an |
I'm not really sure how this works, but if the search index is generated in a subproject, it could be added to the search of the project which references it as |
Hello,
I have a code with a plugin system, where the base code's documentation is written by FORD, but the plugin documentations are separate ford projects not included in the base. I would like to use the
externalize
option on the base code, to be able to reference it from the documentation of the plugins (also written by FORD).I tried setting
externalize: true
in the base code, and then givingexternal: local=/path/to/base/doc
in the project file of a plugin documentation. But upon running FORD for my plugin, i get the error:Without the
external: local=...
specification, the documentation writes normally (however giving warnings that references are not found, which is normal i guess).Is this an error due to my wrong use of the
external
option, or something else?thanks
The text was updated successfully, but these errors were encountered: