Skip to content

Conversation

@hirschsn
Copy link
Contributor

@hirschsn hirschsn commented Aug 1, 2019

This is a fix mainly for the Ubuntu versions on neon and helium. I will take the liberty and just use my source code comment as PR description :)

Mitigation for old Ubuntu (should probably be also applied to Debian?):
Package 'libomp-dev' installs a symlink 'libgomp.so' to 'libomp.so' in /usr/lib/x86_64-linux. If this path is manually added (-L...), then ld uses this symlink and, thus, links against
the wrong openmp library. The mitigation is to ask gcc for its LIBRARY_PATH in combination with -fopenmp and manually add this as the very first LIBPATH.

Note, that this code also disables openmp if the mitigation command did not produce an
adequate path.

You can verify that the fix works as follows:
Not fixed:

$ ldd lib/sgpp/libsgppbase.so
[...]
        libomp.so.5 => /usr/lib/x86_64-linux-gnu/libomp.so.5
[...]

Fixed:

$ ldd lib/sgpp/libsgppbase.so
[...]
        libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1
[...]

//Edit: @leiterrl ping
//Edit2: Should resolve #152

For more information, see the comment inside the changes
(site_cons/SGppConfigure.py).
Copy link
Member

@valentjn valentjn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that would be really cool if this solved the problems with the tests.

@spc90
Copy link
Member

spc90 commented Aug 1, 2019

@leiterrl What would be the impact now for the Debian packaging? Because it seems adding libomp-dev as default depends should be avoided...

@hirschsn
Copy link
Contributor Author

hirschsn commented Aug 1, 2019

@leiterrl, @spc90 Unfortunately, I know nothing about your Debian packages. But if you compile with gcc, the correct dependencies are libgomp1.

@hirschsn
Copy link
Contributor Author

hirschsn commented Aug 1, 2019

Maybe to resolve a bit of confusion, sorry, I forgot to mention that in the initial description:

libomp is LLVM's OpenMP implementation.
libgomp is GNU's OpenMP implementation.

@leiterrl
Copy link
Member

leiterrl commented Aug 1, 2019

@leiterrl What would be the impact now for the Debian packaging? Because it seems adding libomp-dev as default depends should be avoided...

Isn't libomp-dev already added as a default dependency in the new debian package build script? We link against openmp no matter what so I guess we do need it anyways.

@spc90
Copy link
Member

spc90 commented Aug 1, 2019

@leiterrl What would be the impact now for the Debian packaging? Because it seems adding libomp-dev as default depends should be avoided...

Isn't libomp-dev already added as a default dependency in the new debian package build script? We link against openmp no matter what so I guess we do need it anyways.

The py script only enforces the libsgpp dependency for the python module, everything else can (and should!) be controlled from the .sh script. Of course default things, i.e. libz or numpy, should always stay, but you can always change libomp-dev to libgomp1 there if that fixes things. The current version of the .sh script dependency list is meant to exemplify, not be enforced as is for all cases.

@hirschsn
Copy link
Contributor Author

hirschsn commented Aug 1, 2019

Note that a user might have libomp-dev installed anyway, so just removing this from the list of dependencies does not fix the problem.

However, it is true that libomp-dev is not a dependency at all if you either deliver precompiled binaries or compile with gcc. If you compile with clang, then libomp-dev is a dependency.

@spc90
Copy link
Member

spc90 commented Aug 1, 2019

Note that a user might have libomp-dev installed anyway, so just removing this from the list of dependencies does not fix the problem.

However, it is true that libomp-dev is not a dependency at all if you either deliver precompiled binaries or compile with gcc. If you compile with clang, then libomp-dev is a dependency.

Well, we deliver the binaries, but for them to work we need to also make sure the target system has the right setup. I think that if we compile the right way and install libgomp1 on the target machine (whether they have already libomp-dev or not) we should be fine.

Either way, worst case scenario we add not just the Depends field for our Debian packaging, but also things like Breaks, Replaces or Conflicts if we want to reconfigure the target system in a way that avoids the misuse of the binaries or wrong linkages...

@leiterrl Do we plan to deliver binaries also for clang, or just gcc?

@leiterrl
Copy link
Member

leiterrl commented Aug 1, 2019

I'd say the way to go is to just deliver gcc binaries and use libgomp1 as a dependency.

@valentjn
Copy link
Member

valentjn commented Aug 1, 2019

At least for now Jenkins is happy again. Hopefully, this fixed the tests for good.

@valentjn valentjn merged commit 5def237 into SGpp:master Aug 1, 2019
@leiterrl leiterrl added this to the v3.3.0 milestone Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

pde tests failing sometimes

4 participants