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

Compilation problem when including C file

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By economon

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2013, 07:41
Default Compilation problem when including C file
  #1
New Member
 
Manuel Cellarius
Join Date: Apr 2013
Location: Northern Ireland, Belfast
Posts: 4
Rep Power: 13
mcell is on a distinguished road
Hi,

I want to couple SU2 with MpCCI (a coupling software) in order to make aeroelastic simulations with Nastran. MpCCI provides a C interface so I need to include some C headers in SU2_CFD.hpp and add some functions in SU2_CFD.cpp.

My problem is to compile the whole program. I already included for test reasons a c++ file and compiled it successfully (added lines for *hpp and *cpp file in Makefile.in and Makefile.am in the SU2_CFD/obj directory and used afterwards the configure file to create a new Makefile). If I do exactely the same with an external C file I get a compilation error after the object files are created. For test reasons I just tried to include a very simple C file which is located in SU2_v2.0.2/trunk/MpCCI_Adapter:

/*SU2_CFD.hpp*/
...
extern "C" {
#include "../../MpCCI_Adapter/data.h"
}

/* data.h */

#include <stdio.h>
void SayHello();

/* data.c */

#include "data.h"
void SayHello(){
printf("C header file included");
}

/* SU2_CFD.cpp */

...
SayHello();
...


I also tried to use the following command using the configure file, which didn't change anything:
--includedir=/home/tesla/work/Manuel/SU2_v2.0.2/trunk/MpCCI_Adapter

It is quite easy to find in the internet a solution for how compiling one c++ and one c file. But as I am very new to compiling it feels for me impossible to change these complex makefiles to fit my needs! I just saw that you also include an external C file (metis.h), but wasn't able to figure out what I have to change in the makefile in my case.

I would be very thankful if someone can help me with this problem!

I attached the error message and the makefiles.

Manuel
Attached Files
File Type: txt errormessage.txt (28.6 KB, 4 views)
File Type: zip Makefiles.zip (20.3 KB, 4 views)
mcell is offline   Reply With Quote

Old   May 9, 2013, 14:20
Default
  #2
Super Moderator
 
Thomas D. Economon
Join Date: Jan 2013
Location: Stanford, CA
Posts: 271
Rep Power: 14
economon is on a distinguished road
Hi Manuel,

At the moment, we don't have any experience in compiling SU2 with the MpCCI software. However, I would like to mention that SU2 can still be compiled using plain old makefiles rather than the autoconf/automake system, if a user would really like to do so. The original makefiles should still exist in the config/ directory for each module, i.e. SU2/SU2_CFD/config/. As a warning, these may be out of date, but it seems that you will probably need to update them anyway to accommodate the new external dependency.

Hope this helps!
Tom
mcell likes this.
economon is offline   Reply With Quote

Old   May 13, 2013, 06:29
Default
  #3
New Member
 
Manuel Cellarius
Join Date: Apr 2013
Location: Northern Ireland, Belfast
Posts: 4
Rep Power: 13
mcell is on a distinguished road
Hey Tom,
thank you! This makefile seems to me to deal with much easier. I'll try my best
mcell is offline   Reply With Quote

Old   February 6, 2016, 14:15
Default Coupling with NASTRAN - OpenFSI / MpCCI
  #4
Member
 
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 13
kmandar is on a distinguished road
Hi Manuel,

I am very interested in your project of coupling SU2 with Nastran. Can you please let me know the updates if any? Do you have a github repository where you are sharing the details of your makefile?

I intend to couple SU2_CFD with Nastran too, but using OpenFSI as a coupling device. I will be sharing updates about this on my github fork of SU2 and CSA branch.

Thanks,
Mandar
kmandar is offline   Reply With Quote

Reply

Tags
nastran openfsi mpcci


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
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 08:49.