Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_lambda_duoble fails when WITH_LLVM=yes #1224

Closed
erikagnvall opened this issue Mar 17, 2017 · 11 comments
Closed

test_lambda_duoble fails when WITH_LLVM=yes #1224

erikagnvall opened this issue Mar 17, 2017 · 11 comments

Comments

@erikagnvall
Copy link

The test_lambda_double test seems to fail when SymEngine is built with LLVM. Steps I took:

  • Checkout SymEngine master (ff148c1 at the time of writing)
  • Build and install LLVM (3.9.0) from source
  • Compile SymEngine (with WITH_LLVM=yes, this is the important part)
  • Run the tests with ctest

Result (irrelevant output removed):

Test project /home/erik/src/symengine
      Start  1: test_rcp
 1/35 Test  #1: test_rcp .........................   Passed    0.00 sec
[...]
      Start 31: test_lambda_double
31/35 Test #31: test_lambda_double ...............***Failed    0.04 sec
[...]

97% tests passed, 1 tests failed out of 35

Total Test time (real) =   0.54 sec

The following tests FAILED:
         31 - test_lambda_double (Failed)
Errors while running CTest

Specifically running the test_lambda_double executable outputs the following:

Intrinsic name not mangled correctly for type arguments! Should be: llvm.powi.f64
double (double, i32)* @llvm.powi.f64.i32
Intrinsic name not mangled correctly for type arguments! Should be: llvm.pow.f64
double (double, double)* @llvm.pow.f64.f64
LLVM ERROR: Broken function found, compilation aborted!

Unfortunately, I'm not familiar enough with LLVM to know how to fix it.

@ShikharJ
Copy link
Member

@meldanya I think these errors are because of the LLVM version being used. We currently test 3.8.0 if I'm not mistaken (I couldn't reproduce the errors on my machine). However, I'm not much confident to tell what can be done to fix this, or whether a probable fix will be backwards compatible with 3.8.0.

@erikagnvall
Copy link
Author

@ShikharJ As far as I could tell from the Travis logs, SymEngine isn't tested with the LLVM flag enabled? I'll try testing against LLVM 3.8.0 and let you know if I'm able to reproduce the problem.

@ShikharJ
Copy link
Member

@meldanya Please take a look here. Build 15 contains the WITH_LLVM=yes clause in the env line. For the version of LLVM used you can refer here.
Also, keep us posted if you face any more issues.

@erikagnvall
Copy link
Author

@ShikharJ Ah, sorry, I totally missed that!

However, I can't get it to work with LLVM 3.8.0 either. I get the same error. I didn't install with Conda though, I build LLVM from the source tar file here. Can't see how that should make any difference though?

Do you have any ideas for further troubleshooting?

@ShikharJ
Copy link
Member

Unfortunately, I don't. Maybe @isuruf can help.

@isuruf
Copy link
Member

isuruf commented Mar 18, 2017

@meldanya, I can't reproduce your issue. Can you give us a bit more info on your system and also how you compiled LLVM and symengine?

@erikagnvall
Copy link
Author

Sorry for the delay, sure I can provide more details. Let me know any other information you need:

$ cat /etc/issue
Ubuntu 16.04.2 LTS \n \l
$ uname -r
4.8.0-36-generic
$ cc --version
cc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
[...]
$ cmake --version
cmake version 3.5.1
[...]

Just to make sure there isn't anything weird with my system, I created a new VM in VirtualBox with Ubuntu 16.04.2 and ran the following script:

set -x
sudo apt install libgmp-dev cmake make git curl
mkdir -p ~/src && cd ~/src

# Fetch and unpack LLVM
curl http://releases.llvm.org/3.8.0/llvm-3.8.0.src.tar.xz | tar xJ
# Build and install LLVM
cd llvm-3.8.0.src &&
	mkdir -p build &&
	cd build &&
	cmake .. &&
	make -j2 &&
	sudo make install

cd ~/src

# Clone and build SymEngine
git clone https://github.com/symengine/symengine.git &&
	cd symengine &&
	cmake -DWITH_LLVM=yes . &&
	make &&
	ctest

I still get the same error.

When you run the tests, you install LLVM with Conda right? Could LLVM have been built with different options in the Conda package? I let CMake pick all the default options when I built it. I'm not very familiar with Conda so I wasn't able to find any manifest for how the llvmdev package was built.

@isuruf
Copy link
Member

isuruf commented Mar 27, 2017

Thanks for the detailed instructions. I can reproduce the error. I'll look into this more.

Btw, script for how conda builds it is here, https://github.com/conda-forge/llvmdev-feedstock/blob/master/recipe/build.sh

@isuruf
Copy link
Member

isuruf commented Mar 27, 2017

When I build LLVM in Release mode, it works fine. Not sure why it fails in debug mode though

@erikagnvall
Copy link
Author

@isuruf I just tried building LLVM in Release mode and that works for me as well.

Thanks for the help to find a workaround. I'll let you decide if you want to keep the issue open, from my point of view it could be closed now.

@lkeegan
Copy link
Member

lkeegan commented May 14, 2021

fixed in #1751

@lkeegan lkeegan closed this as completed May 14, 2021
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

No branches or pull requests

4 participants