CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2 > SU2 Installation

SU2 compile error

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By bigfootedrockmidget

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 17, 2023, 09:38
Default SU2 compile error
  #1
New Member
 
Liming Yang
Join Date: Sep 2023
Posts: 29
Rep Power: 3
CFDWhite is on a distinguished road
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.
Attached Images
File Type: png error1.png (21.5 KB, 44 views)
File Type: png error2.png (4.0 KB, 18 views)
CFDWhite is offline   Reply With Quote

Old   September 24, 2023, 17:20
Default
  #2
L C
New Member
 
Join Date: Aug 2022
Posts: 8
Rep Power: 4
L C is on a distinguished road
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.
L C is offline   Reply With Quote

Old   September 25, 2023, 00:10
Default
  #3
New Member
 
Liming Yang
Join Date: Sep 2023
Posts: 29
Rep Power: 3
CFDWhite is on a distinguished road
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.
Attached Images
File Type: jpg Linux_err.jpg (86.1 KB, 16 views)
CFDWhite is offline   Reply With Quote

Old   September 25, 2023, 02:43
Default
  #4
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 666
Rep Power: 21
bigfootedrockmidget is on a distinguished road
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 likes this.

Last edited by bigfootedrockmidget; September 25, 2023 at 05:56.
bigfootedrockmidget is offline   Reply With Quote

Old   September 25, 2023, 04:44
Default
  #5
New Member
 
Liming Yang
Join Date: Sep 2023
Posts: 29
Rep Power: 3
CFDWhite is on a distinguished road
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.
CFDWhite is offline   Reply With Quote

Old   September 25, 2023, 06:06
Default
  #6
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 666
Rep Power: 21
bigfootedrockmidget is on a distinguished road
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.
bigfootedrockmidget is offline   Reply With Quote

Old   September 25, 2023, 10:48
Default
  #7
New Member
 
Liming Yang
Join Date: Sep 2023
Posts: 29
Rep Power: 3
CFDWhite is on a distinguished road
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.
Attached Images
File Type: png Linux err.png (75.9 KB, 12 views)
CFDWhite is offline   Reply With Quote

Old   September 25, 2023, 16:57
Default
  #8
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 666
Rep Power: 21
bigfootedrockmidget is on a distinguished road
Does it compile in linux when you switch the libraries off?
bigfootedrockmidget is offline   Reply With Quote

Old   September 25, 2023, 18:30
Default
  #9
L C
New Member
 
Join Date: Aug 2022
Posts: 8
Rep Power: 4
L C is on a distinguished road
Quote:
Originally Posted by bigfootedrockmidget View Post
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.
L C is offline   Reply With Quote

Old   September 25, 2023, 22:23
Default
  #10
New Member
 
Liming Yang
Join Date: Sep 2023
Posts: 29
Rep Power: 3
CFDWhite is on a distinguished road
Quote:
Originally Posted by bigfootedrockmidget View Post
Does it compile in linux when you switch the libraries off?
linux builds again with the error shown in the figure
Attached Images
File Type: png Linux err.png (75.9 KB, 7 views)
CFDWhite is offline   Reply With Quote

Old   October 7, 2023, 05:21
Default
  #11
L C
New Member
 
Join Date: Aug 2022
Posts: 8
Rep Power: 4
L C is on a distinguished road
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.
L C is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 14:21
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 07:45
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 08:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 06:28.