Cuda Runtime Library configuration problems

Source: Internet
Author: User

Always encounter a bunch of problems, the problem encountered this time is similar to this: http://cudazone.nvidia.cn/forum/forum.php? MoD = viewthread & tid = 483. First read someArticleThe reason is that the default library used by VC in the compilation and linking process is replaced by the new library. However, many operations of VC are in the default library, so errors may occur.

1. About the C Runtime Library

For an understanding of the default library, see (http://bbs.csdn.net/topics/60274797)

How to Understand C run-time Library (C Runtime Library)

1) The Runtime Library is the c run-time library, which is the concept of the C language rather than the C ++ language World: The name is because of yourCProgramRequired during runningFunctions in these libraries.

2) C is a so-called "Small kernel" language, which is small in itself (not many keywords, program flow control, data type, etc.). Therefore, after the C-language kernel is developed, Dennis Ritchie and Brian kernighan use C to rewrite more than 90% of UNIX system functions and separate the most commonly used functions, the header file and the corresponding library are formed in this way in C run-time library.

3) subsequently, with the prevalence of the C language, the C compiler manufacturers/individuals/groups all follow the old tradition and have corresponding standard libraries on different platforms, however, most implementations are related to various platforms. Since each C compiler has many differences and subtle differences in C support and understanding, it has ansi c; ansi c (subjective intention) it defines in detail the specific meaning of each element of the C language and the implementation requirements of the compiler, introduces a new function declaration method, and sets up the standard form of the standard library. Therefore, the C Runtime Library is provided by the compiler manufacturer. Header files and library functions provided by other manufacturers/individuals/groups should be called third-party
C Runtime Library (Third Party C run-time libraries ).

4) C run-time library contains InitializationCodeAnd Error Handling Code (for example, divide by zero ). The program you write can run without the math library, but cannot handle complex mathematical operations. However, without the C run-time library, main () won't be called, exit () cannot be responded. Because the C run-time library contains the most basic and commonly used functions for C program running.

5) in the C ++ world, there is another concept: Standard C ++ library, which includes the C run-time library and STL mentioned above. The reason for including C run-time library is obvious. c ++ is the superset of C, and there is no reason to re-create a C ++ run-time library. the standard C ++ Library added by VC for C ++ mainly includes libcp. lib, libcpmt. lib and msvcprt. lib

6) in windows, the C run-time library provided by VC is divided into dynamic and static runtime libraries.
the dynamic Runtime Library is mainly the dll library file msvcrt. DLL (or msvcrtd. DLL for debug build), the corresponding import library file is msvcrt. lib (msvcrtd. lib for debug build)
the main files corresponding to the static Runtime Library (release version) are:
libc. lib (single thread static library, retail version)
libcmt. lib (multithread static library, retail version)
msvcrt. DLL provides thousands of C functions, even low-level functions such as printf are in msvcrt. DLL. In fact, most of the time your program runs in these runtime libraries. When your program (release version) is compiled, VC Automatically releases the corresponding Runtime Library file (libc) based on your compilation options (single thread, multi-thread, or DLL. lib, libcmt. lib or import library msvcrt. lib.
which C run-time library is connected to your program during compilation depends on the Compilation options:
/MD,/ml,/mt, /LD (use run-time Library)
you can use the following method in VC to set which C run-time library to join your program:
to find these options in the development environment, click Settings on the project menu. then click the C/C ++ tab, and click code generation in the category box. see the use run-time library drop-down box.
considering program portability, if both functions can complete one function, select the Runtime library function, the vendor of each C compiler provides unified support for the Standard C run-time library.

Ii. Problem Solving

After reading some solutions on the Internet, we can quickly block the points by default, so there will be no conflicts, but the result is that there will be problems with the files contained in the original library, so this will not work. Later, I was told to change the vs08 Runtime Library to static, and change the CPU and GPU Runtime Library to MTD .. OK ..


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.