C++ 64-bit shared library svdComplexDevice2.dll is generated with Microsoft Visual C++ toochain in Eclipse IDE for Java developers. The two CUDA's libraries, cuBLAS and cuSOLVER, are involved in this project.
Visual Studio Community 2022 is needed.
*** Outline ***
- C++ 64-bit shared library svdComplexDevice2.dll project with Microsoft Visual C++ toolchain in Eclipse IDE
- References
C++ 64-bit shared library svdComplexDevice2.dll project with Microsoft Visual C++ toolchain in Eclipse IDE
- Launch Eclipse IDE for Java Developers.
Select File menu, New, then Project.
New Project panel appears:
Select C/C++ then C/C++ Project. Click Next > button. - New C/C++ Project panel appears. Select C++ Managed Build.
Click Next > button.
- C++ Project panel appears.
Provide Project name: svdComplexDevice2
Select Shared Library then Empty Project.
Select Microsoft Visual C++ in Toolchains.Click Finish button. - The project folder svdComplexDevice2 appears in Package Explorer of Eclipse.
Right-click the project folder svdComplexDevice2.
Select New, then File.
Create New File panel appears.
Provide the name for Header file: svdComplexDevice2.h
Click Finish button.Click Finish button. - The empty header svdComplexDevice2.h appears in Package Explorer of Eclipse.
- Copy and past svdComplexDevice2.h
file into the newly created header file.
Press Ctrl S to save svdComplexDevice2.h. - Similarly, create the file: svdComplexDevice2.cpp
Copy and past svdComplexDevice2.cpp file into the newly created source file.Press Ctrl S to save svdComplexDevice2.cpp.
- Provide the path of include folder of CUDA to compiler.
Include folder contains header files.
Right click svdComplexDevice2 project in Package Explorer then select Properties.
Properties for svdComplexDevice2 panel appears.
Click Settings in C/C++ Build.
Click Preprocessor for C++ Compiler in Tool Settings tab.Click + symbol in top part of Include Path (/I). - Add directoriy path panel appears.
Provide "${CUDA_INC_PATH}" for Directory.
Directory must be enclosed in double quotes because this path contains space characters.Click OK button. - "${ASSERT}" provides the location of assert.h,
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
Similarly, provide the paths "${INCLUDE1}" and "${ASSERT}"Click Apply button. - Provide libraries (cusolver.lib, cublas.lib,
and cudart.lib)
and their folder location ("${CUDA_LIB_PATH_64}") to the linker.
Click Libraries for Linker (link) in Tool Settings tab.
Library file names are provided with extension .lib like in MS Visual Studio and paths are enclosed in double quotes.
Click Apply and Close button.
A message appears.
Click Rebuild Index button.
- Select Project menu then Build Project.
64-bit svdComplexDevice2.dll file with 46 kbit size is generated in Debug folder.
A message appears on the CDT Build Console.
References
- Dan Dar3: Eclipse CDT and Microsoft Visual C++ compiler
- StackOverflow: Visual Studio toolchain in Eclipse for C++
- StackOverflow: Cannot find corecrt.h
- StackOverflow: Cannot open file 'kernel32.lib'
- StackOverflow: Cannot open file 'ucrt.lib'
- StackOverflow: cannot open file 'MSVCRTD.lib'