CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 Installation (https://www.cfd-online.com/Forums/su2-installation/)
-   -   SU2 compile error (https://www.cfd-online.com/Forums/su2-installation/251951-su2-compile-error.html)

CFDWhite September 17, 2023 08:38

SU2 compile error
 
2 Attachment(s)
Hi,
When I compiled on windows according to the method of the official website, the following error appeared, may I ask where the problem is?


All suggestions are helpful. Thanks a lot.

L C September 24, 2023 16:20

Hi

Did you manage to sort out your error? I am compiling version 8.0.0 on Windows and I'm having some issues as well which are taking me time to sort out. I didn't manage to reproduce your error, so I'll summarise my case:

1. Calling Meson with --Dwith-mpi=enabled -> Meson doesn't find MPI
2. Calling Meson without mpi option -> Meson finishes, but compilation of CGNS fails:

Code:

[23/754] Compiling C object externals/cgns/hdf5/H5detect.exe.p/H5detect.c.obj
ninja: build stopped: subcommand failed.

3. Calling Meson with -Dwith-mpi=disable -> works.
4. I'm using option -Denable-tecio=false, I get a similar issue as yours but in CTecplotBinaryFileWriter.hpp:

Code:

L:/prog/su2/su2_git/SU2/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp:119:5: error:
 'int64_t' does not name a type
  119 |    int64_t GetRankNumNodes(int which_rank)
      |    ^~~~~~~

This can be solved by including cstdint at the top of the file:

Code:

#include <cstdint>
#include <assert.h>

I'm not sure why the file should compile without this header, seems like some sort of dependency hell and you're probably experiencing something similar.

5. Finally, I didn't get to compile the unit tests with -Denable-tests=true. I get a rather bizarre error message in option_structure.hpp, it looks like the compiler is getting lost somehow:

Code:

[156/168] Compiling C++ object UnitTests/test_driver.exe.p/test_driver.cpp.obj
FAILED: UnitTests/test_driver.exe.p/test_driver.cpp.obj
"c++" "-IUnitTests/test_driver.exe.p" "-IUnitTests" "-I../UnitTests" "-ISU2_CFD/src" "-I../SU2_CFD/src" "-ICommon/src" "-I../Common/src" "-I../externals/CLI11" "-I../externals/cgns/adf" "-I../externals/cgns/adfh" "-Iexternals/cgns" "-I../externals/cgns" "-Iexternals/cgns/hdf5" "-I../externals/cgns/hdf5" "-I../externals/mel" "-I../externals/catch2" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-std=c++11" "-O2" "-g" "-pthread" "-fPIC" "-DHAVE_CGNS" "-DNDEBUG" -MD -MQ UnitTests/test_driver.exe.p/test_driver.cpp.obj -MF "UnitTests/test_driver.exe.p/test_driver.cpp.obj.d" -o UnitTests/test_driver.exe.p/test_driver.cpp.obj "-c" ../UnitTests/test_driver.cpp
In file included from L:/prog/su2/su2_git/SU2/Common/include/basic_types/datatype_structure.hpp:34,
                from L:/prog/su2/su2_git/SU2/Common/include/parallelization/mpi_structure.hpp:37,
                from ../UnitTests/test_driver.cpp:34:
L:/prog/su2/su2_git/SU2/Common/include/code_config.hpp:34: warning: "FORCEINLINE" redefined
  34 | #define FORCEINLINE inline __attribute__((always_inline))
      |
In file included from C:/tools/msys64/mingw64/include/minwindef.h:163,
                from C:/tools/msys64/mingw64/include/windef.h:9,
                from C:/tools/msys64/mingw64/include/windows.h:69,
                from ../externals/catch2/catch.hpp:10066,
                from ../UnitTests/test_driver.cpp:32:
C:/tools/msys64/mingw64/include/winnt.h:248: note: this is the location of the previous definition
  248 | #define FORCEINLINE __forceinline
      |
In file included from C:/tools/msys64/mingw64/include/windows.h:72:
L:/prog/su2/su2_git/SU2/Common/include/option_structure.hpp:2098:3: error: expected identifier before numeric constant
 2098 |  DIFFERENCE = 1,    /*!< \brief Jump given by a difference in values. */
      |  ^~~~~~~~~~

Without MPI, changed CTecplotBinaryFileWriter.hpp and unit tests the code compiles, although I'm not sure yet if it works correctly. I have yet to compile this version under Linux (need to reinstall it under WSL2 in this machine), so I can't say if it is something with my own setup or the code itself.

CFDWhite September 24, 2023 23:10

1 Attachment(s)
Unfortunately, my compilation has not progressed, and I have not met your problem, so I am sorry that I cannot provide help.

I'm trying to compile the code with linux and I'm having a little trouble so far, so if you have any experience, I'd appreciate it.

bigfootedrockmidget September 25, 2023 01:43

all these errors look like they result from meson/ninja not being able to find the libraries for mpi, tecio and cgns.
First try to compile without these libraries to see if this is indeed the case:
Code:

-Dwith-mpi=disabled -Denable-tecio=false -Denable-cgns=false
Then check if these libraries are installed, and where. If they are not in standard locations, the compiler cannot find them. You can check the meson messages to see if the library was found. mpi is a bit more tricky. If you have mpich instead of openmpi, then use:

Code:

-Dwith-mpi=enabled -Dcustom-mpi=true -Dextra-deps=mpich

CFDWhite September 25, 2023 03:44

Thank you very much. Once I disabled all three libraries, I was able to compile successfully.

But the libraries are downloaded from the official website, do I need additional operations?

What does standard position mean?

Could you explain it in more detail if necessary? Thank you very much for your help.

bigfootedrockmidget September 25, 2023 05:06

If you are working in Linux (which is the recommended professional environment) then check that you have installed the actual development package.

For instance for mpich, I have installed the packaged mpich-dev.


For cgns and tecio, they are downloaded by SU2 and put in the externals/ folder. Please check that they are there. Maybe there are globally installed packages that conflict with the version that SU2 actually needs.

CFDWhite September 25, 2023 09:48

1 Attachment(s)
Thank you for your suggestion.

I successfully compiled in the Windows environment, after disabling the three libraries to achieve, in the Linux environment when trying to appear the problem as shown in the figure, do you know what is the reason?

At your suggestion, I checked tecio and csgn, both in the externals folder downloaded. Since the file exists, where else could the problem arise?

Thanks again.

bigfootedrockmidget September 25, 2023 15:57

Does it compile in linux when you switch the libraries off?

L C September 25, 2023 17:30

Quote:

Originally Posted by bigfootedrockmidget (Post 857433)
all these errors look like they result from meson/ninja not being able to find the libraries for mpi, tecio and cgns.
First try to compile without these libraries to see if this is indeed the case:
Code:

-Dwith-mpi=disabled -Denable-tecio=false -Denable-cgns=false

Hi, thanks for answering. I was probably not clear, compiling with -Denable-tecio=false does indeed return with errors. There seems to be something wrong somewhere indeed, however it doesn't seem to be with external dependencies. But I see that also version 7.5.1 is not compiling anymore, and it worked without tecio before - never managed to make it work with tecio on Windows in any of my machines for no apparent reason.

CFDWhite September 25, 2023 21:23

1 Attachment(s)
Quote:

Originally Posted by bigfootedrockmidget (Post 857484)
Does it compile in linux when you switch the libraries off?

linux builds again with the error shown in the figure

L C October 7, 2023 04:21

Hi Liming
Those problems are sometimes hard to trace back. I managed to compile on Linux with no issues (other than some MPI settings), but I did not figure out the problem on Windows without tecio and I don't see why it should compile in first place. The fact that it does compile on Linux with the same settings suggest some dependency issues that would probably take me some time to go over.

May I suggest you start over your Linux installation (I'm assuming you're using WSL2) with an English only installation. Get gcc, g++, cmake, ninja-build, swig and pkg-config from your package manager and try to compile SU2 without MPI . Sometimes Ninja gets lost with path dependencies and with WSL2 it is quite easy to start over.


All times are GMT -4. The time now is 18:10.