mrklein / openfoam-os-x

Patches for OpenFOAM(R) to build it on OS X
93 stars 33 forks source link

dylib warning #52

Closed burgreen closed 3 years ago

burgreen commented 4 years ago

First, thanks for this amazing contribution.

I am working from OpenFOAM-v6.0. For every executable, there are warnings that the libs in system/controldict are not neing found or loaded, for example:

--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1247
    dlOpen: using fallback library name "libfiniteVolume.dylib"
--> FOAM Warning : 
    From function void *Foam::dlOpen(const Foam::fileName &, const bool)
    in file POSIX.C at line 1258
    dlopen error : dlopen(libfiniteVolume.dylib, 9): image not found
--> FOAM Warning : 
    From function bool Foam::dlLibraryTable::open(const Foam::fileName &, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 105
    could not load "libfiniteVolume.so"

However, every executable is running fine.

I have changed many of the suspected environment variables (e.g., DYLD_LIBRARY_PATH, etc), and the warnings persist.

What is going on this this?

burgreen commented 4 years ago

Adding the proper path to LD_LIBRARY_PATH fixes the warning.

mrklein commented 4 years ago

Hi,

That was quick, but theoretically your solution does not make sense, since LD_LIBRARY_PATH variable is not used by macOS dynamic linker. Could you add to the issue the following:

burgreen commented 4 years ago

Yes, I agree. I modified all of the DYLD env variables first, and then tried LD_LIBRARY_PATH for the heck of it, which seemed to work (??).

macOS Catalina 10.15.4 OpenFOAM 6.0 release patched with your OpenFOAM-6-47517 patch (which is inconsistent on my part) Apple clang version 11.0.3

mrklein commented 4 years ago

I was not able to reproduce the error.

Here is the list of what I have done:

  1. I have downloaded release tarball from http://dl.openfoam.org/source/6.
  2. Moved OpenFOAM-6-version-6 into OpenFOAM-6.
  3. Patched sources with OpenFOAM-6-47517.patch patch.
  4. cd into $HOME/OpenFOAM/OpenFOAM-6.
  5. Set up environment with source /etc/bashrc.
  6. Ran Allwmake script.

After these operations I got working OpenFOAM(R). At least I can execute icoFoam and blockMesh without any errors. I have macOS 10.15.5, yet, I do not think this version difference causes the problem.

Could you describe the way you have compiled software?

mrklein commented 3 years ago

Hi,

Shall we close the issue or you can still reproduce it?

burgreen commented 3 years ago

I compiled the software using a stack of required third party software compiled using Spack. Then, I modified my environment to include the Spack generated links. Then, I ran the wmake script.

My guess is the issue is somehow embedded in my build approach, so the issue is most likely unique to me.

Please close the issue.