Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling the program #7

Closed
mhwang2000 opened this issue Feb 13, 2019 · 3 comments
Closed

Error when compiling the program #7

mhwang2000 opened this issue Feb 13, 2019 · 3 comments

Comments

@mhwang2000
Copy link

I tried to compile rheoTool with OpenFoam v4.1 on CentOS 7.x, but it failed in the linking stage for solvers/rheoFoam and solvers/rheoInterFoam:
-lm -o /mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/bin/rheoFoam
/usr/bin/ld: warning: libEDFModels.so, needed by /mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/lib/libBCRheoTool.so, not found (try using -rpath or -rpath-link)
/mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/lib/libpostProcessingRheoTool.so: undefined reference to Foam::EDFEquation::FK_' /mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/lib/libBCRheoTool.so: undefined reference to Foam::EDFEquation::eK_'
/mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/lib/libBCRheoTool.so: undefined reference to `Foam::EDFEquation::kbK_'
collect2: error: ld returned 1 exit status
make: *** [/mnt/data1/users/software/OpenFoam/rheoTool/of40/src/build/bin/rheoFoam] Error 1

It appears in solvers/rheoFoam/Make/options and solvers/rheoInterFoam/Make/options EDFModels library link option and include path are not specified.

Adding the path and libray linkng options has fixed the problem:
cp solvers/rheoEFoam/Make/options solvers/rheoFoam/Make/options
sed -i.back -e 's!postProcessing/postProcUtils/lnInclude!postProcessing/postProcUtils/lnInclude -I../../libs/EDFModels/lnInclude!' -e 's!-lpostProcessingRheoTool!-lpostProcessingRheoTool -L$(FOAM_USER_LIBBIN) -lEDFModels!' solvers/rheoInterFoam/Make/options

@fppimenta
Copy link
Owner

Did you modified the code for these solvers before compiling, or the errors happen for the original code as provided in the repo?

@mhwang2000
Copy link
Author

No, I have not modified the code. I simply downloaded the code yesterday/today:
git clone https://github.com/fppimenta/rheoTool

@fppimenta
Copy link
Owner

Well that's strange. It works on red hat and I guess other persons get it installed in centos also. Our tests are exclusively in Ubuntu OS. The error is in fact related with ld and its need to know where to find libEDFModels.so. That lib is not directly used by those two solvers, but is needed as dependency of the BC lib. It seems your ld is behaving differently regarding other OS (perhaps a version or flag issue).
Anyway, thanks for the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants