CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Weird Problem while compiling new library (https://www.cfd-online.com/Forums/openfoam-programming-development/215102-weird-problem-while-compiling-new-library.html)

ashish.vinayak February 22, 2019 07:38

Weird Problem while compiling new library
 
Hello everyone,

I am trying to compile $FOAM_SRC/transportModels separately since I want to rewrite the $FOAM_SRC/transportModels/interfaceProperties library. I created $WM_PROJECT_USER_DIR/src folder and copied $FOAM_SRC/transportModels to it.

The library seems to compile correctly and is present in $FOAM_USER_LIBBIN. I then copied interFOAM to $WM_PROJECT_USER_DIR/applications to compile the solver based on this "new" libraries. Changed all the required data in Make/options as well. However, when I try to compile interFOAM using these "new" libraries, I get undefined references. I have attached the error report for the solver compilation. Has someone faced this or a similar kind of problem?

I can provide all the information required, if someone is able to help me !

PS. OpenFOAM-5.x

ashish.vinayak February 22, 2019 08:37

Okay, I seem to have solved the problem myself. Turns out that wmake does not return any error if it does not find the correct file in the linking process.

For future reference:
ldd libname.so
can be used to find which files are not linked correctly and then the correct links can be established. :)

dviam March 14, 2019 09:46

Quote:

Originally Posted by ashish.vinayak (Post 725654)
Okay, I seem to have solved the problem myself. Turns out that wmake does not return any error if it does not find the correct file in the linking process.

For future reference:
ldd libname.so
can be used to find which files are not linked correctly and then the correct links can be established. :)

Can you expound on the steps you took to get the linking done properly? I am having a similar issue where my new library compiles properly but when I try to compile the solver using wmake, I am getting undefined references errors. To my knowledge, the Make options file is correctly pointing to the new library.

ashish.vinayak March 15, 2019 10:39

Quote:

Originally Posted by dviam (Post 727792)
Can you expound on the steps you took to get the linking done properly? I am having a similar issue where my new library compiles properly but when I try to compile the solver using wmake, I am getting undefined references errors. To my knowledge, the Make options file is correctly pointing to the new library.

I would suggest you look if all the supported libraries are linked properly. Use

>> ldd libname.so

where libname is the library in the USER OpenFOAM directory (OpenFOAM/usrname/platforms/linuxXYZOpt/libs/libname.so) and post the output so that I could help you debug.


All times are GMT -4. The time now is 23:22.