I am new to Chapel and have been trying to install it with LLVM support. The make and make check commands work successfully but when I try to generate LLVM IR from a sample chapel program, it gives an error saying fatal error: 'cblas.h' file not found.
I would be happy if someone guided me on how to tackle this situation here.
Compile command(s):
```source util/setchplenv.bash
export CHPL_LLVM=llvm
make -j24
make check
chpl loop-opt-examples.chpl --llvm --llvm-print-ir=test10d --llvm-print-ir-stage=full > ir.ll
**Output of the last command**
^~~~~~~~~
1 error generated.
error: error running clang during code generation
```
chpl --version:
chpl Version 1.16.0
Copyright (c) 2004-2017, Cray Inc. (See LICENSE file for more details)
Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_MAKE: make
CHPL_ATOMICS: intrinsics
CHPL_GMP: gmp
CHPL_HWLOC: hwloc
CHPL_REGEXP: re2
CHPL_WIDE_POINTERS: struct
CHPL_AUX_FILESYS: none
gcc --version or clang --version:
gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hi @ysahil97 -- I'm not an expert on our LLVM support but am checking to see if I can reproduce this. If I'm not able to make progress, we may have better luck on Monday when those more knowledgeable in LLVM and BLAS are in the office (@dmk42 @ben-albrecht @mppf).
OK, I was able to reproduce. I'm guessing the problem is that you're using a module that requires BLAS to be installed (like LinearAlgebra whose requirements are noted here), but I don't have BLAS installed myself, so don't know if that's the only problem or not offhand.
I see you are on Ubuntu. Try this to get cblas.h.
apt-get install libblas-dev
Hi all,
Thanks for the help. I have now successfully installed libblas library and now chapel is able to generate LLVM-IR properly.
Regards
Sahil Yerawar
Most helpful comment
Hi all,
Thanks for the help. I have now successfully installed libblas library and now chapel is able to generate LLVM-IR properly.
Regards
Sahil Yerawar