Testing Page

  1. We try to touch a file in /tmp/. Remember that you have to use chmod go+rwx WebTrilinos/tmp, since PHP does not operate as "you". If nothing is reported below, this test is fine. "; echo "

    can't open file: CHECK PERMISSIONS by executing the command:"; echo "
    chmod go+rwx $WebTrilinosDirectory/tmp"; echo "
    then reload this page."; echo ""; } fclose($ourFileHandle); ?>

  2. We try to touch a file in and . Remember that you have to use chmod go+rwx , then chmod go+rwx , since PHP does not operate as "you". If nothing is reported below, this test is fine. "; echo "

    can't open file: CHECK PERMISSIONS by executing the command:"; echo "
    chmod go+rwx $HBMatrixDirectory"; echo "
    then reload this page."; echo "
    Last PHP error that occured: $php_errormsg"; echo ""; } fclose($ourFileHandle); $ourFileName = $XMLMatrixDirectory . "/delete.me"; if (!$ourFileHandle = fopen($ourFileName, 'w')) { echo ""; echo "

    can't open file: CHECK PERMISSIONS by executing the command:"; echo "
    chmod go+rwx $HBMatrixDirectory"; echo "
    then reload this page."; echo "
    "; } fclose($ourFileHandle); ?>

  3. We now try to execute a simple c++ program. The program is:
    #include 
    
    int main(int argc, char* argv[])
    {
      std::cout << "Hello, WebTrilinos World!" << std::endl;
      return(EXIT_SUCCESS);
    }
    
    The output is reported below, and it should contain the hello message. If it does not, please check your installation, then reload this page. Problems may arise from incorrect location of header files, LDFLAGS, or LIBS.
    \n";
    $program .= "int main(int argc, char* argv[]) {\n";
    $program .= '  std::cout << "Hello, WebTrilinos World!" << std::endl;';
    $program .= " return(EXIT_SUCCESS); } \n";
    
    global $TempDirectory;
    global $CXX;
    
    $timestamp = date("y-m-d_H.i.s", time());
    
    $configFileName = "$TempDirectory/WebTrilinos/$timestamp.cpp";
    $configExe = "$TempDirectory/WebTrilinos/test1-$timestamp.exe";
    if(!is_dir("$TempDirectory/WebTrilinos"))
      mkdir("$TempDirectory/WebTrilinos", 0777);
    
    $configFile = fopen($configFileName, 'w')
      or die("can't open $configFileName: $php_errormsg");
    if (-1 == fwrite($configFile, $program)) { 
      die("can't write to $configFileName: $php_errormsg"); }
    fclose($configFile);
    
    echo "";
    passthru("$CXX $configFileName -o $configExe 2>&1 && $configExe 2>&1");
    passthru("/bin/rm -f $configExe");
    echo "";
    
    ?>
    


  4. We now try to execute a simple c++ program that uses Epetra. The program is:
    #include 
    #include "Epetra_ConfigDefs.h"
    #include "Epetra_SerialComm.h"
    
    int main(int argc, char* argv[])
    {
      Epetra_SerialComm Comm;
      std::cout << Comm;
      return(EXIT_SUCCESS);
    }
    
    The output is reported below, and it should contain the printout of the Epetra communicator object. If it does not, please check your installation, then reload this page. Recall that you need to make install Trilinos to use WebTrilinos. Problems may arise from the incorrect location of header files, LDFLAGS, LIBS.
    \n";
    $program .= '#include "Epetra_ConfigDefs.h"' . "\n";
    $program .= '#include "Epetra_SerialComm.h"' . "\n";
    $program .= "int main(int argc, char* argv[]) {\n";
    $program .= 'Epetra_SerialComm Comm;std::cout << Comm;';
    $program .= " return(EXIT_SUCCESS); } \n";
    
    global $TempDirectory;
    global $INCLUDES;
    global $LDFLAGS;
    global $LIBS;
    global $CXX;
    
    $timestamp = date("y-m-d_H.i.s", time());
    
    $configFileName = "$TempDirectory/WebTrilinos/$timestamp.cpp";
    $configExe = "$TempDirectory/WebTrilinos/test2-$timestamp.exe";
    if(!is_dir("$TempDirectory/WebTrilinos"))
      mkdir("$TempDirectory/WebTrilinos", 0777);
    
    $configFile = fopen($configFileName, 'w')
      or die("can't open $configFileName: $php_errormsg");
    if (-1 == fwrite($configFile, $program)) { 
      die("can't write to $configFileName: $php_errormsg"); }
    fclose($configFile);
    
    echo "";
    passthru("$CXX $configFileName $INCLUDES $LDFLAGS $LIBS -o $configExe 2>&1 &&
    $configExe 2>&1");
    passthru("/bin/rm -f $configExe");
    echo "";
    
    ?>
    


  5. We now try to execute a simple c++ program that uses Epetra. The program is:
    #include 
    #include "Epetra_ConfigDefs.h"
    #include "Epetra_SerialComm.h"
    
    int main(int argc, char* argv[])
    {
      Epetra_SerialComm Comm;
      std::cout << Comm;
      return(EXIT_SUCCESS);
    }
    
    The output is reported below, and it should contain the printout of the Epetra communicator object. If it does not, please check your installation, then reload this page.
    \n";
    $program .= '#include "Epetra_ConfigDefs.h"' . "\n";
    $program .= '#include "Epetra_SerialComm.h"' . "\n";
    $program .= "int main(int argc, char* argv[]) {\n";
    $program .= 'Epetra_SerialComm Comm;std::cout << Comm;';
    $program .= " return(EXIT_SUCCESS); } \n";
    
    global $TempDirectory;
    global $INCLUDES;
    global $LDFLAGS;
    global $LIBS;
    global $CXX;
    
    $timestamp = date("y-m-d_H.i.s", time());
    
    $configFileName = "$TempDirectory/WebTrilinos/$timestamp.cpp";
    $configExe = "$TempDirectory/WebTrilinos/test3-$timestamp.exe";
    if(!is_dir("$TempDirectory/WebTrilinos"))
      mkdir("$TempDirectory/WebTrilinos", 0777);
    
    $configFile = fopen($configFileName, 'w')
      or die("can't open $configFileName: $php_errormsg");
    if (-1 == fwrite($configFile, $program)) { 
      die("can't write to $configFileName: $php_errormsg"); }
    fclose($configFile);
    
    passthru("$CXX $configFileName $INCLUDES $LDFLAGS $LIBS -o $configExe 2>&1 &&
    $configExe 2>&1");
    passthru("/bin/rm -f $configExe");
    
    ?>
    




  6. We now try a basic PyTrilinos command, by executing the instruction python -c "from PyTrilinos import Epetra; comm = Epetra.PyComm(); print comm". You should see something like ::Processor 0 of 1 total processors. If you don't see it, check your installation. Please also verify that the are no line breaks in your
    &1';
    echo "";
    passthru($command);
    echo "";
    ?>
    


  7. We now try to import all the required PyTrilinos packages, by executing the instruction python -c "from PyTrilinos import Epetra, EpetraExt, Amesos, IFPACK, AztecOO, ML. Nothing should be printed on screen; if an error arises, please check your installation.
     &1';
    echo "";
    passthru($command);
    echo "";
    ?>
    


If everything is fine, then you should be able to use WebTrilinos! Go back to the installed WebTrilinos page and test the C++, Python and MatrixPortal module!

For more details, please check the official WebTrilinos' web page.