bitpit icon indicating copy to clipboard operation
bitpit copied to clipboard

Build error

Open gwenchee opened this issue 5 years ago • 5 comments

Hello,

I am using Ubuntu 18.04.

I am trying to install bitpit from source. I have cloned the repository and checked out the 1.6.0 branch. I followed #22 to successfully generate the build files.

I am quite sure that I have all the dependencies installed. But, am still getting a build error:

(base) gwen@ubuntu:~/github/bitpit-build$ make
[  1%] Building CXX object src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o
In file included from /home/gwen/github/bitpit/src/POD/pod.cpp:37:0:
/home/gwen/github/bitpit/external/LAPACKE/include/bitpit_private_lapacke.hpp:49:18: fatal error: lapacke.h: No such file or directory
 #        include <lapacke.h>
                  ^~~~~~~~~~~
compilation terminated.
make[2]: *** [src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build.make:76: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1005: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

I installed the lapack dependencies using these commands:

sudo apt update 
sudo apt install liblapack3 
sudo apt install liblapack-dev 
sudo apt install libopenblas-base 
sudo apt install libopenblas-dev 
sudo apt install liblapacke-dev 
sudo apt install liblapack-dev

If anyone has any idea of what it is I'm missing, please let me know!

gwenchee avatar Dec 04 '19 23:12 gwenchee

Hello Gwendolyn. We are glad to know about your interest in bitpit and we can try to understand your problem but we need some more information. Could you set the cmake VERBOSE_MAKE variable to ON and post here the output of the make command again? Find lapacke.h with locate command in bash, please. Update the locate database with sudo to be sure your search is updated. Finally, post the value of the bash variable CPATH using echo in bash and the value of the cmake variable LAPACKE_lapacke.h_DIRS after configuration, please.

Thanks, Marco

Ottieni Outlook per Androidhttps://aka.ms/ghei36


Da: Gwendolyn Chee [email protected] Inviato: giovedì 5 dicembre 2019, 00:36 A: optimad/bitpit Cc: Subscribed Oggetto: [optimad/bitpit] Build error (#25)

Hello,

I am using Ubuntu 18.04.

I am trying to install bitpit from source. I have cloned the repository and checked out the 1.6.0 branch. I followed #22https://github.com/optimad/bitpit/issues/22 to successfully generate the build files.

I am quite sure that I have all the dependencies installed. But, am still getting a build error:

(base) gwen@ubuntu:~/github/bitpit-build$ make [ 1%] Building CXX object src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o In file included from /home/gwen/github/bitpit/src/POD/pod.cpp:37:0: /home/gwen/github/bitpit/external/LAPACKE/include/bitpit_private_lapacke.hpp:49:18: fatal error: lapacke.h: No such file or directory

include <lapacke.h>

              ^~~~~~~~~~~

compilation terminated. make[2]: *** [src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build.make:76: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1005: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/all] Error 2 make: *** [Makefile:141: all] Error 2

I installed the lapack dependencies using these commands:

sudo apt update sudo apt install liblapack3 sudo apt install liblapack-dev sudo apt install libopenblas-base sudo apt install libopenblas-dev sudo apt install liblapacke-dev sudo apt install liblapack-dev

If anyone has any idea of what it is I'm missing, please let me know!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/optimad/bitpit/issues/25?email_source=notifications&email_token=ABSMIGCNE3BT5EO42F5ELJDQXA5JBA5CNFSM4JVRH6E2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H6FBWFA, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSMIGDHA6H3C6SYLOF6RATQXA5JBANCNFSM4JVRH6EQ.

marcocisternino avatar Dec 05 '19 09:12 marcocisternino

@marcocisternino

  1. Could you set the cmake VERBOSE_MAKE variable to ON and post here the output of the make command again?
(base) gwen@ubuntu:~/github/bitpit-build$ make
/home/gwen/anaconda3/bin/cmake -S/home/gwen/github/bitpit -B/home/gwen/github/bitpit-build --check-build-system CMakeFiles/Makefile.cmake 0
/home/gwen/anaconda3/bin/cmake -E cmake_progress_start /home/gwen/github/bitpit-build/CMakeFiles /home/gwen/github/bitpit-build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/gwen/github/bitpit-build'
make -f src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build.make src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/depend
make[2]: Entering directory '/home/gwen/github/bitpit-build'
cd /home/gwen/github/bitpit-build && /home/gwen/anaconda3/bin/cmake -E cmake_depends "Unix Makefiles" /home/gwen/github/bitpit /home/gwen/github/bitpit/src/POD /home/gwen/github/bitpit-build /home/gwen/github/bitpit-build/src/POD /home/gwen/github/bitpit-build/src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/gwen/github/bitpit-build'
make -f src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build.make src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build
make[2]: Entering directory '/home/gwen/github/bitpit-build'
[  0%] Building CXX object src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/mesh_mapper.cpp.o
cd /home/gwen/github/bitpit-build/src/POD && /home/gwen/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++  -DBITPIT_ENABLE_DEBUG=1 -DBITPIT_ENABLE_MPI=0 -DHAVE___BUILTIN_UNREACHABLE -I/home/gwen/github/bitpit/external/LAPACKE/include -I/home/gwen/anaconda3/include/libxml2 -I/home/gwen/github/petsc/include -I/home/gwen/github/petsc/arch-linux-c-debug/include -I/home/gwen/github/bitpit/src/common -I/home/gwen/github/bitpit/src/operators -I/home/gwen/github/bitpit/src/containers -I/home/gwen/github/bitpit/src/IO -I/home/gwen/github/bitpit/src/PABLO -I/home/gwen/github/bitpit/src/SA -I/home/gwen/github/bitpit/src/CG -I/home/gwen/github/bitpit/src/patchkernel -I/home/gwen/github/bitpit/src/voloctree -I/home/gwen/github/bitpit/src/POD  -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fmessage-length=0 -Wall -Wextra -O0 -g   -std=c++11 -o CMakeFiles/POD_TARGET_OBJECT.dir/mesh_mapper.cpp.o -c /home/gwen/github/bitpit/src/POD/mesh_mapper.cpp
[  1%] Building CXX object src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o
cd /home/gwen/github/bitpit-build/src/POD && /home/gwen/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++  -DBITPIT_ENABLE_DEBUG=1 -DBITPIT_ENABLE_MPI=0 -DHAVE___BUILTIN_UNREACHABLE -I/home/gwen/github/bitpit/external/LAPACKE/include -I/home/gwen/anaconda3/include/libxml2 -I/home/gwen/github/petsc/include -I/home/gwen/github/petsc/arch-linux-c-debug/include -I/home/gwen/github/bitpit/src/common -I/home/gwen/github/bitpit/src/operators -I/home/gwen/github/bitpit/src/containers -I/home/gwen/github/bitpit/src/IO -I/home/gwen/github/bitpit/src/PABLO -I/home/gwen/github/bitpit/src/SA -I/home/gwen/github/bitpit/src/CG -I/home/gwen/github/bitpit/src/patchkernel -I/home/gwen/github/bitpit/src/voloctree -I/home/gwen/github/bitpit/src/POD  -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fmessage-length=0 -Wall -Wextra -O0 -g   -std=c++11 -o CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o -c /home/gwen/github/bitpit/src/POD/pod.cpp
In file included from /home/gwen/github/bitpit/src/POD/pod.cpp:37:0:
/home/gwen/github/bitpit/external/LAPACKE/include/bitpit_private_lapacke.hpp:49:18: fatal error: lapacke.h: No such file or directory
 #        include <lapacke.h>
                  ^~~~~~~~~~~
compilation terminated.
make[2]: *** [src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/build.make:79: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/pod.cpp.o] Error 1
make[2]: Leaving directory '/home/gwen/github/bitpit-build'
make[1]: *** [CMakeFiles/Makefile2:1008: src/POD/CMakeFiles/POD_TARGET_OBJECT.dir/all] Error 2
make[1]: Leaving directory '/home/gwen/github/bitpit-build'
make: *** [Makefile:144: all] Error 2
  1. Find lapacke.h with locate command in bash, please. Update the locate database with sudo to be sure your search is updated.
(base) gwen@ubuntu:~/github/bitpit-build$ sudo locate lapacke.h
/home/gwen/.local/share/Trash/files/bitpit-bitpit-1.6.0/external/LAPACKE/include/bitpit_private_lapacke.hpp
/home/gwen/.local/share/Trash/files/mimmo-mimmo-1.3.0/external/LAPACKE/include/mimmo_private_lapacke.hpp
/home/gwen/anaconda3/include/lapacke.h
/home/gwen/anaconda3/pkgs/openblas-0.3.3-h9ac9557_1001/include/lapacke.h
/home/gwen/github/bitpit/external/LAPACKE/include/bitpit_private_lapacke.hpp
/home/gwen/github/mimmo/external/LAPACKE/include/mimmo_private_lapacke.hpp
/home/gwen/src/bitpit-1.6.0/external/LAPACKE/include/bitpit_private_lapacke.hpp
/home/gwen/src/mimmo-1.3.0/external/LAPACKE/include/mimmo_private_lapacke.hpp
/usr/include/lapacke.h
  1. Finally, post the value of the bash variable CPATH using echo in bash and the value of the cmake variable LAPACKE_lapacke.h_DIRS after configuration, please.
(base) gwen@ubuntu:~/github/bitpit-build$ echo CPATH
CPATH

I don't think I can find the value of the cmake variable LAPACKE_lapacke.h_DIRS after configuration

(base) gwen@ubuntu:~/github/bitpit-build$ locate LAPACKE_lapacke.h_DIRS
(base) gwen@ubuntu:~/github/bitpit-build$

gwenchee avatar Dec 05 '19 17:12 gwenchee

Thank you Gwendolyn. Point by point: 2. This is the lapacke.h include file you installed with apt-get: /usr/include/lapacke.h. And it is what we want to use with bitpit. Let's try to help the compiler setting CPATH, see point 3.

  1. In order to find include files, the compiler must be informed about folders where it can search for includes and, as you can see from the output of make, there is no folder passed to the compiler by the compiler flag -I that contains lapacke.h. However, in your case the compiler should find lapacke.h without any specific indication, because it is in a OS folder.

  2. LAPACKE_lapacke.h_DIRS is a cmake variable not a file you can find with locate. Enter your bitpit build folder and launch "ccmake .." if your bitpit root folder is "../". Then press 't' to toggle all cmake variables and you will see LAPACKE_lapacke.h_DIRS. You had to launch "echo $CPATH", you just asked echo to print the word "CPATH"! CPATH is the bash variable used by the compiler to understand where it can find the include files. In your case, the compiler should not need our help, because lapacke.h is in a system folder, i.e. /usr/include, but let's try anyway. Set CPATH in your .bashrc with "export CPATH=/usr/include/:$CPATH" and then "source ~/.bashrc" to update the terminal session.

Now, you can delete your bitpit build folder, create a new one and try again with the helping CPATH in bash. I hope cmake can find lapacke now.

Let me know. please, and if it does not work, re-post what you posted last time to see what changed.

Bests,

Marco

marcocisternino avatar Dec 05 '19 18:12 marcocisternino

@marcocisternino

I Set CPATH in your .bashrc with "export CPATH=/usr/include/:$CPATH" and then "source ~/.bashrc" to update the terminal session

Then deleted bitpit-build directory, created a new one, and:

(base) gwen@ubuntu:~/github$ rm -rf bitpit-build
(base) gwen@ubuntu:~/github$ mkdir bitpit-build
(base) gwen@ubuntu:~/github$ cd bitpit-build/
(base) gwen@ubuntu:~/github/bitpit-build$ ccmake ../bitpit

Then I tried to configure the file and this error is thrown (thus, bitpit did not even build):


 CMake Error at /home/gwen/anaconda3/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
   Could NOT find Threads (missing: Threads_FOUND)
 Call Stack (most recent call first):
   /home/gwen/anaconda3/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
   /home/gwen/anaconda3/share/cmake-3.15/Modules/FindThreads.cmake:220 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
   /home/gwen/anaconda3/share/cmake-3.15/Modules/FindBLAS.cmake:268 (find_package)
   /home/gwen/anaconda3/share/cmake-3.15/Modules/FindLAPACK.cmake:193 (find_package)
   CMakeLists.txt:497 (find_package)

When I pressed 't' to toggle all cmake variables and you will see LAPACKE_lapacke.h_DIRS. I did not see that, I instead only saw this:

...
 CMAKE_SKIP_RPATH                 OFF
 CMAKE_STATIC_LINKER_FLAGS
 CMAKE_STATIC_LINKER_FLAGS_DEBU
 CMAKE_STATIC_LINKER_FLAGS_MINS
 CMAKE_STATIC_LINKER_FLAGS_RELE
 CMAKE_STATIC_LINKER_FLAGS_RELW
 CMAKE_STRIP                      /usr/bin/strip
 CMAKE_VERBOSE_MAKEFILE           OFF
 ENABLE_MPI                       OFF
 LAPACKE_STATIC                   OFF
 LTO_STRATEGY                     Auto
 VERBOSE_MAKE                     OFF

gwenchee avatar Dec 05 '19 18:12 gwenchee

It is the first time you get this error? Did you configure bitpit before? How did you install cmake?

marcocisternino avatar Dec 05 '19 18:12 marcocisternino