svdComplexDevice1.dll with MS Visual C++ toolchain in Eclipse IDE

Home and Applets > Download SVD-GPU Application Source Code > svdComplexDevice1.dll with MS Visual C++ Toolchain in Eclipse IDE

First, the procedure for installing Microsoft Visual C++ toolchain in Eclipse IDE for Java developers and Windows 11 is presented.
Then, a C++ 64-bit HelloWorld project is implemented.
Finally, C++ 64-bit shared library svdComplexDevice1.dll is generated with Microsoft Visual C++ toochain in Eclipse IDE for Java developers.

Visual Studio Community 2022 is needed.

*** Outline ***

  1. Provide the paths of cl.exe, nvcc, CUDA, and CULA in environment variables of Windows 11
  2. C/C++ Visual C++ support in Eclipse IDE
  3. C++ 64-bit HelloWorld project with Microsoft Visual C++ toolchain in Eclipse IDE
  4. C++ 64-bit shared library svdComplexDevice.dll project with Microsoft Visual C++ toolchain in Eclipse IDE
  5. References

Provide the paths of cl.exe, nvcc, CUDA, and CULA in environment variables of Windows 11

  1. Right click PC computer then select Properties.

  2. System panel appears.
    Select Advanced system parameters.
    System properties panel appears.

    Click Environment Variables... button.
    Environment Variables panel appears.
  3. Select Path in System variable sub-panel.

    Click Modify... button.
  4. Modify environment variable panel appears.
    Click New button.
    Add C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64

    It contains cl.exe compiler.
    Click OK button.
  5. Click New... button in System variables sub-panel.
    New System Variable panel appears.
    Variable name: NVCC
    Variable value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\bin\nvcc
    Click OK button.

  6. Similarly, fill the following data in System variables sub-panel:
    Variable name: INCLUDE1
    Variable value: C:\Users\pm\source\repos\cuda-samples-12.5\Common
    It contains helper_cuda.h, helper_functions.h, helper_gl.h and others.
    Variable name: INCLUDE2
    Variable value: C:\Users\pm\source\repos\cuda-samples-12.5\Common\lib\x64
    It contains freeglut.lib and glew64.lib.
    Variable name: ASSERT
    Variable value: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
    It contains assert.h, complex.h.
    Variable name: CUDA_INC_PATH
    Variable value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include
    It contains the cuda_xx.h files of CUDA.
    Variable name: CUDA_LIB_PATH_64
    Variable value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\lib\x64

    Click OK buttons.

C/C++ Visual C++ support in Eclipse IDE

Two ways to install MS Visual C/C++ support for Eclipse IDE in Windows 11 are available:
(1) If Eclipse IDE for Java developers is already installed, install C/C++ programs from Eclipse IDE.
(2) If Eclipse IDE for C/C++ developers is already installed, install CDT from Eclipse IDE.
Only the first way is presented.

Eclipse IDE for Java Developers installation in Windows 11

  1. In Eclipse.org, click Download x86_64 bit button, then click Download button for obtaining eclipse-inst-jre-win64.exe.
    Click this executable results the choice panel:

    Select Eclipse IDE for Java Developers.
  2. Perform the installation of Eclipse IDE for Java Developers.
    My Java application folder location is C:\Users\pm\eclipse-workspace.
  3. In Eclipse IDE, select Help menu then Install New Software...
    Available Software panel appears.

  4. In Work with, select All Available Sites.

  5. Tick Programming Languages.

    Click Next > button.
  6. Install Remediation Page panel appears. Select C/C++ Support (experimental).

    Click Next > button.
  7. Install Details panel appears.

    Click Next > button.
  8. Review Licenses panel appears.
    Tick the choice: I accept the terms of the license agreement.
    Click Finish button.
  9. In Eclipse IDE.
    Select Help menu then About Eclipse IDE.

  10. Click Installation Details button.

    C/C++ Visual C++ Support (experimental) is available.
    Click Close button.

C++ 64-bit HelloWorld project with Microsoft Visual C++ toolchain in Eclipse IDE

  1. 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.
  2. New C/C++ Project panel appears. Select C++ Managed Build.

    Click Next > button.
  3. C++ Project panel appears.
    Provide Project name: vs64HelloWorld
    Select Hello World C++ Project in Executable.
    Select Microsoft Visual C++ in Toolchains.

    Click Finish button.
  4. The project folder vs64HelloWorld containing vs64HelloWorld.cpp appears in Package Explorer of Eclipse.

  5. Select Project menu then Build Project.

    A new folder called Debug containing vs64HelloWorld.exe is added to project folder. Three files called vc140.pdb, vs64HelloWorld.lik, and vs64HelloWorld.pdb, are added to Debug folder.
  6. Select Run menu then Run Configuration.
    Click C/C++ Application then vs64HelloWorld Debug.

    Click Run button.
  7. !!!Hello World!!! appears on Console tab.

C++ 64-bit shared library svdComplexDevice1.dll project with Microsoft Visual C++ toolchain in Eclipse IDE

  1. 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.
  2. New C/C++ Project panel appears. Select C++ Managed Build.

    Click Next > button.
  3. New C++ Project panel appears.
    Provide Project name: svdComplexDevice1
    Select Shared Library then Empty Project.
    Select Microsoft Visual C++ in Toolchains.

    Click Finish button.
  4. The project folder svdComplexDevice1 appears in Package Explorer of Eclipse.
  5. Right-click the project folder svdComplexDevice1.
    Select New, then File.
    Create New File panel appears.
    Provide the name for Header file: svdComplexDevice1.h
    Click Finish button.

    Click Finish button.
  6. The header svdComplexDevice1.h appears in Package Explorer of Eclipse.

  7. Copy and past svdComplexDevice1.h file into the newly created header file.

    Press Ctrl S to save svdComplexDevice1.h.
  8. Similarly, create the file: svdComplexDevice1.cpp
    Copy and past svdComplexDevice1.cpp file into the newly created source file.

    Press Ctrl S to save svdComplexDevice1.cpp.
  9. Provide the path of include folder of CUDA and that of CULA to compiler. Include folder contains header files.
    Right click svdComplexDevice1 project in Package Explorer then select Properties.
    Properties for svdComplexDevice1 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).
  10. 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.
  11. Similarly, provide the path "${CULA_INC_PATH}"

    Click Apply button.
  12. A message apears.

    Click Rebuild Index button.

  13. Provide four libraries (cula_core.lib, cublas.lib, cudart.lib, and cula_lapack.lib) and their folder location ("${CUDA_LIB_PATH_64}" and "${CULA_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.
    Click Apply and Close button.
  14. The project before Build.

  15. Select Project menu then Build Project.

    64-bit svdComplexDevice1.dll file with 44 kbit size is generated in Debug folder.
    A message appears on the CDT Build Console.

References

  1. Dan Dar3: Eclipse CDT and Microsoft Visual C++ compiler
  2. StackOverflow: Visual Studio toolchain in Eclipse for C++
  3. StackOverflow: Cannot find corecrt.h
  4. StackOverflow: Cannot open file 'kernel32.lib'
  5. StackOverflow: Cannot open file 'ucrt.lib'
  6. StackOverflow: cannot open file 'MSVCRTD.lib'

Solid-state NMR bibliography for:

Aluminum-27
Antimony-121/123
Arsenic-75
Barium-135/137
Beryllium-9
Bismuth-209
Boron-11
Bromine-79/81
Calcium-43
Cesium-133
Chlorine-35/37
Chromium-53
Cobalt-59
Copper-63/65
Deuterium-2
Gallium-69/71
Germanium-73
Gold-197
Hafnium-177/179
Indium-113/115
Iodine-127
Iridium-191/193
Krypton-83
Lanthanum-139
Lithium-7
Magnesium-25
Manganese-55
Mercury-201
Molybdenum-95/97
Neon-21
Nickel-61
Niobium-93
Nitrogen-14
Osmium-189
Oxygen-17
Palladium-105
Potassium-39/41
Rhenium-185/187
Rubidium-85/87
Ruthenium-99/101
Scandium-45
Sodium-23
Strontium-87
Sulfur-33
Tantalum-181
Titanium-47/49
Vanadium-51
Xenon-131
Zinc-67
Zirconium-91
[Contact me] - Last updated December 29, 2024
Copyright © 2002-2024 pascal-man.com. All rights reserved.