CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Thirdparty mesquite-2.1.2 compile fix for newer gcc

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 9, 2012, 13:59
Default Thirdparty mesquite-2.1.2 compile fix for newer gcc
  #1
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 268
Rep Power: 9
kmooney is on a distinguished road
Hi everyone,

I've seen a lot of heartache around over trying to compile the Thirdparty stage 3 package mesquite-2.1.2 with newer gcc (4.6.x) versions. I was able to add a couple lines into the spec file that effectively patches the source code and allows a clean installation.

The key is in this file:

Code:
/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/SPECS/mesquite-2.1.2.spec
Add the following:
Code:
    find ./src/ObjectiveFunction -ls -type f -exec sed -i 's/size_t/std::size_t/g' {} \;

    find ./src/QualityMetric -ls -type f -exec sed -i 's/size_t/std::size_t/g' {} \;
immediately before this line:
Code:
make -j $WM_NCOMPROCS
I think this would be compatible with older compilers as well but I'm not sure. The mantis server is down so I can't currently submit a bug report. I'll try again later though.

Cheers!

Kyle
kmooney is offline   Reply With Quote

Old   May 9, 2012, 17:28
Default
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 530
Rep Power: 16
philippose will become famous soon enough
Hi there,

A Good Evening to you :-)!

I was just going through your post, and wanted to confirm that Mesquite does cause an issue when compiled with GCC versions 4.6 and above.

However, I would like to suggest another approach in order to solve the issue:

* The basic problem is, that GCC 4.6 onwards requires "cstddef" to be included to make "size_t" available.

* Since the Thirdparty system works via RPMs and a SPEC file, an elegant method would be to use the in-built patching capability of the RPM build system.

* I have created a patch file called "mesquite-2.1.2_patch0" which can be placed in the "rpmBuild/SOURCES" folder

* In order to incorporate this patch file into the Build process, the mesquite-2.1.2 SPEC file in the "rpmBuild/SPECS" folder needs to be modified.

------ I have attached both, the patch file and the modified spec file along with this post.

It would be great if you could try this out and see if it works on your system too.


@Martin: I am sure you will come across this post sooner or later :-)! If everything is ok, could you please incorporate these changes into the OpenFOAM-1.6-ext GIT repository?


A great day ahead!

Philippose
Attached Files
File Type: gz mesquite_gcc46_patch.tar.gz (2.6 KB, 18 views)
philippose is offline   Reply With Quote

Old   May 10, 2012, 01:52
Default
  #3
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 330
Rep Power: 13
mbeaudoin will become famous soon enough
Done.

Thanks for the bug fix. Even better when using a patch!

Martin

Quote:
Originally Posted by philippose View Post
Hi there,

A Good Evening to you :-)!

I was just going through your post, and wanted to confirm that Mesquite does cause an issue when compiled with GCC versions 4.6 and above.

However, I would like to suggest another approach in order to solve the issue:

* The basic problem is, that GCC 4.6 onwards requires "cstddef" to be included to make "size_t" available.

* Since the Thirdparty system works via RPMs and a SPEC file, an elegant method would be to use the in-built patching capability of the RPM build system.

* I have created a patch file called "mesquite-2.1.2_patch0" which can be placed in the "rpmBuild/SOURCES" folder

* In order to incorporate this patch file into the Build process, the mesquite-2.1.2 SPEC file in the "rpmBuild/SPECS" folder needs to be modified.

------ I have attached both, the patch file and the modified spec file along with this post.

It would be great if you could try this out and see if it works on your system too.


@Martin: I am sure you will come across this post sooner or later :-)! If everything is ok, could you please incorporate these changes into the OpenFOAM-1.6-ext GIT repository?


A great day ahead!

Philippose
mbeaudoin is offline   Reply With Quote

Old   May 10, 2012, 09:27
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 268
Rep Power: 9
kmooney is on a distinguished road
Thanks a lot for your help pushing the patch, I'm guessing it will make installation easier for a lot of folks going forward.

Perhaps I'll see you in Darmstadt!

Cheers,

Kyle
kmooney is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cmake cannot recognize gcc to compile ParaView CAVT OpenFOAM 3 July 27, 2010 20:38
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
Need Makefile for GCC in windows to compile UDFs Filipe Madureira FLUENT 2 December 28, 2005 17:08
Gerris software installation mer Main CFD Forum 2 November 12, 2005 09:50


All times are GMT -4. The time now is 16:45.