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

error thrown when building #52

Open
phoenixrain-pku opened this issue Aug 6, 2022 · 11 comments
Open

error thrown when building #52

phoenixrain-pku opened this issue Aug 6, 2022 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@phoenixrain-pku
Copy link

Hi dear authors, when I tried to build the project, an error occurs at the final stage.

My build instructions: CC=gcc CXX=g++ FC=gfortran cmake .. -DCMAKE_BUILD_TYPE=Release -DEXATN_BUILD_TESTS=TRUE -DBLAS_LIB=ATLAS -DBLAS_PATH=/usr/lib/x86_64-linux-gnu/blas

The error information:

Building CXX object src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/taprol_syntax_handler.cpp.o
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:16:50: error: expected class-name before ‘{’ token
   16 | class TaProlSyntaxHandler : public SyntaxHandler {
      |                                                  ^
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: In constructor ‘{anonymous}::TaProlSyntaxHandler::TaProlSyntaxHandler()’:
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:18:27: error: class ‘{anonymous}::TaProlSyntaxHandler’ does not have any field named ‘SyntaxHandler’
   18 |   TaProlSyntaxHandler() : SyntaxHandler("taprol") {}
      |                           ^~~~~~~~~~~~~
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: In member function ‘void {anonymous}::TaProlSyntaxHandler::GetReplacement(clang::Preprocessor&, clang::Declarator&, clang::CachedTokens&, llvm::raw_string_ostream&)’:
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:44:11: error: ‘getDeclText’ was not declared in this scope
   44 |     OS << getDeclText(PP, D) << "{\n";
      |           ^~~~~~~~~~~
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: At global scope:
/home/lhp/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:62:8: error: ‘SyntaxHandlerRegistry’ does not name a type
   62 | static SyntaxHandlerRegistry::Add<TaProlSyntaxHandler>
      |        ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/build.make:76: src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/taprol_syntax_handler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2334: src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

It seems that just editing taprol_syntax_handler.cpp file can save this problem, but I couldn't find how to fix it.
Thank you so much.

@paaige
Copy link

paaige commented Sep 10, 2022

I'm running into this issue as well when attempting to install exaTN (per the instructions, using openBLAS and cuda enabled). Tagging @DmitryLyakh for visibility. Could this have to do with a clang update not supporting the SyntaxHandler plugin?

@DmitryLyakh DmitryLyakh self-assigned this Sep 10, 2022
@DmitryLyakh
Copy link
Member

Which platform are you trying to build on, Linux or Mac? Which compiler/version?

@paaige
Copy link

paaige commented Sep 10, 2022

Ubuntu 20.04. gcc 9, also clang-12, if that's important.

@DmitryLyakh
Copy link
Member

Ok, good, ExaTN only needs GNU compilers. Could you please try running the following script somewhere in an empty directory? It will install ExaTN + cuQuantum in your $HOME/build, but please feel free to modify the first three environment variables with your preferred paths. Also, I would first install the recent OpenBLAS library from github and then provide to ExaTN "-DBLAS_LIB=OPENBLAS -DBLAS_PATH=<path_to_where_libopenblas.so_lives>" instead of the ATLAS option. But for now you can just try your existing BLAS. Note that the ExaTN build below assumes you have CUDA installed on your machine. It also sets GPU compute capability to 86 (recent Amperes), so if it is different, please modify accordingly.

export CUTENSOR_INSTALL_PATH=~/build/cutensor
export CUQUANTUM_INSTALL_PATH=~/build/cuquantum
export EXATN_INSTALL_PATH=~/build/exatn

CUTENSOR_LIB_DIR=libcutensor-linux-ppc64le-1.6.0.3-archive
CUTENSOR_LIB_TAR=$CUTENSOR_LIB_DIR.tar.xz
wget https://developer.download.nvidia.com/compute/cutensor/redist/libcutensor/linux-ppc64le/$CUTENSOR_LIB_TAR
tar -xf $CUTENSOR_LIB_TAR
mv $CUTENSOR_LIB_DIR $CUTENSOR_INSTALL_PATH
cp $CUTENSOR_INSTALL_PATH/lib/11/libcutensor.so.1.6.0 $CUTENSOR_INSTALL_PATH/lib/
ln -s $CUTENSOR_INSTALL_PATH/lib/libcutensor.so.1.6.0 $CUTENSOR_INSTALL_PATH/lib/libcutensor.so.1
ln -s $CUTENSOR_INSTALL_PATH/lib/libcutensor.so.1 $CUTENSOR_INSTALL_PATH/lib/libcutensor.so

CUQUANTUM_LIB_DIR=cuquantum-linux-ppc64le-22.07.1.14-archive
CUQUANTUM_LIB_TAR=$CUQUANTUM_LIB_DIR.tar.xz
wget https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-ppc64le/$CUQUANTUM_LIB_TAR
tar -xf $CUQUANTUM_LIB_TAR
mv $CUQUANTUM_LIB_DIR $CUQUANTUM_INSTALL_PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUQUANTUM_INSTALL_PATH/lib:$CUTENSOR_INSTALL_PATH/lib

git clone --recursive https://github.com/ORNL-QCI/exatn.git
cd exatn
git submodule init
git submodule update --init --recursive
mkdir build_release
cd build_release
CC=gcc CXX=g++ FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${EXATN_INSTALL_PATH} -DCMAKE_BUILD_TYPE=Release -DEXATN_BUILD_TESTS=TRUE -DBLAS_LIB=ATLAS -DBLAS_PATH=/usr/lib/x86_64-linux-gnu/blas -DENABLE_CUDA=True -DCUDA_ARCH_BIN=86 -DCUDA_HOST_COMPILER=g++ -DCUTENSOR=TRUE -DCUTENSOR_PATH=${CUTENSOR_INSTALL_PATH} -DCUQUANTUM=TRUE -DCUQUANTUM_PATH=${CUQUANTUM_INSTALL_PATH}
make -j 8 install
make rebuild_cache
make install
cd ../..

@paaige
Copy link

paaige commented Sep 12, 2022

I'm trying to build without cuQuantum for now and am also using OpenBLAS. This is my build command and the output error I'm getting now:
CC=gcc CXX=g++ FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${EXATN_INSTALL_PATH} -DEXATN_BUILD_TESTS=TRUE -DBLAS_LIB=OPENBLAS -DBLAS_PATH=/opt/OpenBLAS/lib -DCUDA_ARCH_BIN=86 -DCUDA_HOST_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DEXATN_BUILD_TESTS=TRUE -DENABLE_CUDA=True -DWITH_LAPACK=YES

In file included from /home/ubuntu/exatn/tpls/boost-cmake/boost/boost_1_64_0/libs/regex/src/c_regex_traits.cpp:22:
/home/ubuntu/exatn/tpls/boost-cmake/boost/boost_1_64_0/boost/config.hpp:35:12: fatal error: boost/config/select_compiler_config.hpp: No such file or directory
35 | # include <boost/config/select_compiler_config.hpp>

I have boost installed locally + also tried uninstalling and reinstalling

@DmitryLyakh
Copy link
Member

ExaTN only depends on BLAS and CUDA, the rest should go through its submodules and there should be no need to install/modify anything else. Would you mind creating an empty directory and running the below script from there, and then pasting the output here? It works on my Ubuntu 20.04 (we want to make sure all submodules get pulled and updated before the build).

export EXATN_INSTALL_PATH=~/build/exatn
git clone --recursive https://github.com/ORNL-QCI/exatn.git
cd exatn
git submodule init
git submodule update --init --recursive
mkdir build_release
cd build_release
CC=gcc CXX=g++ FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${EXATN_INSTALL_PATH} -DCMAKE_BUILD_TYPE=Release -DEXATN_BUILD_TESTS=TRUE -DBLAS_LIB=OPENBLAS -DBLAS_PATH=/opt/OpenBLAS/lib -DENABLE_CUDA=True -DCUDA_ARCH_BIN=86 -DCUDA_HOST_COMPILER=g++
make -j 8 install
make rebuild_cache
make install

@DmitryLyakh
Copy link
Member

One more thing, please check your CMAKE version. It should be at least 3.16 or higher. I believe the latest one is 3.24.

@paaige
Copy link

paaige commented Sep 13, 2022

Output from make install:
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:16:50: error: expected class-name before ‘{’ token
16 | class TaProlSyntaxHandler : public SyntaxHandler {
| ^
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: In constructor ‘{anonymous}::TaProlSyntaxHandler::TaProlSyntaxHandler()’:
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:18:27: error: class ‘{anonymous}::TaProlSyntaxHandler’ does not have any field named ‘SyntaxHandler’
18 | TaProlSyntaxHandler() : SyntaxHandler("taprol") {}
| ^~~~~~~~~~~~~
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: In member function ‘void {anonymous}::TaProlSyntaxHandler::GetReplacement(clang::Preprocessor&, clang::Declarator&, clang::CachedTokens&, llvm::raw_string_ostream&)’:
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:44:11: error: ‘getDeclText’ was not declared in this scope
44 | OS << getDeclText(PP, D) << "{\n";
| ^~~~~~~~~~~
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp: At global scope:
/home/ubuntu/exatn/src/parser/syntax_handler/taprol_syntax_handler.cpp:62:8: error: ‘SyntaxHandlerRegistry’ does not name a type
62 | static SyntaxHandlerRegistry::Add
| ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/build.make:76: src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/taprol_syntax_handler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2334: src/parser/syntax_handler/CMakeFiles/taprol-syntax-handler.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I have cmake version 3.24

@DmitryLyakh
Copy link
Member

Hmm..., I do not see any output from git cloning, git submodule updating, cmake configuring, and most of making :) Would it be possible to paste the whole thing? I mean including the following in a bash script and running as a whole:

export EXATN_INSTALL_PATH=~/build/exatn
git clone --recursive https://github.com/ORNL-QCI/exatn.git
cd exatn
git submodule init
git submodule update --init --recursive
mkdir build_release
cd build_release
CC=gcc CXX=g++ FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${EXATN_INSTALL_PATH} -DCMAKE_BUILD_TYPE=Release -DEXATN_BUILD_TESTS=TRUE -DBLAS_LIB=OPENBLAS -DBLAS_PATH=/opt/OpenBLAS/lib -DENABLE_CUDA=True -DCUDA_ARCH_BIN=86 -DCUDA_HOST_COMPILER=g++
make -j 8 install
make rebuild_cache
make install

@1tnguyen
Copy link
Member

I'm running into this issue as well when attempting to install exaTN (per the instructions, using openBLAS and cuda enabled). Tagging @DmitryLyakh for visibility. Could this have to do with a clang update not supporting the SyntaxHandler plugin?

Yes, I think so. The syntax handler in ExaTN requires a custom build of Clang.
You'll probably need to comment out this line: https://github.com/ORNL-QCI/exatn/blob/devel/src/parser/CMakeLists.txt#L36 if having a stock Clang installed on the system.

@DmitryLyakh
Copy link
Member

Ha, thanks, that makes sense. I do not have Clang installed on my Ubuntu, so everything works fine :) Then, indeed, unless you are interested specifically in the ExaTN TAProL syntax handler (probably not), you can just comment out this CMAKE line:

add_subdirectory(syntax_handler)

@DmitryLyakh DmitryLyakh added the bug Something isn't working label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants