VS2015 svdComplexDevice1.dll called by Java application svdComplexDevice1X64

Home and Applets > Download SVD-GPU Application Source Code > svdComplexDevice1.dll Called by Java Application svdComplexDevice1X64

A Visual Studio 2015 project and a Java application project are presented. The VS2015 project generates a DLL file that is called by the Java application via JNA in Windows 10, X64 environment. CUDA and CULA are involved.

This Java application is used in:
Denoising NMR time-domain signal by singular-value decomposition accelerated by graphics processing units,
Pascal P. Man, Christian Bonhomme, and Florence Babonneau
Solid State Nucl. Magn. Reson. 61-62, 28-34 (2014). Abstract

CULA installation

  1. Install CULA Dense R15 for Windows (Universal).
  2. Folder location: C:\Program Files\CULA\R15.

svdComplexDevice1 DLL project in MS Visual Studio 2015

  1. In Start Page - Microsoft Visual Studio, select New Project...
  2. Select Win32 Console Application.
    Provid the name of the project: svdComplexDevice1.
    Click OK button.
  3. Welcome to the Win32 Application Wizard panel appears.
    Click Next > button.
  4. Application Settings panel appears. Tick DLL for Application type.

    Click Finish button.
  5. The Visual Studio editor appears.
    Select x64 platform.

    Five files are generated: stdafx.h, targetver.h, stdafx.cpp, dllmain.cpp, and an empty file svdComplexDevice1.cpp.
  6. Open svdComplexDevice1.cpp.
    Copy and paste its content into the source file svdComplexDevice1.cpp.
  7. Right click the folder of Header Files in Solution Explorer for adding a new item.
    Select Add then New Item...
  8. Select Header File(.h).
    Provid the name of Header File(.h): svdComplexDevice1.h. The file extension is .h.

    Click Add button. An source file appears for editing.
  9. Open svdComplexDevice1.h.
    Copy and paste its content into the source file svdComplexDevice1.h.
  10. Right click the file svdComplexDevice1.cpp in Solution Explorer. Select Properties.
    The Item Type is C/C++ compiler. Close the panel.
  11. Right click the file svdComplexDevice1.h in Solution Explorer. Select Properties.
    The Item Type is C/C++ header. Close the panel.
  12. Right click the project svdComplexDevice1 in Solution Explorer. Select Properties, then VC++ Directories.
    Add C:\Program Files\CULA\R15\bin64; in Executable Directories.
    Add C:\Program Files\CULA\R15\include; in Include Directories.
    Add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include; in Include Directories.
    Add C:\Program Files\CULA\R15\lib64; in Library Directories.
    Add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64; in Library Directories.

  13. Select Linker then Input.
    Add cula_core.lib;
    cula_lapack.lib;
    cudart.lib;
    in Additional Dependencies.

    Click the mouse for activing Appliquer button. Click Appliquer button then OK button.
  14. Select Build menu then Build Solution.

    The file svdComplexDevice1.dll is generated in the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\svdComplexDevice1\x64\Debug.

Java environment installation

  1. Install Eclipse IDE 2020-03 for 64-bit Windows with eclipse-inst-win64.exe.

    Select Eclipse IDE for Java Developers.
  2. Install Oracle JDK1.8 for 64-bit Windows with jdk-8u241-windows-x64.exe.
  3. Download two Java Native Access executable files: jna-5.5.0.jar and jna-platform-5.5.0.jar.
  4. The four CULA DLL files, cula_lapack.dll, cula_core.dll, cublas64_42_6.dll, and cudart64_42_6.dll, are located at C:\Program Files\CULA\R15\bin64.
  5. My Java application folder location: C:\Users\Papa\eclipse-workspace.

svdComplexDevice1X64 Java application project in Eclipse IDE

  1. Open Eclipse IDE 2020-03.

  2. Select Window menu then Preferences.
    Click Java then Installed JREs.
    Click Add button. Select Standard VM then click Next > button.
    Click Directory.. button. Select JRE folder or JDK folder. Click Finish button.
    Tick jdk1.8.0_241 (default).

    Click Apply button.
  3. Click Compiler.

    Choose 1.8 for Compiler compliance level.
    Click Apply and Close button.
    These settings will be effective for new projects.
  4. Select Create a Java project in Eclipse IDE.
    Provid the project name: svdComplexDeviceX64.

    Click Finish button.
  5. The project folder appears in Package Explorer.

  6. The file .classpath in the project folder located at C:\Users\Papa\eclipse-workspace\svdComplexDevice1X64 is filled.

  7. Open the project folder.
    Transfer seven files into the project folder: svdComplexDevice1.dll, cula_lapack.dll, cula_core.dll, cudart64_42_6.dll, cublas64_42_6.dll, jna-platform-5.5.jar, and jna-5.5.0.jar.

  8. Right click the project name in Project Explorer then select Refresh.

    The seven files appear in Package Explorer.
  9. Right click the source folder src in Project Explorer.
    Select New then Package. Provid the package name: nmrsvd.

    Click Finish button.
  10. Right click the package folder nmrsvd in Project Explorer.
    Select New then class. Provid the class name: fidsvd.

    Click Finish button.
  11. Similarly, generate four Java classes: Frame1, Graph, ListGentle, and SVDMVCModelGPU.

  12. Copy and paste fidsvd.java, Frame1.java, Graph.java, ListGentle.java, and SVDMVCModelGPU.java into the five newly generated java files, respectively.
  13. Right click the project folder svdComplexDevice1X64 in Project Explorer.
    Select Properties, Java Build Path, Library.

  14. Click Add JARs... button.
    Click the project folder in JAR Selection panel.
    Select the two jar files.

    Click OK button.

  15. Click Apply and Close button.

  16. A new folder, Referenced Libraries containing the two jna files, is added to the project in Package Explorer.
  17. The file .classpath in the project folder located at C:\Users\Papa\eclipse-workspace\svdComplexDevice1X64 is filled.

    Two lines concerning with jna files are added.
  18. Select Run menu then Run Configuration...
    Click Java Application then fidsvd.

    Click Run button.
  19. The Java application panel appears.

References

  1. Creating a jar File in Eclipse
  2. Creating an executable Jar file
  3. Tutoriel pour exécuter du code natif en Java : JNI VS JNA
  4. YouTube: How to setup Eclipse for C/C++ developers in Windows 8.1
  5. How to install Eclipse CDT 8.2 and get started
  6. Eclipse CDT (C/C++ Development Tooling)
  7. Add .dll to java.library.path in Eclipse/PyDev Jython projec
  8. How to configure eclipse to use JNA
  9. Tutoriel pour exécuter du code natif à partir de Java avec JNA, en 5 minutes
  10. How to change Eclipse Java version for compiler and JRE
  11. How to change Java Version in an Eclipse project
  12. Tout savoir sur Eclipse
  13. HOWTO create and deploy a sample DLL using MinGW
  14. Installing the Code
  15. Getting started with C++ for Eclipse.
  16. Eclipse managed build
  17. [Learning] CUDA C/C++ (Part 1) - Visual Studio project setup (Visual Studio 2017 15.5 version) from Win32 empty project
  18. CULA programmer’s guide, release R15 (CUDA 4.2) (PDF file)
  19. CULA reference manual, release R15 (CUDA 4.2) (PDF file)
  20. CUDA C++ programming guide (PDF file)
  21. CUDA quick start guide (PDF file)
  22. CUDA sample (PDF file)
  23. Learning CUDA (PDF file) from FREE eBook created from Stack Overflow contributors

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 June 13, 2020
Copyright © 2002-2024 pascal-man.com. All rights reserved.