SunStudio on Linux: wctype.h issues

This is a follow-up question about compiling R using SunStudio12.1 on Linux.
R install guide indicates that:
"The OS needs to have enough support for wide-character types: this is checked at configuration.
specifically, the C99 functionality of headers wchar.h and wctype.h, types wctans_t and mbstate_t and functions mbrtowc, mbstowcs, wcrtomb, wcscoll, wcstombs, wctrans, wctype, and iswctype."
With suncc on Linux, the ./configure stops with the following error message:
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for iconv... in libiconv
checking whether iconv accepts "UTF-8", "latin1" and "UCS-*"... yes*
checking for iconvlist... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking whether mbrtowc exists and is declared... yes
checking whether wcrtomb exists and is declared... yes
checking whether wcscoll exists and is declared... yes
checking whether wcsftime exists and is declared... yes
checking whether wcstod exists and is declared... yes
checking whether mbstowcs exists and is declared... yes
checking whether wcstombs exists and is declared... yes
**checking whether wctrans exists and is declared... no*
checking whether iswblank exists and is declared... no
checking whether wctype exists and is declared... no
checking whether iswctype exists and is declared... no
configure: error: Support for MBCS locales is required.
RT

Thanks for your instructions.On my openSUSE 11.2 system,
run the first command
CC -E z.cc | grep wint_t I don't see any typedef
extern int iswalnum ( wint_t __wc ) ;
extern int iswalpha ( wint_t __wc ) ;
extern int iswcntrl ( wint_t __wc ) ;
extern int iswdigit ( wint_t __wc ) ;
extern int iswgraph ( wint_t __wc ) ;
extern int iswlower ( wint_t __wc ) ;
extern int iswprint ( wint_t __wc ) ;
extern int iswpunct ( wint_t __wc ) ;
extern int iswspace ( wint_t __wc ) ;
extern int iswupper ( wint_t __wc ) ;
extern int iswxdigit ( wint_t __wc ) ;
extern int iswblank ( wint_t __wc ) ;
extern int iswctype ( wint_t __wc , wctype_t __desc ) ;
extern wint_t towlower ( wint_t __wc ) ;
extern wint_t towupper ( wint_t __wc ) ;
extern wint_t towctrans ( wint_t __wc , wctrans_t __desc ) ;
extern int iswalnum_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswalpha_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswcntrl_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswdigit_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswgraph_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswlower_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswprint_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswpunct_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswspace_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswupper_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswxdigit_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswblank_l ( wint_t __wc , __locale_t __locale ) ;
extern int iswctype_l ( wint_t __wc , wctype_t __desc , __locale_t __locale )
extern wint_t towlower_l ( wint_t __wc , __locale_t __locale ) ;
extern wint_t towupper_l ( wint_t __wc , __locale_t __locale ) ;
extern wint_t towctrans_l ( wint_t __wc , wctrans_t __desc ,
using :: wint_t ; then run the second command
CC -H -c z.cc I get a lot of errors
/opt/sun/sunstudio12.1/prod/include/cc/wctype.h
     /usr/include/wctype.h
          /opt/sun/sunstudio12.1/prod/include/cc/features.h
               /usr/include/features.h
                    /opt/sun/sunstudio12.1/prod/include/cc/sys/cdefs.h
                         /usr/include/sys/cdefs.h
                              /usr/include/bits/wordsize.h
                    /usr/include/gnu/stubs.h
                         /usr/include/bits/wordsize.h
                         /usr/include/gnu/stubs-32.h
          /usr/include/bits/types.h
               /usr/include/bits/wordsize.h
               /usr/include/bits/typesizes.h
          /opt/sun/sunstudio12.1/prod/include/cc/stddef.h
               /opt/sun/sunstudio12.1/prod/include/cc/sys/isa_defs.h
          /usr/include/endian.h
               /usr/include/bits/endian.h
               /usr/include/bits/byteswap.h
"/usr/include/wctype.h", line 112: Error: wint_t is not defined.
"/usr/include/wctype.h", line 112: Error: __wc is not defined.
"/usr/include/wctype.h", line 112: Error: Badly formed expression.
"/usr/include/wctype.h", line 118: Error: wint_t is not defined.
"/usr/include/wctype.h", line 118: Error: __wc is not defined.
"/usr/include/wctype.h", line 118: Error: Badly formed expression.
"/usr/include/wctype.h", line 121: Error: wint_t is not defined.
"/usr/include/wctype.h", line 121: Error: __wc is not defined.
"/usr/include/wctype.h", line 121: Error: Badly formed expression.
"/usr/include/wctype.h", line 125: Error: wint_t is not defined.
"/usr/include/wctype.h", line 125: Error: __wc is not defined.
"/usr/include/wctype.h", line 125: Error: Badly formed expression.
"/usr/include/wctype.h", line 129: Error: wint_t is not defined.
"/usr/include/wctype.h", line 129: Error: __wc is not defined.
"/usr/include/wctype.h", line 129: Error: Badly formed expression.
"/usr/include/wctype.h", line 134: Error: wint_t is not defined.
"/usr/include/wctype.h", line 134: Error: __wc is not defined.
"/usr/include/wctype.h", line 134: Error: Badly formed expression.
"/usr/include/wctype.h", line 137: Error: wint_t is not defined.
"/usr/include/wctype.h", line 137: Error: __wc is not defined.
"/usr/include/wctype.h", line 137: Error: Badly formed expression.
"/usr/include/wctype.h", line 142: Error: wint_t is not defined.
"/usr/include/wctype.h", line 142: Error: __wc is not defined.
"/usr/include/wctype.h", line 142: Error: Badly formed expression.
"/usr/include/wctype.h", line 147: Error: wint_t is not defined.
Compilation aborted, too many Error messages.

Similar Messages

  • Where can I find the right doc for SunStudio For Linux ?

    I can find the docs for SunStudio here, http://docs.sun.com/app/docs/doc/819-5265/6n7c29ck9?a=view
    but it seems that it doesn't right on linux platform.
    #include <stdio.h>
    int main(void)
    #if defined(sun)
            printf("sun defined \n");
    #else
            printf("sun undefined \n");
    #endif
    #if defined(unix)
            printf("unix defined \n");
    #else
            printf("unix undefined \n");
    #endif
    #if defined(sparc)
            printf("sparc defined \n");
    #else
            printf("sparc undefined \n");
    #endif
    #if defined(i386)
            printf("i386 defined \n");
    #else
            printf("i386 undefined \n");
    #endif
    #if defined(__sun)
            printf("__sun defined \n");
    #else
            printf("__sun undefined \n");
    #endif
    #if defined(__unix)
            printf("__unix defined \n");
    #else
            printf("__unix undefined \n");
    #endif
    #if defined(__SUNPRO_C)
            printf("__SUNPRO_C defined \n");
    #else
            printf("__SUNPRO_C undefined \n");
    #endif
    #if defined(__sparc)
            printf("__sparc defined \n");
    #else
            printf("__sparc undefined \n");
    #endif
    #if defined(__i386)
            printf("__i386 defined \n");
    #else
            printf("__i386 undefined \n");
    #endif
    #if defined(__SVR4)
            printf("__SVR4 defined \n");
    #else
            printf("__SVR4 undefined \n");
    #endif
            return 0;
    }[luoyi@qpd06 test]$ suncc -o test test.c
    [luoyi@qpd06 test]$ ./test
    sun undefined
    unix defined
    sparc undefined
    i386 undefined
    __sun undefined
    __unix defined
    __SUNPRO_C defined
    __sparc undefined
    __i386 undefined
    __SVR4 undefined
    where can I found the correct docs for SunStudio For Linux ?

    You can refer to cc man pages. Here is about predefinitions:
    Predefinitions:unix
    sparc (SPARC)
    i386 (x86)
    sun
    The above are not predefined in -Xc mode.
    These predefinitions are valid in all modes:
    __BUILTIN_VA_ARG_INCR
    __SUNPRO_C=0x590
    __SVR4(SPARC)
    __SunOS(Solaris)
    __SunOS_OSN.N(Solaris)
    __amd64(x86 with-m64)
    __gnu__linux(linux)
    __i386(x86)
    __linux(linux)
    __linux__(linux)
    __sparc(SPARC)
    __sparcv9(with-m64)
    __sun(Solaris)
    __unix
    __�uname -s�_�uname -r�
    __x86_64(x86)
    linux(x86,linux)
    The following is predefined in -Xa and -Xt modes only:
    __RESTRICT
    The compiler also predefines the object-like macro
    __PRAGMA_REDEFINE_EXTNAME,
    to indicate the pragma will be recognized.
    ...

  • SunStudio on Linux: C functions are not in std:: namespace

    Hi,
    i'm using SunStudio 12 compilers on a Debian Etch x86 host and have some compilation problems.
    The compilers complains that C functions are not in std:: but only in the global namespace.
    I thought the standard was that they are in both namespaces.
    I suspect the issue may be related to system headers since the problem never occured with Sarge nor Solaris.
    Anyone as some hint to solve this problem ?
    I there a "clean" workaround ?
    Thanks,
    Aurelien

    Let me clarify Paul's comments.
    If you include a C-style header like <stdio.h>, you should get names in both namespace std and in the global namespace.
    That is, the following program should compile with Sun C++: #include <stdio.h>
    int main()
        std::printf("Hello ");
        printf("world!\n");
    }If you include the C++ versions of the C headers, like <cstdio>, using Sun C++ you get names only in namespace std -- except on Linux.
    The g++ compiler, particularly on Linux, does not follow the same rules. The <stdio.h> header puts names only in the global namespace, and <cstdio> puts names in both namespaces. To allow compilation of programs on Linux that compile with g++, Sun C++ tends to follow g++ rules where they are looser than what the C++ Standard says. (For some definition of "looser".)
    The most portable approach is to use the <xxx.h> C-style headers, and do not qualify the names from the headers with "std::".
    That is, the following program should compile everywhere: #include <stdio.h>
    int main()
        printf("Hello ");
        printf("world!\n");
    }

  • E-Business Linux Post Migration Issues.

    Hi All,
    We have recently finished migration of one of our Release 12.1.1 instance from Solaris to linux 64 bit. We have been facing issues with the binaries not executing and relinking issues. FNDCPASS is not changing the password for oracle users or apps user. It says "concurrent request completed" and ends out. But doesn't change the password. I tried relinking the binaries using adadmin. but adrelink fails for BOM,WIP and FEM products. Following is the error that I get while relinking.
    Starting link of bom executable 'CTOCLT' on Mon Feb 20 11:46:45 IST 2012
    gcc -m32 -g -L/d02/DEVFNA/apps/tech_st/10.1.2/lib
    -L/d02/DEVFNA/apps/tech_st/10.1.2/lib/stubs -ldl -o
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin/CTOCLT
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/ctoclt.o \
              /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/libbom.a
    /d02/DEVFNA/apps/apps_st/appl/inv/12.0.0/lib/libinv.a
    /d02/DEVFNA/apps/apps_st/appl/wip/12.0.0/lib/libwip.a \
              /d02/DEVFNA/apps/apps_st/appl/po/12.0.0/lib/libpo.a
    /d02/DEVFNA/apps/apps_st/appl/ar/12.0.0/lib/libar.a
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/libbom.a
    /d02/DEVFNA/apps/apps_st/appl/mrp/12.0.0/lib/libmrp.a \
              /d02/DEVFNA/apps/apps_st/appl/fnd/12.0.0/lib/libfnd.a -lsql10
    -lclntsh `cat /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10
    -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10
    -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10
    -lgeneric10 -lmm -lcore10 -lxml10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10
    `cat /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10
    -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10
    -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10
    -lgeneric10 -lcore10 -lxml10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10
    -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lcore10 -lxml10
    -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/sysliblist` -ldl -lm -lpthread
    /d02/DEVFNA/apps/apps_st/appl/wip/12.0.0/lib/libwip.a(wiloer2.o): In function
    `wigtbsf_get_bom_workday_pattern':
    6344867/wip/lib/wiloer2.c:(.text+0xc9a8): undefined reference to
    `wifresf_free_workpattern'
    6344867/wip/lib/wiloer2.c:(.text+0xccaf): undefined reference to
    `wifresf_free_workpattern'
    collect2: ld returned 1 exit status
    make: *** [d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin/CTOCLT] Error 1
    Done with link of bom executable 'CTOCLT' on Mon Feb 20 11:46:46 IST 2012
    Relink of module "CTOCLT" failed.
    See error messages above (also recorded in log file) for possible
    reasons for the failure. Also, please check that the Unix userid
    running adrelink has read, write, and execute permissions
    on the directory /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin,
    and that there is sufficient space remaining on the disk partition
    containing your Oracle Applications installation.
    Similar Error exists with other products too.
    Any ideas.
    Regards
    Anirudha Singh

    We have recently finished migration of one of our Release 12.1.1 instance from Solaris to linux 64 bit. We have been facing issues with the binaries not executing and relinking issues. FNDCPASS is not changing the password for oracle users or apps user. It says "concurrent request completed" and ends out. But doesn't change the password. I tried relinking the binaries using adadmin. but adrelink fails for BOM,WIP and FEM products. Following is the error that I get while relinking.Please post the command you use along with the contents of the log file.
    Did you manage to relinki FNDCPASS successfully?
    Starting link of bom executable 'CTOCLT' on Mon Feb 20 11:46:45 IST 2012
    gcc -m32 -g -L/d02/DEVFNA/apps/tech_st/10.1.2/lib
    -L/d02/DEVFNA/apps/tech_st/10.1.2/lib/stubs -ldl -o
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin/CTOCLT
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/ctoclt.o \
              /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/libbom.a
    /d02/DEVFNA/apps/apps_st/appl/inv/12.0.0/lib/libinv.a
    /d02/DEVFNA/apps/apps_st/appl/wip/12.0.0/lib/libwip.a \
              /d02/DEVFNA/apps/apps_st/appl/po/12.0.0/lib/libpo.a
    /d02/DEVFNA/apps/apps_st/appl/ar/12.0.0/lib/libar.a
    /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/lib/libbom.a
    /d02/DEVFNA/apps/apps_st/appl/mrp/12.0.0/lib/libmrp.a \
              /d02/DEVFNA/apps/apps_st/appl/fnd/12.0.0/lib/libfnd.a -lsql10
    -lclntsh `cat /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10
    -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10
    -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10
    -lgeneric10 -lmm -lcore10 -lxml10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10
    `cat /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10
    -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10
    -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10
    -lgeneric10 -lcore10 -lxml10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10
    -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lcore10 -lxml10
    -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat
    /d02/DEVFNA/apps/tech_st/10.1.2/lib/sysliblist` -ldl -lm -lpthread
    /d02/DEVFNA/apps/apps_st/appl/wip/12.0.0/lib/libwip.a(wiloer2.o): In function
    `wigtbsf_get_bom_workday_pattern':
    6344867/wip/lib/wiloer2.c:(.text+0xc9a8): undefined reference to
    `wifresf_free_workpattern'
    6344867/wip/lib/wiloer2.c:(.text+0xccaf): undefined reference to
    `wifresf_free_workpattern'
    collect2: ld returned 1 exit status
    make: *** [d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin/CTOCLT] Error 1
    Done with link of bom executable 'CTOCLT' on Mon Feb 20 11:46:46 IST 2012
    Relink of module "CTOCLT" failed.
    See error messages above (also recorded in log file) for possible
    reasons for the failure. Also, please check that the Unix userid
    running adrelink has read, write, and execute permissions
    on the directory /d02/DEVFNA/apps/apps_st/appl/bom/12.0.0/bin,
    and that there is sufficient space remaining on the disk partition
    containing your Oracle Applications installation.
    Similar Error exists with other products too. Please check adrelink.log file for details about the error.
    Please see if these docs help.
    MSC Relinking Error on Linux OEL5/RHEL5, Relink of module "MSCCPP" failed, "FEMCCE","MSCNEW","MSCMON". There was No MSC Relink Problem when Worked on RHEL 4 [ID 1128486.1]
    "Relink Of Module Femcce Failed" R12 Errors On Oracle Enterprise Linux 5.2 or Red Hat 5.2 [ID 751250.1]
    Relink Error During Manifest Patch Application During Platform Migration Process [ID 1307460.1]
    Thanks,
    Hussein

  • Oracle Enterprise Linux 5u5 install issue

    Please help.
    I'm trying to install Oracle Enterprise Linux 5u5 on a desktop computer.
    In GUI mode, after the network adapter settings screen i press Next, and the system hangs.
    In Text mode, after the network adapter settings screen i press Next, and the following error is displayed.
    ------------------| Exception Occurred |------------------
    Traceback (most recent call first):
    File
    "/usr/lib/anaconda/textw/timezone_text.py",
    line 33, in getTimezoneList
    zt = zonetab.ZoneTab()
    File
    "/usr/lib/anaconda/textw/timezone_text.py",
    line 61, in __call__
    timezones = self.getTimesoneList()
    File "/usr/lib/anaconda/text.py", line
    582, in run
    rc = win(self.screen, instance)
    File "/usr/bin/anaconda", line 955, in
    <module>
    anaconda.intf.run(anaconda)
    AttributeError: 'module' object has no attribute 'ZoneTab'
    I've tried different languages and different network adapter settings, but I don't think it has something to do with the problem.
    Can anyone tell me what to do to continue the installation?
    Thanks in advance

    Can you provide more information, like what is your desktop system?
    Besides, Enterprise Linux is not designed to work on Desktop or other portable computers. Your Ethernet may not be the only issue.
    You may check the following link:
    https://bugzilla.redhat.com/show_bug.cgi?id=247399
    " I am seeing this behaviour as well on installing Fedora 9 Beta on an older Dell Latitude C840 laptop. I was able to get this error in a subsequent install by skipping the network
    configuration."
    "This really seems like something that could be caused by errors reading the CD media. Could someone who is seeing this take a look at tty4 or /tmp/syslog and see if there are kernel read error messages?"
    Edited by: waldorfm on Nov 1, 2010 11:27 AM

  • Can't connect to AEBS from XP or Linux -- WPA encrytpion issues

    Hello all... New to this forum because not actually an Apple user but, well, I've moved in with someone who is. So I want to be able to connect to her AEBS from my PC, which is usually running Linux, but sometimes Windows XP when necessary. I bought a wireless card (ASUS WL-138G v2, Broadcomm 43xx chipset) and assumed that connecting from Linux might be a bit tricky, but that from Windoze should at least be straightforward. And it isn't. I've seen a lot of similar threads around here, but none that clearly answer the problem... Both XP and Linux can see the SSID, and I know that Linux can pick up the MAC address of the Airport, the channel, etc. but neither are able to connect.
    The issue seems to be to do with the WPA encryption. I tried following the clear step-by-step on ifelix, but we found that (a) the Hex version of the PSK is 64 digits, which is much longer than the Equivalent Network Password example in the step-by-step (256 bit encryption?); and (b) neither that nor the plaintext password worked.
    Similarly, wpa_supplicant under linux offered me nothing -- or error messages about the length of the key, when I tried the whole 64-digit version. iwconfig eth1 key s:xxxxxxxxx ('s' for 'string', followed by the plaintext password) gave a hex version that was only some 26 digits long, i.e. presumably the straightforward 104/128 WEP key... which, of course, didn't work.
    AEBS is running as 802.11n (802.11b/g compatible); administration is from an iMac running OS X Tiger; Airport Utility version 7.0; WPA/WPA2 personal; logs show it's using TKIP; plaintext password is only 10 characters, not 13 -- but that only seems to matter under WEP...(?)
    Airport Utility does offer her the option of running WEP instead of WPA, but I don't see why, ideally, she should need to downgrade her security.
    I'm hoping that if I can find out how to sort this out in 'Doze I can either figure out or find the right help to get it sorted in Linux myself... but I'm out of my depth here. All suggestions -- other than starting from scratch with a shiny new Mac -- gratefully received!

    Hello tortipede. Welcome to the Apple Discussions!
    I'm hoping that if I can find out how to sort this out in 'Doze I can either figure out or find the right help to get it sorted in Linux myself... but I'm out of my depth here. All suggestions -- other than starting from scratch with a shiny new Mac -- gratefully received!
    I do have a few suggestions for you ...
    From either Windows or Linux, can your PC connect to the roommate's 802.11n AirPort Extreme Base Station (AEBSn) if the AEBSn's wireless network is NOT encrypted? If not, can the PC connect to any other wireless network?
    On the Linux-side, I haven't tried the particular distro that you are using, but I have had success with WPA wireless network from both Ubuntu 7.10 (all variations) and PCLinuxOS 2007. For these, I'm using a Linksys 802.11g PC-Card adapter.

  • Sunstudio on Linux using OpenMP

    I am new to use SunStudio.
    Rightnow, I want to use openmp to parallel my code.
    To do that, I begin from simple example.
    PROGRAM calculate
    USE omp_lib
    INTEGER :: i, max_number
    DOUBLE PRECISION :: step, x, value, sum
    DOUBLE PRECISION :: num_steps = 1000000000
    REAL(8) :: start_time, end_time, run_time, timearray1(2), timearray2(2)
    INTEGER :: j
    DOUBLE PRECISION :: y, value2 = 0.0
    INTEGER :: id, nthrds, nthreads
    sum = 0.0
    step = 1.0/num_steps;
    start_time = dtime(timearray1)
    DO  i = 1, int(num_steps), 1
        x = (i - 0.5)*step;
        sum = sum + 4.0/(1.0 + x*x)
    END DO
    value = step*sum
    end_time = dtime(timearray1)
    run_time = end_time - start_time
    write(*,*) 'run_time is ', end_time, 'seconds'
    write(*,*) 'calcuated value is ', value
    WRite(*,*) '-------------------------------'
    write(*,*) '**      Parallel Test      **'
    write(*,*) '-------------------------------'
    max_number = OMP_GET_MAX_THREADS()
    write(*,*) 'Max Threads = ', max_number
    CALL OMP_SET_NUM_THREADS(4)
    sum = 0.0
    start_time = dtime(timearray2)
    !$OMP PARALLEL PRIVATE(id,sum)
    id = OMP_get_thread_num()
         DO j = id + 1, int(num_steps), 4
             y = (j - 0.5)*step
             sum = sum + 4.0/(1.0 + y*y)
         END DO
    !$OMP CRITICAL
         value2 = value2 + sum*step
         write(*,*) "My thread is", ID, "value2 is", value2
    !$OMP END CRITICAL
    !$OMP END PARALLEL
    end_time = dtime(timearray2)
    run_time = end_time - start_time
    write(*,*) value2, end_time
    END PROGRAMCompilation proceed with no errors or warnings. I used 'f95 test.f90 -xopenmp -O3 -fast'
    But the result is strange, it is
    run_time is 10.717370986938477 seconds
    calcuated value is 3.1415926525857966
    ** Parallel Test **
    Max Threads = 4
    My thread is 1 value2 is 0.7853981633965759
    My thread is 0 value2 is 1.57079632680205
    My thread is 3 value2 is 2.3561944891987165
    My thread is 2 value2 is 3.1415926525868203
    3.1415926525868203 11.203296661376953
    looks like not parallel at all, I test the same code by GCC, it did parallel.
    Anybody can help me out? thank you

    Thank you very much, Peter,
    I try your code, the output is strange, the time is wired
    '3.1415926525874704 -188950.34375 '
    I am using RedHat Enterperise Linux 5.
    The purpose here is I want to see how much performance can be improved by openmp, the similar problem coding up by C and compiled by gcc gave
    'using 1000000000 steps to calculate Pi
    num_threads = 1
    pi is 3.141593 in 7.146756 seconds 1 threds
    num_threads = 2
    pi is 3.141593 in 4.289904 seconds 2 threds
    num_threads = 3
    pi is 3.141593 in 2.787567 seconds 3 threds
    num_threads = 4
    pi is 3.141593 in 1.698492 seconds 4 threds
    Thanks again
    Edited by: frankqi on Feb 11, 2009 12:21 PM

  • NON-LINUX "fontmgr.cpp" issue

    I have distributed an executable to about 200 computers throughout my workplace.  2 of them are having an interesting issue.  They get the following error when trying to run the executable.
    Fatal Internal Error : "fontmgr.cpp" line 5803
    LabVIEW version 8.6
    You will lose any unsaved work.  For assistance in resolving this problem, please relaunch LabVIEW, or contact National Instruments.
    Note that these PCs are all Windows 2000 or Windows XP, NOT LINUX.  Everything I've found online says this issue is only with LINUX and to install the 8.6f patch.  I've tried that to no avail.  
    Any ideas?  Thanks.

    Hi,
    I actually wanted to know if there was anything different between the computers that work and those that don't. Do they run the same OS and have the same version of LabVIEW Run Time installed? You mentioned in your first post that some computers were Windows 2000 and others Windows XP.
    And as for the font, could you check that the font you used to develop your application is available on on the deployment computer? If you used the application font this shouldn't be the issue.
    Take care!
    Tanya V
    National Instruments
    LabVIEW Platform Product Support Engineer

  • Windows Dev to LINUX UAT deployment issue - can't log on.

    Hi All,
    I've recently deployed my dev dashboard/webcat to our UAT server ( for the first time ) along with changing the instanceconfig.xml to point to the new webcat directory. when I log in ( as Administrator ), I get the following error on the web page:
    Unable to Log In
    Invalid Handle Of 'PN3saw13security_impl5GroupE' Exception
    Error Details
    Error Codes: Q4NU7XSN
    The sawlog0.log file contains the following:
    Type: Error
    Severity: 30
    Time: Wed Mar 17 14:04:41 2010
    File: project/webbedrock/handle.cpp Line: 21
    Properties: ThreadID-4066503568
    Location:
    saw.security.securityimpl.getPermissions
    saw.subsystem.security.checkAuthenticationImpl
    saw.threadPool
    saw.threads
    Invalid Handle Of 'PN3saw13security_impl5GroupE' Exception
    Can anyone advise on what the problem is? I wondered whether it was a LINUX permissions issue, so tried a chmod -R 777 on the webcat directory.
    Thanks in advance

    For anyone interested, the problem, now resolved, was in the transfer of the webcat directory.
    In the end I ZIPped the webcat directory, transferred the ZIP, then unzipped on the destination server, not copying the web/catalog directory as a series of sub files/folders.

  • X121e Linux Resolution/BIOS Issues

    Hi,
    I posted a few weeks ago about an intermittent resolution my x121e is having. It switches to 1280x800 rather than the correct 136x768. This issue remained for a week, then disappeared, and has now returned. It effects the whole computer, rather than just the linux mint 11 operating system. Terminal commands (xrandr) and grub edits, do not provide a fix. 
    Hence it has been suggested this is likely a BIOS bug relating to graphics or the motherboard. I am considering a resetting BIOS to defaults once I can ensure the effects this will have on the general working of the machine. No edits have been made to the BIOS by me personally so I cannot be sure if it will work.
    Other than the virtual shoulder to cry on, would anyone have any advice on what else might be at issue?
    Or the warranty status pertaining to Linux users?
    Regards,
    Daniel.

    Hello, I have exactly this issue on mine too
    I'm under win7 sp1.
    The issue is visible under bios and win7 rescue mode.
    I have changed drivers and setup win7 again but nothing is working.
    Is this issue known by Lenovo?
    Is there a fix ? a bios # to avoid ?
    Best regards,
    Olivier

  • Oracle 11g on Linux : Query Optimization issue

    Hi guru,
    I am facing one query optimization related problem in group by query
    Table (10 million Records)
    Product(ProductId number,ProductName varchar(100),CategoryId VARCHAR2(38),SubCategoryId VARCHAR2(38))
    Index
    create index idxCategory on Product (CategoryId,SubCategoryId)
    Query1:To find product count for all CategoryId and SubCategoryId
    select CategoryId,SubCategoryId,count(*) from Product group by CategoryId,SubCategoryId
    Above query is not using index idxCategory and doing table scan which is very costly.
    When I fire Query2: select count(*) from Product group by CategoryId,SubCategoryId
    then it is properly using index idxCategory and very fast.
    Even I specified hint in Query1 but it is not using hint.
    Can anybody suggest why oracle is not using index in Query1 and what should I do so that Query1 will use Index.
    Thanks in advance.

    user644199 wrote:
    I am facing one query optimization related problem in group by query
    Query1:To find product count for all CategoryId and SubCategoryId
    select CategoryId,SubCategoryId,count(*) from Product group by CategoryId,SubCategoryId
    Above query is not using index idxCategory and doing table scan which is very costly.
    When I fire Query2: select count(*) from Product group by CategoryId,SubCategoryId
    then it is properly using index idxCategory and very fast.
    Even I specified hint in Query1 but it is not using hint.
    Can anybody suggest why oracle is not using index in Query1 and what should I do so that Query1 will use Index.The most obvious reason that the table needs to be visited would be that the columns "CategoryId" / "SubCategoryId" can be NULL but then this should apply to both queries. You could try the following to check the NULL issue:
    select CategoryId,SubCategoryId,count(*) from Product where CategoryId is not null and SubCategoryId is not null group by CategoryId,SubCategoryId
    Does this query use the index?
    Can you show us the hint you've used to force the index usage and the EXPLAIN PLAN output of the two queries including the "Predicate Information" section? Use DBMS_XPLAN.DISPLAY to get a proper output, and use the \ tag before and after when posting here to format it using fixed font. Use the "Quote" button in the message editor to see how I used the \ tag here.
    Are above queries representing the actual queries used or did you omit some predicates etc. for simplicity?
    By the way, VARCHAR2(38) and ...ID as name, are these columns storing number values?
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Linux JDBC connectivity issues

    I am having trouble in connecting to 9i RAC via JDBC. The same sample application works well with windows/sun OS. In linux it returns Network Adapter error.I am using ojdbc14.jar to connect to DB.
    Appreciate your replies.
    Thanks.

    Saro,
    Do you also have 9i RAC on your Windows/SUN machines -- where you claim this application worked?
    Perhaps you could provide the entire error message (and stack trace) you are getting, as well as the section of your code that is causing the error?
    Assuming I am correctly guessing what your error message is, "Network Adapter" errors are usually caused because of an incorrect (database connection) URL.
    You should find example URLs for RAC if you search this forum's archives.
    Good Luck,
    Avi.

  • Sql query extremely slow in the new linux environment , memory issues?

    We just migrated to a new dev environment in Linux REDHAT5, and now the query is very slow, and I used the TOAD to run the query, it took like 700 msecond to finish, however from any server connection, the sql query takes hours to finish.
    I checked toad monitor, it said need to increase db_buffer_cache and shared pool too small.
    Also three red alert from toad is:
    1. Library Cache get hit ratio: Dynamic or unsharable sql
    2. Chained fetch ratio: PCT free too low for a table
    3. parse to execute ratio: HIgh parse to execute ratio.
    App team said it ran real quick in the old AIX system, however I ran it in old system, and monitored in the toad, it gave me all same 5 red alerts in old system, and it did provide query results a lot quicker though.
    Here is the parameters in the old system (11gr1 on AIX):
    SQL> show parameter target
    NAME TYPE VALUE
    archive_lag_target integer 0
    db_flashback_retention_target integer 1440
    fast_start_io_target integer 0
    fast_start_mttr_target integer 0
    memory_max_target big integer 0
    memory_target big integer 0
    pga_aggregate_target big integer 278928K
    sga_target big integer 0
    SQL> show parameter shared
    NAME TYPE VALUE
    hi_shared_memory_address integer 0
    max_shared_servers integer
    shared_memory_address integer 0
    shared_pool_reserved_size big integer 31876710
    shared_pool_size big integer 608M
    shared_server_sessions integer
    shared_servers integer 0
    SQL> show parameter db_buffer
    SQL> show parameter buffer
    NAME TYPE VALUE
    buffer_pool_keep string
    buffer_pool_recycle string
    db_block_buffers integer 0
    log_buffer integer 2048000
    use_indirect_data_buffers boolean FALSE
    SQL>
    In new 11gr2 Linux REDHAT parameter:
    NAME TYPE VALUE
    archive_lag_target integer 0
    db_flashback_retention_target integer 1440
    fast_start_io_target integer 0
    fast_start_mttr_target integer 0
    memory_max_target big integer 2512M
    memory_target big integer 2512M
    parallel_servers_target integer 192
    pga_aggregate_target big integer 0
    sga_target big integer 1648M
    SQL> show parameter shared
    NAME TYPE VALUE
    hi_shared_memory_address integer 0
    max_shared_servers integer
    shared_memory_address integer 0
    shared_pool_reserved_size big integer 28M
    shared_pool_size big integer 0
    shared_server_sessions integer
    shared_servers integer 1
    SQL> show parameter buffer
    NAME TYPE VALUE
    buffer_pool_keep string
    buffer_pool_recycle string
    db_block_buffers integer 0
    log_buffer integer 18857984
    use_indirect_data_buffers boolean FALSE
    SQL>
    Please help. Thanks in advance.

    Duplicate question. Originally posted in sql query slow in new redhat enviornment
    Please post in just one forum.

  • Windows master unable to connect to jvms on Linux systems; Config issue?

    I have a Win2K12 system set up as an admin server to start a workload on slave systems which are dual-booting Win2K12 and RHEL7. This works fine for the Win2K12 setup, but as I move on to the NFS testing, I run into problems connecting to the Linux hosts.
    This SMB workload file, run from the Win2K12 admin server pointing at Win2K12 workers works fine:
    compratio=2.0,dedupratio=5,dedupunit=4k
    hd=r710-01,system=r710-01.storage.spoc,user=administrator,shell=vdbench
    hd=r710-08,system=r710-08.storage.spoc,user=administrator,shell=vdbench
    sd=sd1,host=r710-01,lun=Z:\test1.txt,threads=32,size=50g
    sd=sd8,host=r710-08,lun=Z:\test8.txt,threads=32,size=50g
    wd=wd1,sd=(sd1,sd2,sd3,sd4,sd5,sd6,sd7,sd8),xfersize=4k,rdpct=25,seekpct=100,openflags=directio
    rd=run1,wd=wd1,iorate=(250,500,750,1000,max),elapsed=600,interval=5
    This test NFS workload file does not:
    compratio=2.0,dedupratio=5,dedupunit=4k
    hd=r710-08,system=r710-08.storage.spoc,vdbench=/mnt/nfs/vdbench/vdbench,user=root,shell=vdbench
    sd=sd1,host=r710-08,lun=/mnt/nfs/test8.txt,threads=32,size=50g
    wd=wd1,sd=(sd1),xfersize=4k,rdpct=100,seekpct=100,openflags=directio
    rd=run1,wd=wd1,iorate=(250,500,750,1000,max),elapsed=600,interval=5
    IPTables is stopped, and the vdbench rsh daemon is running on R710-08. I've verified that I can start vdbench locally on R710-08 and run it against the NFS mount. I've tried it with the vdbench path set properly for the Windows admin host (C:\vdbench\) and properly for R710-08 (above), as well as the user set to "Administrator" and "root", but in no case can I get it to successfully connect. In all cases, I get this or similar:
    C:\vdbench>vdbench -f linuxtest.txt
    Vdbench distribution: vdbench50402
    For documentation, see 'vdbench.pdf'.
    16:39:59.019 input argument scanned: '-flinuxtest.txt'
    16:39:59.097 *
    16:39:59.097 * In order for Dedup to remember which data patterns have been written and
    16:39:59.097 * which data patterns they can be replaced with, Dedup has activated a
    16:39:59.097 * subset of Data Validation. Data Validation will only be used to keep
    16:39:59.097 * track of data patterns. It will not be used to validate data, unless
    16:39:59.097 * of course specifically requested.
    16:39:59.097 *
    16:39:59.144 Starting slave: C:\vdbench\vdbench SlaveJvm -m 10.241.6.23 -n r710-08.storage.spoc-10-150309-16.39.58.972 -l r710-08-0 -p 5570
    16:40:09.222 Waiting for slave connection: r710-08-0
    16:40:19.395 Waiting for slave connection: r710-08-0
    16:40:20.161
    16:40:20.161 Trying to connect to the Vdbench rsh daemon on host r710-08.storage.spoc
    16:40:20.161 The Vdbench rsh daemon must be started on each target host.
    16:40:20.161 This requires a one-time start of './vdbench rsh' on the target host.
    16:40:20.161 Trying this for 60 seconds only.
    16:40:29.568 Waiting for slave connection: r710-08-0
    16:40:39.740 Waiting for slave connection: r710-08-0
    16:40:46.194
    16:40:46.194 Trying to connect to the Vdbench rsh daemon on host r710-08.storage.spoc
    16:40:46.194 The Vdbench rsh daemon must be started on each target host.
    16:40:46.194 This requires a one-time start of './vdbench rsh' on the target host.
    16:40:46.194 Trying this for 60 seconds only.
    16:40:49.913 Waiting for slave connection: r710-08-0
    16:40:59.210
    16:40:59.210 Terminating attempt to connect to slaves.
    16:40:59.210
    java.lang.RuntimeException: Terminating attempt to connect to slaves.
            at Vdb.common.failure(common.java:306)
            at Vdb.ConnectSlaves.connectToSlaves(ConnectSlaves.java:99)
            at Vdb.Vdbmain.masterRun(Vdbmain.java:730)
            at Vdb.Vdbmain.main(Vdbmain.java:577)
    Bottom line - Is the Windows/Linux mixed environment thing going to work? If so, what am I missing? If not, I need to give up and move on with creation of a second (RHEL7) admin server.
    Re-formatted for clarity. - Mike Baxter

    Thanks for the response, Henk. The linux->linux testing produced some more helpful outputs, that allowed me to track down the firewall as the problem. I'd verified that iptables was not running, but I didn't realize that RHEL7 had gone to firewalld...Which was running.
    It now works linux->linux, windows->linux, and linux->windows, with appropriate workload files.
    This is a semi-static environment intended to be provided to not always very technical users for proof of concept duties, so most of my control necessarily is centralized on a Win2K12 VM. The systems generating the load will be between 1 and 8 physical systems and up to two dozen VMs running Win2K12 or RHEL7, while the workloads will usually be all Windows or all Linux, the "semi-static" nature means I've got to be able to run both concurrently.

  • Linux Oracle RAC Issues with CRS

    Using the Linux Oracle RAC install guide - I've finally installed my install on Linux for the Oracle RAC. Just one problem - now after 10 mins or so - one of my nodes loses communication which barks out a PRKH-1010 error after trying to run a status check on my nodes using the srvctl status nodeapps -n <servername> command.
    any clues or ways to diagnose?

    Hi!
    The gsd relies on some files residing in /tmp/.oracle
    Are they still there?
    GSD is known to stop if they are absent.
    cu
    Andreas

Maybe you are looking for

  • HT5622 Im trying to set up my new preowned mac book when trying to install OS X Mavericks its asking me to review my apple ID

    my best friend just sold me his mac air book we were preforming a rest over the phone he lives in portland or i live in la but when installing mavericks OS X it seemed o be taking forever and i didnt have an apple id i assuned that couldev been why s

  • What is Mac's equivalent to Windows Explorer (file manager not internet explorer)?

    Have just migrated to macBook Pro from being a windows user for years. I don't trust backing up my important files to Cloud and would much prefer to back them up to an external hard drive as I used to on my Windows laptop. How can I do the same in my

  • Web Browser Flash Elements

    Maybe I'm asking way too much of poor old OS 9. But if I could fix this issue, OS 9 would be SO much more useful for me... There are some websites that simply cause Mozilla to crash and burn. (Including Mozilla 1.3.1, WaMCom Mozilla 1.3.1, and Netsca

  • Value Help

    Hi, I'm adding my context dynamically, that way i set my value_help_mode on automatic. But i notice that not all the fields that are forseen with checktables or search helps are provided with them. Is there a way to determine the problem? why they ar

  • Architecture Recommendations for disjoined radio set

    I need some Architecture Recommendations. I have a JSF page that is split into two sections. Basically you either answer the questions on the right or the questions on the left. But I need a couple of radio buttons at the top so that my user can sele