sdfibm icon indicating copy to clipboard operation
sdfibm copied to clipboard

Problem with compiling

Open mostanad opened this issue 3 years ago • 8 comments

Hi Zhang What is this error mentioning? cellenumerator.cpp:(.text+0x369): undefined reference to `Foam::meshSearch::findNearestCell(Foam::Vector const&, int, bool) const' collect2: error: ld returned 1 exit status Makefile:49: recipe for target 'sdfibm' failed make: *** [sdfibm] Error 1 It's my error after I installed OF6. Then through your three commands, it shows the error.

mostanad avatar Sep 27 '21 23:09 mostanad

Hi Zhang What is this error mentioning? cellenumerator.cpp:(.text+0x369): undefined reference to `Foam::meshSearch::findNearestCell(Foam::Vector const&, int, bool) const' collect2: error: ld returned 1 exit status Makefile:49: recipe for target 'sdfibm' failed make: *** [sdfibm] Error 1 It's my error after I installed OF6. Then through your three commands, it shows the error.

this generally happens when your older links of functions and types are there in the old .so file,

better delete old .so files and recompile

shashanktiwari619 avatar Sep 27 '21 23:09 shashanktiwari619

Thanks or your reply. What .so file do you mean? There are so many of them in /lib or /usr/lib.

mostanad avatar Sep 27 '21 23:09 mostanad

Still can't figure out what the problem is. I hope you can make it clear.

mostanad avatar Sep 28 '21 03:09 mostanad

To begin with...

  1. Tell us what Linux system are you using (also in case it is Linux running on WSL, mention it)?
  2. Have you checked that your OF6 is compiled correctly?
  3. Let us know the GCC version that you are using. You can check this using 'gcc -v'.

shashanktiwari619 avatar Sep 28 '21 09:09 shashanktiwari619

OK. 1- Ubuntu 16.04 2- Yes. I checked it through icoFoam -help. It works properly 3- This is the output of gcc command: COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)

mostanad avatar Sep 28 '21 11:09 mostanad

Still no opinion? I truly need to test our solver.

mostanad avatar Sep 29 '21 09:09 mostanad

I encountered an error while installing, does anyone have a solution for this issue?

In file included from main.cpp:9:0: createFields.h: In function ‘int main(int, char**)’: createFields.h:7:20: error: invalid use of ‘Foam::solution::solution’ setRefCell(p, mesh.solution().dict().subDict("PISO"), pRefCell, pRefValue); ^~~~~~~~ Makefile:56: recipe for target 'main.o' failed make: *** [main.o] Error 1

lekhindia avatar Apr 23 '23 10:04 lekhindia

Dear Zhang, Thank you for “sdfibm” code. I successfully installed “sdfibm” solver and soft-linked it to a system-wide path. I also tested “OpenFOAM v9” by running the cavity case in both serial and parallel mode. I tried different “./Allrun” files to compile the code. None of them works. Can you please guide me how you already compile your solver? Is it possible to couple this solver to others solver for adding IBM to other computational and boundary condition? Thanks in advance.

hamedsedighi563 avatar Feb 19 '24 08:02 hamedsedighi563