Ralph Castain avatar Ralph Castain committed 27dc0e6

Cleanup a warning - if we are doing linkall and cannot find either static or dynamic libs, than that is clearly an unrecoverable error. Print a nice message and exit.

Comments (0)

Files changed (1)

opal/tools/wrappers/opal_wrapper.c

         bool have_static_lib;
         bool have_dyn_lib;
         bool use_static_libs;
-        char *filename;
+        char *filename1, *filename2;
         struct stat buf;
 
         opal_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].link_flags);
 
         */
 
-        filename = opal_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].static_lib_file, NULL );
-        if (0 == stat(filename, &buf)) {
+        filename1 = opal_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].static_lib_file, NULL );
+        if (0 == stat(filename1, &buf)) {
             have_static_lib = true;
         } else {
             have_static_lib = false;
         }
 
-        filename = opal_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].dyn_lib_file, NULL );
-        if (0 == stat(filename, &buf)) {
+        filename2 = opal_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].dyn_lib_file, NULL );
+        if (0 == stat(filename2, &buf)) {
             have_dyn_lib = true;
         } else {
             have_dyn_lib = false;
                static or dynamic form. */
             if (have_static_lib || have_dyn_lib) {
                 use_static_libs = true;
+            } else {
+                fprintf(stderr, "The linkall option has failed as we were unable to find either static or dynamic libs\n"
+                        "Files looked for:\n  Static: %s\n  Dynamic: %s\n",
+                        filename1, filename2);
+                free(filename1);
+                free(filename2);
+                exit(1);
             }
         } else if (flags & COMP_WANT_STATIC) {
             /* If --static (or something like it) was specified, if we
                 use_static_libs = true;
             }
         }
+        free(filename1);
+        free(filename2);
 
         if (use_static_libs) {
             opal_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].libs_static);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.