1 Reply Latest reply: Oct 1, 2013 11:30 AM by nkcopty RSS

    Problem running OpenMP program via Oracle Studio on RHEL5 64bit

    45712a16-b1ac-4a4a-9d1d-8f004949f735

      /*

      * File:   main.cpp

      * Author: onama

      Hi all, i am facing problem wile executing the following code:
      *

      * Created on September 24, 2013, 6:17 AM

      */

       

      #include <cstdlib>

      #include<stdio.h>

      #include<omp.h>

      using namespace std;

       

      /*

      *

      */

      int main(int argc, char** argv) {

          int i=0;

         // system("export OMP_NUM_THREADS=2");

      #pragma omp parallel ()

          {

           omp_get_thread_num();

          printf("Hellowqdwq %d");

       

          }

         

      }


      enabled multithreading support via ProjectProperties>C Compiler>Multithreading Level>(set to OPENMP):
      error:

      dmake: defaulting to parallel mode.

      See the man page dmake(1) for more information on setting up the .dmakerc file.

      "/opt/oracle/solarisstudio12.3/bin/dmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf

      "/opt/oracle/solarisstudio12.3/bin/dmake"  -f nbproject/Makefile-Debug.mk dist/Debug/OracleSolarisStudio-Linux-x86/cppapplication_1

      mkdir -p dist/Debug/OracleSolarisStudio-Linux-x86

      CC    -o dist/Debug/OracleSolarisStudio-Linux-x86/cppapplication_1 build/Debug/OracleSolarisStudio-Linux-x86/main.o 

      mkdir -p dist/Debug/OracleSolarisStudio-Linux-x86

      CC    -o dist/Debug/OracleSolarisStudio-Linux-x86/cppapplication_1 build/Debug/OracleSolarisStudio-Linux-x86/main.o 

      build/Debug/OracleSolarisStudio-Linux-x86/main.o: In function `main':

      /state/partition1/apps/ONAMA/SolStudioProjects/CppApplication_1//main.cpp:21: undefined reference to `omp_get_thread_num'

      *** Error code 2

      dmake: Fatal error: Command failed for target `dist/Debug/OracleSolarisStudio-Linux-x86/cppapplication_1'

      Current working directory /state/partition1/apps/ONAMA/SolStudioProjects/CppApplication_1

      *** Error code 1

      dmake: Fatal error: Command failed for target `.build-conf'

      Current working directory /state/partition1/apps/ONAMA/SolStudioProjects/CppApplication_1

      *** Error code 1

      dmake: Fatal error: Command failed for target `.build-impl'

       

      BUILD FAILED (exit value 1, total time: 1s)

       

       

       

      error