diff --git a/meson.build b/meson.build index 1a194ea9..33e3c709 100644 --- a/meson.build +++ b/meson.build @@ -24,12 +24,20 @@ endif # 2) try blas/openblas + lapack otherwise if not dep_linalg_found dep_blas = dependency('blas', required: false) - if not dep_blas.found() + if dep_blas.found() + dep_blas_vendor = 'blas' + else message('Did not find the blas library. Trying with openblas') dep_blas = dependency('openblas', required: true) # required as it is the last try + dep_blas_vendor = 'openblas' + endif + + if dep_blas_vendor == 'openblas' + dep_linalg = [dep_blas] # openblas already provides a lapack implementation + else + dep_lapack = dependency('lapack', required: true) + dep_linalg = [dep_blas, dep_lapack] endif - dep_lapack = dependency('lapack', required: true) - dep_linalg = [dep_blas, dep_lapack] endif # # add some common path to pkg-config search path # env = environ() diff --git a/src/libflap/flap_command_line_argument_t.F90 b/src/libflap/flap_command_line_argument_t.F90 index 332127fe..4c96413b 100644 --- a/src/libflap/flap_command_line_argument_t.F90 +++ b/src/libflap/flap_command_line_argument_t.F90 @@ -1434,7 +1434,7 @@ subroutine get_cla_list_varying_char(self, val, pref) !--------------------------------------------------------------------------------------------------------------------------------- endsubroutine get_cla_list_varying_char - elemental subroutine cla_assign_cla(lhs, rhs) + subroutine cla_assign_cla(lhs, rhs) !--------------------------------------------------------------------------------------------------------------------------------- !< Assignment operator. !--------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/libflap/flap_command_line_arguments_group_t.f90 b/src/libflap/flap_command_line_arguments_group_t.f90 index ef69061c..e0266454 100644 --- a/src/libflap/flap_command_line_arguments_group_t.f90 +++ b/src/libflap/flap_command_line_arguments_group_t.f90 @@ -579,7 +579,7 @@ subroutine sanitize_defaults(self) !--------------------------------------------------------------------------------------------------------------------------------- endsubroutine sanitize_defaults - elemental subroutine clasg_assign_clasg(lhs, rhs) + subroutine clasg_assign_clasg(lhs, rhs) !--------------------------------------------------------------------------------------------------------------------------------- !< Assignment operator. !--------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/libflap/flap_command_line_interface_t.F90 b/src/libflap/flap_command_line_interface_t.F90 index b194f516..b63f9be3 100644 --- a/src/libflap/flap_command_line_interface_t.F90 +++ b/src/libflap/flap_command_line_interface_t.F90 @@ -218,9 +218,8 @@ subroutine add_group(self, help, description, exclude, group) clasg_list_new(Ng)%description = descriptiond clasg_list_new(Ng)%group = group clasg_list_new(Ng)%m_exclude = excluded - deallocate(self%clasg) - allocate(self%clasg(0:Ng)) - self%clasg = clasg_list_new + if (allocated(self%clasg)) deallocate(self%clasg) + allocate(self%clasg(lbound(clasg_list_new,1):ubound(clasg_list_new,1)), source=clasg_list_new) deallocate(clasg_list_new) endif return @@ -1707,7 +1706,7 @@ subroutine errored(self, error, pref, group, switch) !--------------------------------------------------------------------------------------------------------------------------------- endsubroutine errored - elemental subroutine cli_assign_cli(lhs, rhs) + subroutine cli_assign_cli(lhs, rhs) !--------------------------------------------------------------------------------------------------------------------------------- !< Assignment operator. !--------------------------------------------------------------------------------------------------------------------------------- @@ -1719,7 +1718,10 @@ elemental subroutine cli_assign_cli(lhs, rhs) ! object members call lhs%assign_object(rhs) ! command_line_interface members - if (allocated(rhs%clasg )) lhs%clasg = rhs%clasg + if (allocated(rhs%clasg)) then + if (allocated(lhs%clasg)) deallocate(lhs%clasg) + allocate(lhs%clasg(lbound(rhs%clasg,1):ubound(rhs%clasg,1)), source=rhs%clasg) + endif if (allocated(rhs%examples)) lhs%examples = rhs%examples lhs%disable_hv = rhs%disable_hv return