CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Thirdparty mesquite-2.1.2 compile fix for newer gcc (https://www.cfd-online.com/Forums/openfoam-bugs/101638-thirdparty-mesquite-2-1-2-compile-fix-newer-gcc.html)

kmooney May 9, 2012 13:59

Thirdparty mesquite-2.1.2 compile fix for newer gcc
 
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

philippose May 9, 2012 17:28

1 Attachment(s)
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 May 10, 2012 01:52

Done.

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

Martin

Quote:

Originally Posted by philippose (Post 360172)
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


kmooney May 10, 2012 09:27

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


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