I am interested in experimenting with OpenLB for simulation of liquid-liquid flows and have been trying to compile this under Ubuntu-8.04 (64-bit) using gnu compilers. The library itself compiles with no issues whether I use gcc, g++, or mpicc and whether I use off, MPI, or OMP. The problem is when I try to ‘make’ the example problems. They compile correctly and the .o files are created, but when the linker runs to create the executable I get a huge list of errors. I was able to compile cavity2d and multicomponent2d using g++ with PARALLEL_MODE=OFF. Any help would be appreciated. Is it perhaps not finding the mpi headers it needs or something? I have mpich2 installed and also have OpenMPI (separately) and have tried both with the same result.
You may have to do a
I have been doing a ‘make clean’ and a ‘make cleanbuild’ in between each try at compiling. I found a similar compiling issue on another thread ("[parallel] compilation"). I tried the modified sources linked there and this fixed some of the issues and so the examples will compile with g++ and paralllel off. With PARALLEL_MODE=MPI, I get a bunch of errors related to mpiManager.o saying there are undefined references. I checked that mpiManager.o does exist.
g++ rayleighTaylor.o -L…/…/build/generic/lib -lolb -o rayleighTaylor
…/…/build/generic/lib/libolb.a(mpiManager.o): In function
void olb::singleton::MpiManager::reduce<double>(double, double&, int, int, int)': mpiManager.cpp:(.text+0x18a): undefined reference toMPI_Reduce’
…/…/build/generic/lib/libolb.a(mpiManager.o): In function `void olb::singleton::MpiManager::reduce(float, float&, int, int, int)’:
[…more of the same…]
mpiManager.cpp:(.text+0xc59): undefined reference to
MPI_Send' ../../build/generic/lib/libolb.a(mpiManager.o): In functionolb::singleton::MpiManager::barrier(int)’:
mpiManager.cpp:(.text+0xc6b): undefined reference to
MPI_Barrier' ../../build/generic/lib/libolb.a(mpiManager.o): In functionolb::singleton::MpiManager::getTime() const’:
mpiManager.cpp:(.text+0xc81): undefined reference to
MPI_Wtime' ../../build/generic/lib/libolb.a(mpiManager.o): In functionolb::singleton::MpiManager::waitAll(olb::singleton::MpiNonBlockingHelper&)’:
mpiManager.cpp:(.text+0xdeb): undefined reference to `MPI_Waitall’
collect2: ld returned 1 exit status
make: *** [rayleighTaylor] Error 1
Incidentally, when I try to compile (g++) using OMP instead, the ompManager.cpp does not compile and gives the following error.
g++ -DPARALLEL_MODE_OMP -fopenmp -m64 -O3 -Wall -I…/…/src -c ompManager.cpp -o …/…/build/generic/obj/ompManager.o
ompManager.cpp:47: error: ‘omp’ cannot be thread-local because it has non-POD type ‘ompManager’
make: *** […/…/build/generic/obj/ompManager.o] Error 1
I have discovered that everything works with no problem if I compile with ‘mpicxx’.