Skip to content

Conversation

@luca-heltai
Copy link
Member

Closes #65

libgmp-dev \
libgtest-dev \
libmpc-dev \
llvm-15 \
Copy link
Member

@marcfehling marcfehling Jul 21, 2025

Choose a reason for hiding this comment

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

This way we will have two instances of llvm 15 installed: one through the ubuntu repository and one through backports 9.6.0. I am not sure whether there will be linking conflicts happening again later when building deal.II.

I believe that there must be a simpler way to enable llvm in symengine by using the already installed package. Simply specifying WITH_LLVM=ON did not work as I had tried before. Maybe providing LLVM_DIR as a cmake variable could do the trick, which need to point to the llvm installation of backports. But for this we need to know where llvm is installed via backports. I didn't get around to find it yet

Copy link
Member Author

Choose a reason for hiding this comment

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

this worked. I don't think two are installed, if the same one is already installed, apt does not install it twice, I think.

The current dealii/dealii:master-noble is built with this and it went through. Where was this failing? In user codes, or in the building of the library?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the problem was that both llvm and llvm-15 were installed (which are two different packages). If they both depend on llvm-15, I think we are safe.

Copy link
Member

@marcfehling marcfehling Jul 21, 2025

Choose a reason for hiding this comment

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

The current dealii/dealii:master-noble is built with this and it went through. Where was this failing? In user codes, or in the building of the library?

It failed during linking the deal.II library (EDIT: issue manifests at runtime, not during linking). There were duplicate symbols defined from multiple llvm installations.

I think the problem was that both llvm and llvm-15 were installed (which are two different packages). If they both depend on llvm-15, I think we are safe.

On the dependencies image, we install libllvm15 on jammy and libllvm19 on noble according to the raw logs. We are not safe installing llvm-15 on all versions.

symengine would like to find LLVMConfig.cmake or llvm-config.cmake somewhere. My take on this is the following: We need to figure out if those files are already located somewhere on our dependencies docker image, and specify the path via LLVM_DIR. If the libllvm package does not provide these files, we need to install the corresponding llvm package of the same version.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, to be precise, it does not fail on linking, but at run time. I could compile and link step-40 with no problems. However, I see the error you point to at run time. I thought it was a linking error, but it's actually a running error.

Copy link
Member

Choose a reason for hiding this comment

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

You are correct. My recollection of the issue is cloudy. It appears at runtime. Running some tests in the deal.II testsuite should also trigger the error.

I am surprised that the test on jammy in dealii/code-gallery#229 also failed when we install libllvm15 and llvm-15, even though one is a dependency of the other.

libgmp-dev \
libgtest-dev \
libmpc-dev \
llvm-15 \
Copy link
Member

@marcfehling marcfehling Jul 21, 2025

Choose a reason for hiding this comment

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

The current dealii/dealii:master-noble is built with this and it went through. Where was this failing? In user codes, or in the building of the library?

It failed during linking the deal.II library (EDIT: issue manifests at runtime, not during linking). There were duplicate symbols defined from multiple llvm installations.

I think the problem was that both llvm and llvm-15 were installed (which are two different packages). If they both depend on llvm-15, I think we are safe.

On the dependencies image, we install libllvm15 on jammy and libllvm19 on noble according to the raw logs. We are not safe installing llvm-15 on all versions.

symengine would like to find LLVMConfig.cmake or llvm-config.cmake somewhere. My take on this is the following: We need to figure out if those files are already located somewhere on our dependencies docker image, and specify the path via LLVM_DIR. If the libllvm package does not provide these files, we need to install the corresponding llvm package of the same version.

@marcfehling
Copy link
Member

marcfehling commented Jul 21, 2025

The code-gallery tester now fails in user codes because of CommandLine Error: Option 'x86-experimental-lvi-inline-asm-hardening' registered more than once!, see dealii/code-gallery#229.

I will build the dependencies images again without the additional llvm.

@marcfehling
Copy link
Member

... which reminds me that we need to make progress with #59 :-)

@luca-heltai luca-heltai marked this pull request as draft July 21, 2025 15:28
@marcfehling
Copy link
Member

This might be related https://groups.google.com/g/llvm-dev/c/0q76u0BeER8/m/A4qeqjytBwAJ

This is usually a linkage error when the same library is being included in both a static library and a shared library.

@marcfehling
Copy link
Member

marcfehling commented Jul 22, 2025

Maybe building symengine with BUILD_SHARED_LIBS=off will do the trick.

Then we only need to figure out how to install llvm-XX corresponding to the libllvmXX that is already installed. We need llvm-XX as symengine is otherwise unable to find it. Maybe we even need llvm-XX-dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link symengine against llvm.

3 participants