コード例 #1
0
ファイル: ert_module_test.c プロジェクト: Ensembles/ert
int check_module( rng_type * rng , const char * lib_name ) {
  analysis_module_load_status_enum  load_status;
  analysis_module_type * module = analysis_module_alloc_external__( rng , lib_name , false , &load_status);
  if (module != NULL) {
    printf("Module loaded successfully\n");
    analysis_module_free( module );
    return 0;
  } else {
    if (load_status == DLOPEN_FAILURE) {
      printf("\ndlerror(): %s\n\n",dlerror());
      printf("The runtime linker could not open the library:%s.\n", lib_name);
      printf("For the runtime linker to succesfully open your library\n");
      printf("at least one of two must be satisfied: \n\n");
      printf("  1. You give the FULL PATH to library - including .so extension\n\n");
      printf("  2. The path containing the library is in LD_LIBRARY_PATH.\n\n");
      printf("In addition all libraries needed by your module must be found\n");
    } else if (load_status == LOAD_SYMBOL_TABLE_NOT_FOUND) {
      printf("\nThe library %s was loaded successfully, however\n",lib_name);
      printf("the symbol table:\'%s\' was not found. You must make sure\n",EXTERNAL_MODULE_NAME);
      printf("that the \'analysis_table_type\' structure at the bottom\n");
      printf("of the source file is named exactly: \'analysis_table\'.\n");
      printf("See documentation of \'symbol_table\' in modules.txt.\n\n");
    }
  }
  return 1;
}
コード例 #2
0
ファイル: analysis_module.c プロジェクト: danielfmva/ert
analysis_module_type * analysis_module_alloc_external( rng_type * rng , const char * user_name , const char * lib_name) {
  analysis_module_load_status_enum load_status;
  return analysis_module_alloc_external__( rng , user_name , lib_name , true , &load_status);
}