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

Cannot build the development version of pluto on Ubuntu 18.04.3 LTS #68

Closed
dpotop opened this issue Feb 5, 2020 · 18 comments
Closed

Cannot build the development version of pluto on Ubuntu 18.04.3 LTS #68

dpotop opened this issue Feb 5, 2020 · 18 comments

Comments

@dpotop
Copy link

dpotop commented Feb 5, 2020

Hello,

I'm on a pretty recent version of Ubuntu (18.04.3 LTS).
I installed clang-9 (which installs llvm-9). The same problem appears
with clang-6.0.

I followed the build process for the devel branch, as described in
https://github.com/bondhugula/pluto
The process blocks while running ./configure (with no arguments). Here are
the last lines it prints:
checking which clang to use... system
checking for llvm-config... yes
checking for main in -lLLVM-9.0.0... yes
checking clang/Basic/SourceLocation.h usability... no
checking clang/Basic/SourceLocation.h presence... no
checking for clang/Basic/SourceLocation.h... no
configure: error: clang header file not found
checking for pet/Makefile... no
configure: error: configure in pet/ failed

To get to this point, I also had to make symbolic links to FileCheck-9 and
llvm-config-9 to get rid of the "-9" (otherwise, the installation build blocks
earlier, as it requires FileCheck and llvm-config without the version number).

Addendum: the stable version compiles with no problems.

Best,
dpotop

@bondhugula
Copy link
Owner

I assume you are using the master branch? Output of your $ git describe HEAD?

@bondhugula
Copy link
Owner

bondhugula commented Feb 5, 2020

clang/llvm-6.0 should work. Try:

cd pet/
./configure

pet/config.log will h ave the errors.

@dpotop
Copy link
Author

dpotop commented Feb 5, 2020

Thanks for your help.
Unfortunately, it still doesn't work.

I did the tests you suggested. git status returns:

On branch master
Your branch is up to date with 'origin/master'.

The sequence of commands I use up to error is:

ln -s /usr/bin/llvm-config-6.0 /home/lopht/bin/llvm-config
ln -s /usr/bin/FileCheck-6.0 /home/lopht/bin/FileCheck
git clone https://github.com/bondhugula/pluto.git
cd pluto
git submodule init
git submodule update
./autogen.sh
./configure

Configure fails on PET. I have also tried to call "./configure" from the pet folder,
the result is the same. I attached the log of the configure process for the
PET folder.
error.log

Please, advise,
dpotop

@bondhugula
Copy link
Owner

Thanks for your help.
Unfortunately, it still doesn't work.

I did the tests you suggested. git status returns:

On branch master
Your branch is up to date with 'origin/master'.

The sequence of commands I use up to error is:

ln -s /usr/bin/llvm-config-6.0 /home/lopht/bin/llvm-config
ln -s /usr/bin/FileCheck-6.0 /home/lopht/bin/FileCheck
git clone https://github.com/bondhugula/pluto.git
cd pluto
git submodule init
git submodule update
./autogen.sh
./configure

Configure fails on PET. I have also tried to call "./configure" from the pet folder,
the result is the same. I attached the log of the configure process for the
PET folder.
error.log

Please attach your pet/config.log and not a log of the configure you ran.

The top level configure failed because the pet configure is failing. So, you could just for now focus on getting pet to build first.

@dpotop
Copy link
Author

dpotop commented Feb 6, 2020

I looked into the pet/config.log file and I could remove the first cause of error, which was that I did not install libclang-6.0-dev. It's funny it does not check for this dependency.

Now, configuring blocks at another point, where I really don't understand what is happening. I attach the new config.log:

config.log

Here is the last output of the configuration script before error:

checking clang/Basic/LangStandard.h usability... no
checking clang/Basic/LangStandard.h presence... no
checking for clang/Basic/LangStandard.h... no
checking llvm/Option/Arg.h usability... yes
checking llvm/Option/Arg.h presence... yes
checking for llvm/Option/Arg.h... yes
checking for clang/Basic/LangStandard.h... (cached) no
checking for main in -lclangEdit... yes
configure: isl sources in /home/lopht/pluto/isl
checking which isl to use... build
../pet/configure: line 17123: syntax error near unexpected token ISL,' ../pet/configure: line 17123: PKG_CHECK_MODULES(ISL, isl)'
checking for pet/Makefile... no
configure: error: configure in pet/ failed

I tried to compile isl manually:

cd isl
./configure --prefix=/home/lopht
make
make install

and then I re-configured with:

./configure --with-isl-prefix=/home/lopht

The compilation of isl went on smoothly, but for some reason the top-level ./configure seems to ignore the option (the output above corresponds to the output after installing isl).

@ghost
Copy link

ghost commented Feb 6, 2020

I am on Arch Linux with the LLVM 9 and development branch of Pluto.
I am also facing an error in pet folder:-

/usr/include/clang/Basic/SyncScope.h:147:18: error: ‘make_unique’ is not a member of ‘llvm’; did you mean ‘std::make_unique’?
147 | return llvm::make_unique();

pet log file:- config.log

@bondhugula
Copy link
Owner

I am on Arch Linux with the LLVM 9 and development branch of Pluto.
I am also facing an error in pet folder:-

/usr/include/clang/Basic/SyncScope.h:147:18: error: ‘make_unique’ is not a member of ‘llvm’; did you mean ‘std::make_unique’?
147 | return llvm::make_unique();

pet log file:- config.log

The problem is pretty clear from the log.

configure:16318: checking clang/Basic/SourceLocation.h usability
configure:16318: g++ -c -g -O2 -I/usr/lib/llvm-6.0/include -std=c++0x -fuse-ld=gold  -Wl,--no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  conftest.cpp >&5
conftest.cpp:57:10: fatal error: clang/Basic/SourceLocation.h: No such file or directory
 #include <clang/Basic/SourceLocation.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
configure:16318: $? = 1
configure: failed program was:

You either don't have the necessary includes or have them in the wrong place.

@bondhugula
Copy link
Owner

bondhugula commented Feb 6, 2020

I am on Arch Linux with the LLVM 9 and development branch of Pluto.
I am also facing an error in pet folder:-

/usr/include/clang/Basic/SyncScope.h:147:18: error: ‘make_unique’ is not a member of ‘llvm’; did you mean ‘std::make_unique’?
147 | return llvm::make_unique();

pet log file:- config.log

Please post:

  1. the output of cd pet; git describe HEAD
  2. your pet/config.log
    You most likely have a more recent version of LLVM than supported by the pet/ module you checked out.

@ghost
Copy link

ghost commented Feb 6, 2020

The problem is pretty clear from the log.

configure:16318: checking clang/Basic/SourceLocation.h usability
configure:16318: g++ -c -g -O2 -I/usr/lib/llvm-6.0/include -std=c++0x -fuse-ld=gold  -Wl,--no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  conftest.cpp >&5
conftest.cpp:57:10: fatal error: clang/Basic/SourceLocation.h: No such file or directory
 #include <clang/Basic/SourceLocation.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
configure:16318: $? = 1
configure: failed program was:

You either don't have the necessary includes or have them in the wrong place.

Thanks for your reply
I have llvm install in /usr/include/llvm rather than usr/lib/llvm-6.0
where do I change this in pluto configuration?

Please post:

1. the output of `cd pet; git describe HEAD`

0.11.4-926-gbd8689b

2. your pet/config.log

I already attached log file

   You most likely have a more recent version of LLVM than supported by the pet/ module you checked out.

Yes, I build it from the development branch.

@bondhugula
Copy link
Owner

I have llvm install in /usr/include/llvm rather than usr/lib/llvm-6.0
where do I change this in pluto configuration?

Please see the error message

The problem is pretty clear from the log.

configure:16318: checking clang/Basic/SourceLocation.h usability
configure:16318: g++ -c -g -O2 -I/usr/lib/llvm-6.0/include -std=c++0x -fuse-ld=gold  -Wl,--no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  conftest.cpp >&5
conftest.cpp:57:10: fatal error: clang/Basic/SourceLocation.h: No such file or directory
 #include <clang/Basic/SourceLocation.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
configure:16318: $? = 1
configure: failed program was:

You either don't have the necessary includes or have them in the wrong place.

Thanks for your reply
I have llvm install in /usr/include/llvm rather than usr/lib/llvm-6.0
where do I change this in pluto configuration?

Please see the error message above. Where do you have your clang/Basic/SourceLocation.h located? Or do you have it at all?

@ghost
Copy link

ghost commented Feb 6, 2020

Please see the error message above. Where do you have your clang/Basic/SourceLocation.h located? Or do you have it at all?

I do have clang headers in /usr/include/clang, see screenshot

sourcelocation

How do pluto is able to locate them?

@bondhugula
Copy link
Owner

It looks like you don't have the headers at the right place and potentially different versions at different places. I'd recommend doing a clean build of llvm and clang from sources, and installing them. You can use --with-clang-prefix with pluto's configure to say where you have them installed. If you don't use the prefix, the llvm-config you have in your PATH (run llvm-config --version to check) will determine what gets used.

@dpotop
Copy link
Author

dpotop commented Feb 6, 2020

Can you please (also) take a look at my issue on Ubuntu (above) ?
I have provided the config.log.

Best,
dpotop

@bondhugula
Copy link
Owner

Can you please (also) take a look at my issue on Ubuntu (above) ?
I have provided the config.log.

Best,
dpotop

The issue is a different one in your case:

conftest.cpp: In function 'int main()':
conftest.cpp:50:6: error: 'class clang::FunctionDecl' has no member named 'getBeginLoc'; did you mean 'getDefinition'?
  fd->getBeginLoc();
      ^~~~~~~~~~~
      getDefinition
conftest.cpp:51:6: error: 'class clang::FunctionDecl' has no member named 'getEndLoc'
  fd->getEndLoc();
      ^~~~~~~~~
configure:16913: $? = 1

This could again be due to mixing different versions or just that llvm/clang 6.0 doesn't work correctly with pet. I'd just recommend a clean build of llvm and clang 8.0 or 9.0 from sources as mentioned upthread. This is known to work.

@dpotop
Copy link
Author

dpotop commented Feb 6, 2020

This could again be due to mixing different versions or just that llvm/clang 6.0 doesn't work correctly with pet. I'd just recommend a clean build of llvm and clang 8.0 or 9.0 from sources as mentioned upthread. This is known to work.

Just to be sure I understand well, because it sounds quite heavy. I should:

  1. uninstall clang-6.0 using apt
  2. uninstall clang-9 using apt
  3. download the sources (.tar.gz) and compile clang-9 from scratch.

Right?

Should I also uninstall gcc ?

@bondhugula
Copy link
Owner

This could again be due to mixing different versions or just that llvm/clang 6.0 doesn't work correctly with pet. I'd just recommend a clean build of llvm and clang 8.0 or 9.0 from sources as mentioned upthread. This is known to work.

Just to be sure I understand well, because it sounds quite heavy. I should:

  1. uninstall clang-6.0 using apt
  2. uninstall clang-9 using apt
  3. download the sources (.tar.gz) and compile clang-9 from scratch.

Right?

Should I also uninstall gcc ?

You don't have to uninstall any existing versions. Just install the new one in a custom location and make sure you provide its prefix with --with-clang-prefix when you configure Pluto. You could even separately try to build pet to verify by:

cd pet/
./configure --with-clang-prefix=<prefix>
make

If the above works, it should also work with Pluto.

@dpotop
Copy link
Author

dpotop commented Feb 19, 2020

Hello again,

I tried again, as you suggested - clean compilation of llvm and clang from sources, version 9.0.1.
I get different errors (I'm now compiling on a MacOSX, as the Ubuntu was a VM with its own problems). What is funny is that I was able to compile it on Raspbian on a Raspberry Pi 4... But then I need it on my PC.

The error is also weird - entire fields of a struct disappear during C preprocessing (e.g. unroll_type in struct clast_for in file include/cloog/clast.h when compiling ast_transform.c) but are then used in the code. BTW, I don't even know how a struct field can disappear, type and all, during preprocessing, given that there is no #ifdef around them.

Can you please tell me what environment you have :

  • OS and version (I'm on MacOSX Catalina, which may be part of the problem).
  • compiler, linker, and libc version.
  • Is it a 32-bit or a 64-bit compilation chain?

I'm really motivated to use pluto, but I'm really stuck right now not being able to compile it.

Best regards,
dpotop

@bondhugula
Copy link
Owner

bondhugula commented Feb 20, 2020

Hello again,

I tried again, as you suggested - clean compilation of llvm and clang from sources, version 9.0.1.
I get different errors (I'm now compiling on a MacOSX, as the Ubuntu was a VM with its own
problems). What is funny is that I was able to compile it on Raspbian on a Raspberry Pi 4... But then I need it on my PC.

The error is also weird - entire fields of a struct disappear during C preprocessing (e.g. unroll_type in struct clast_for in file include/cloog/clast.h when compiling ast_transform.c) but are then used in

Can you please post the errors you observed? The cloog submodule was recently updated - did you update your submodules?

Can you please tell me what environment you have :

I think it'll be useful to get it working on your environment (it really should work on at least other Linux distributions without much trouble AFAICT) instead of trying to compare with an environment where it works or look at things like OS / compiler tool chain version, etc. (I typically use Fedora 64-bit with the GCC tool chain.) I don't think your errors have anything to do with the compiler tool chain /version or 32-bit/64-bit.

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

2 participants