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

[OpenFOAM.org] Building OpenFOAM 3.0 on ArchLinux

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By coldice
  • 2 Post By wwzhao

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2015, 15:35
Default Building OpenFOAM 3.0 on ArchLinux
  #1
New Member
 
Join Date: Dec 2015
Posts: 4
Rep Power: 10
coldice is on a distinguished road
Hello,

the last two days I tried installing OpenFoam 3.0 on my ArchLinux System, but I keep getting the same error while building the applications. Below is the first error:
Code:
+ wmake -all utilities
make[1]: Entering directory '/opt/OpenFOAM/OpenFOAM-3.0.0/applications/utilities/mesh'
make[2]: Entering directory '/opt/OpenFOAM/OpenFOAM-3.0.0/applications/utilities/mesh/advanced'
/opt/OpenFOAM/OpenFOAM-3.0.0/applications/utilities/mesh/advanced/autoRefineMesh
make[3]: Entering directory '/opt/OpenFOAM/OpenFOAM-3.0.0/applications/utilities/mesh/advanced/autoRefineMesh'
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/dynamicMesh/lnInclude -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/meshTools/lnInclude -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/triSurface/lnInclude -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-3.0.0/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed /opt/OpenFOAM/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.o -L/opt/OpenFOAM/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib \
    -ldynamicMesh -lmeshTools -ltriSurface -llagrangian -lOpenFOAM -ldl  \
     -lm -o /opt/OpenFOAM/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/bin/autoRefineMesh
/opt/OpenFOAM/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
collect2: error: ld returned 1 exit status
I also tried installing version 2.4 from the AUR (a version with modifications for Arch), but the whole applications where missing. So I guess there was the same error.

I use gcc 5.2 and flex 2.6

I hope someone can help, because I really don't wanna install Ubuntu

Thanks,
Steve
coldice is offline   Reply With Quote

Old   December 9, 2015, 15:50
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Steve and welcome to the forum!

Any chance you can downgrade your flex installation from 2.6 to 2.5.35? Because apparently that's the origin of the problem, since apparently there is something too new in 2.6 that OpenFOAM is not yet ready to handle.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 9, 2015, 16:39
Default
  #3
New Member
 
Join Date: Dec 2015
Posts: 4
Rep Power: 10
coldice is on a distinguished road
Thanks you for response Bruno.

Luckily I found a flex-2.5.35 package on some outdated mirror, but sadly it doesn't fix the problem. Is it possible that gcc 5.2 is too new?

Thanks,
Steve
coldice is offline   Reply With Quote

Old   December 9, 2015, 17:36
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by coldice View Post
Luckily I found a flex-2.5.35 package on some outdated mirror, but sadly it doesn't fix the problem. Is it possible that gcc 5.2 is too new?
Quick answer: If you now are using flex 2.5.35, then you need to rebuild many of the libraries and applications, otherwise you will still have some objects using the previous flex installation, which resulted in the error message you got before. Running the following commands:
Code:
foam
wclean all
should ensure you reset the build and are now able to run Allwmake again for rebuilding everything. This way you avoid having to manually find which libraries and applications rely on flex.

As for GCC 5.2: it's fully supported in OpenFOAM 3.0 and it's the version used with Ubuntu 15.10.
wyldckat is offline   Reply With Quote

Old   December 10, 2015, 08:05
Default
  #5
New Member
 
Join Date: Dec 2015
Posts: 4
Rep Power: 10
coldice is on a distinguished road
Thank you very much for your help, I build everything over night and know it works perfectly

Thanks,
Steve
wyldckat likes this.
coldice is offline   Reply With Quote

Old   December 26, 2015, 14:22
Default
  #6
New Member
 
miladrakhsha
Join Date: Aug 2012
Posts: 29
Rep Power: 13
miladrakhsha is on a distinguished road
Quote:
Originally Posted by coldice View Post
Thank you very much for your help, I build everything over night and know it works perfectly

Thanks,
Steve
I was wondering if you could explain what exactly was the problem. I am having the same issue and I am not able to resolve it. Would you be able to to provide some hints in regard to this?

It is greatly appreciated.
Milad
miladrakhsha is offline   Reply With Quote

Old   December 26, 2015, 16:32
Default
  #7
New Member
 
Join Date: Dec 2015
Posts: 4
Rep Power: 10
coldice is on a distinguished road
I don't know exactly what the problem was, only how I resolved the issue. Like I said I found a old version of flex on some canadian server, but I lost the link. If you don't find another old version you could try this one: https://aur.archlinux.org/packages/flex-android
But I haven't tested this one. I hope I could help a little
coldice is offline   Reply With Quote

Old   January 17, 2016, 05:29
Default
  #8
New Member
 
Weiwen Zhao
Join Date: Dec 2013
Posts: 19
Rep Power: 12
wwzhao is on a distinguished road
Greetings Steve, Bruno and Milad!
And to whom it may concern:

Recently Arch Linux upgraded flex to version 2.6.0-1. This break out the compilation for libtriSurface.so . To resolve this issue, you just need a simple patch , which is attached below:

Code:
diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
index 3c732c1..558b483 100644
--- a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
+++ b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
@@ -55,7 +55,7 @@ int yyFlexLexer::yylex()
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
//! \cond dummy
-#if YY_FLEX_SUBMINOR_VERSION < 34
+#if YY_FLEX_SUBMINOR_VERSION < 34 && YY_FLEX_MINOR_VERSION < 6
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
EDIT:
The package upgrade log is stored at /var/log/pacman.log. The following command show the upgrade log for flex.

Code:
➜  ~  grep 'flex' /var/log/pacman.log 
[2014-03-31 19:12] [PACMAN] installed flex (2.5.39-1)
[2015-12-08 18:28] [ALPM] upgraded flex (2.5.39-1 -> 2.6.0-1)

Regards,
Weiwen
wyldckat and apple-tree like this.
wwzhao is offline   Reply With Quote

Old   January 31, 2016, 11:39
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Just to wrap this thread, the issue/fix indicated by wwzhao has been fixed on OpenFOAM, as reported here: http://www.openfoam.org/mantisbt/view.php?id=1974

Looks like it was reported by the forum member from this post: http://www.cfd-online.com/Forums/ope...tml#post581443 - post #2
wyldckat is offline   Reply With Quote

Reply

Tags
archlinux, compiling, error, flex


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
Getting Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 13:55
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 06:15
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 19:20
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19


All times are GMT -4. The time now is 04:53.