-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a351aa2
commit 56ba06c
Showing
26 changed files
with
309 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['lbfgsb_main', files('lbfgsb_main.F')]] | ||
cutest_tests += [['lbfgsb_test', files('lbfgsb_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['lincoa_main', files('lincoa_main.F90')]] | ||
cutest_tests += [['lincoa_test', files('lincoa_test.F90')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cutest_c_binaries += [['loqo_main_c', files('loqo_main.c')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['minos_main', files('minos_main.F')]] | ||
cutest_tests += [['minos_test', files('minos_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['newuoa_main', files('newuoa_main.F90')]] | ||
cutest_tests += [['newuoa_test', files('newuoa_test.F90')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['nitsol_main', files('nitsol_main.F')]] | ||
cutest_tests += [['nitsol_test', files('nitsol_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['nlpqlp_main', files('nlpqlp_main.F')]] | ||
cutest_tests += [['nlpqlp_test', files('nlpqlp_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cutest_c_binaries += [['nomad_main_c', files('nomad_main.c')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['npsol_main', files('npsol_main.F')]] | ||
cutest_tests += [['npsol_test', files('npsol_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_c_binaries += [['osqp_main_c', files('osqp_main.c')]] | ||
cutest_c_tests += [['osqp_test_c', files('osqp_test.c')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['pds_main', files('pds_main.F')]] | ||
cutest_tests += [['pds_test', files('pds_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['pennlp_main', files('pennlp_main.F')]] | ||
cutest_tests += [['pennlp_test', files('pennlp_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['praxis_main', files('praxis_main.F')]] | ||
cutest_tests += [['praxis_test', files('praxis_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['ql_main', files('ql_main.F')]] | ||
cutest_tests += [['ql_test', files('ql_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cutest_binaries += [['qplib_main', files('qplib_main.F90')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['ral_nlls_main', files('ral_nlls_main.F90')]] | ||
cutest_tests += [['ral_nlls_test', files('ral_nlls_test.F90')]] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['snopt_main', files('snopt_main.F')]] | ||
cutest_tests += [['snopt_test', files('snopt_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['spg_main', files('spg_main.F')]] | ||
cutest_tests += [['spg_test', files('spg_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['sqic_main', files('sqic_main.F90')]] | ||
cutest_tests += [['sqic_test', files('sqic_test.F90')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cutest_binaries += [['stats_main', files('stats_main.F90')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cutest_binaries += [['stenmin_main', files('stenmin_main.F')]] | ||
cutest_tests += [['stenmin_test', files('stenmin_test.F')]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#ifdef REAL_32 | ||
#define cutest_delegate_r cutest_delegate_s | ||
#define LOAD_ROUTINE_NAME "load_routines_s_" | ||
#define ELFUN_BIND_NAME "elfun_s_" | ||
#define GROUP_BIND_NAME "group_s_" | ||
#define RANGE_BIND_NAME "range_s_" | ||
#elif REAL_128 | ||
#define cutest_delegate_r cutest_delegate_q | ||
#define LOAD_ROUTINE_NAME "load_routines_q" | ||
#define ELFUN_BIND_NAME "elfun_q_" | ||
#define GROUP_BIND_NAME "group_q_" | ||
#define RANGE_BIND_NAME "range_q_" | ||
#else | ||
#define cutest_delegate_r cutest_delegate_d | ||
#define LOAD_ROUTINE_NAME "load_routines_" | ||
#define ELFUN_BIND_NAME "elfun_" | ||
#define GROUP_BIND_NAME "group_" | ||
#define RANGE_BIND_NAME "range_" | ||
#endif | ||
|
||
module cutest_delegate_r | ||
use, intrinsic :: iso_c_binding | ||
implicit none | ||
|
||
! Interface pour dlopen | ||
interface | ||
function dlopen(name, mode) bind(C, name="dlopen") | ||
use iso_c_binding, only: c_ptr, c_int, c_char | ||
type(c_ptr) :: dlopen | ||
character(kind=c_char), dimension(*) :: name | ||
integer(kind=c_int) :: mode | ||
end function dlopen | ||
end interface | ||
|
||
! Interface pour dlsym | ||
interface | ||
function dlsym(handle, symbol) bind(C, name="dlsym") | ||
use iso_c_binding, only: c_funptr, c_ptr, c_char | ||
type(c_funptr) :: dlsym | ||
type(c_ptr), value :: handle | ||
character(kind=c_char), dimension(*) :: symbol | ||
end function dlsym | ||
end interface | ||
|
||
! Constantes pour les modes d'ouverture de bibliothèques | ||
integer, parameter :: RTLD_LAZY = 1 | ||
|
||
! Handles pour les fonctions externes | ||
type(c_ptr) :: lib_handle | ||
type(c_funptr) :: ptr_elfun | ||
type(c_funptr) :: ptr_group | ||
type(c_funptr) :: ptr_range | ||
|
||
! Pointeurs de procédure pour les fonctions externes | ||
procedure(), pointer :: fun_elfun => null() | ||
procedure(), pointer :: fun_group => null() | ||
procedure(), pointer :: fun_range => null() | ||
|
||
contains | ||
|
||
! Routine pour charger les routines depuis la bibliothèque dynamique | ||
subroutine load_routines(libname) bind(C, name=LOAD_ROUTINE_NAME) | ||
use iso_c_binding | ||
implicit none | ||
character(kind=c_char), dimension(*), intent(in) :: libname | ||
|
||
! Charge la bibliothèque dynamique | ||
lib_handle = dlopen(libname, RTLD_LAZY) | ||
if (.not. c_associated(lib_handle)) then | ||
stop "Unable to load library" | ||
end if | ||
|
||
! Récupère les adresses des fonctions | ||
ptr_elfun = dlsym(lib_handle, "elfun"//c_null_char) | ||
ptr_group = dlsym(lib_handle, "group"//c_null_char) | ||
ptr_range = dlsym(lib_handle, "range"//c_null_char) | ||
|
||
! Associe les pointeurs de procédure Fortran avec les adresses obtenues | ||
call c_f_procpointer(ptr_elfun, fun_elfun) | ||
call c_f_procpointer(ptr_group, fun_group) | ||
call c_f_procpointer(ptr_range, fun_range) | ||
end subroutine load_routines | ||
|
||
! Routine pour appeler la fonction elfun | ||
subroutine elfun() bind(C, name=ELFUN_BIND_NAME) | ||
if (associated(fun_elfun)) then | ||
call fun_elfun() | ||
else | ||
print *, "Error: fun_elfun is not associated." | ||
end if | ||
end subroutine elfun | ||
|
||
! Routine pour appeler la fonction group | ||
subroutine group() bind(C, name=GROUP_BIND_NAME) | ||
if (associated(fun_group)) then | ||
call fun_group() | ||
else | ||
print *, "Error: fun_group is not associated." | ||
end if | ||
end subroutine group | ||
|
||
! Routine pour appeler la fonction range | ||
subroutine range() bind(C, name=RANGE_BIND_NAME) | ||
if (associated(fun_range)) then | ||
call fun_range() | ||
else | ||
print *, "Error: fun_range is not associated." | ||
end if | ||
end subroutine range | ||
|
||
end module cutest_delegate_r |
Oops, something went wrong.