groops-devs/groops

How can I use external code in my c++ procedure in GROOPS?

FFFFFG-IGG opened this issue · 1 comments

Description

Hello ,
I'd like to compile groops in visual studio(2019), for introducing external code, I made a .lib file that by compiling blasWrapper.f and lapackWrapper.f with intel HPC-fortran compiler. And linked it to my visual studio project. However, there goes a error "cannot recognize external symbol“. Note that symbols are 'wrapdgemm_', 'wrapdsyev_' etc.
I've intalled lapack and Openblas in my computer and linked them into my vs project, It also did not work. I think there are some self-made fortran code in groops that are not complied, and I just compiled them in a wrong way.
Could someone give me some advice on problems I met?
Many thanks!

GROOPS version

No response

Operating systems

  • Linux
  • Windows
  • macOS
  • Other (please specify in the description)

Log output

No response

akvas commented

Dear @FFFFFG-IGG,

you can set up GROOPS as a CMake project in Visual Studio. To do that, start Visual Studio and select Open a local folder, the select the GROOPS root directory (groops). Visual Studio will detect that it is a CMake project. Select source/CMakeLists.txt as the CMake file.

Go to Project > CMake settings and add a Mingw64 configuration (Debug or Release, depending on your requirements). Add the variable "CMAKE_Fortran_COMPILER" with the path to the Intel Fortran compiler to the CMake variables of this new configuration.

Finally, go to Project > Delete cache and reconfigure to generate the required Makefiles. Then GROOPS can be simply compiled as usual.

Please note that this is not strictly a GROOPS issue and rather deals with how to setup the project in your IDE. We can only offer limited support on such matters (see #34 for a discussion on that).

Cheers,
Andreas