ElmerCSC / elmerfem

Official git repository of Elmer FEM software
http://www.elmerfem.org
Other
1.14k stars 311 forks source link

No libqt4-dev in Ubuntu20.04, hope for Qt5 version #225

Closed ouening closed 4 years ago

ouening commented 4 years ago

No libqt4-dev in Ubuntu20.04, hope for support Qt5 version

raback commented 4 years ago

ElmerGUI does compile with Qt5. Have you tried cmake using "WITH_QT5".

ivantaran commented 4 years ago

in file: ./ElmerGUI/cmake/Modules/FindQwt.cmake instead FIND_LIBRARY(QWT_LIBRARY qwt write FIND_LIBRARY(QWT_LIBRARY qwt-qt5 and try: cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ELMERGUI:BOOLEAN=TRUE -DWITH_QT5=TRUE

ouening commented 4 years ago

I tried it in Ubuntu18.04 but failed. I'll try in Ubuntu20.04 another time. By the way, the officail readme file is too old to instruct us to compile by ourself.

ivantaran commented 4 years ago

When I built it under Ubuntu 20.04, I additionally installed the following packages: sudo apt install qt5-default qtscript5-dev libqwt-qt5-dev

ouening commented 4 years ago

Finally I sucessfully compiled it in Ubuntu20.04. This time I compiled it in a new installed Ubuntu20.04. Some dependent packages need to be installed firstly (refer to dockerfile )

$ sudo apt install cmake cmake-qt5 gcc g++ gfortran qt5-default qtscript5-dev libqwt-qt5-dev libmpich-dev libblas-dev liblapack-dev libqt5svg5-dev libnetcdff-dev libmetis-dev libparmetis-dev libmumps-dev netcdf-bin

(stiil can't find hdf5, I don't know why

-- Elmer/Ice package: Looking for [HDF5] & [HDF5 Fortran] libraries
-- Library not found: >HDF5_FOUND< 
CMake Warning at elmerice/Solvers/CMakeLists.txt:49 (MESSAGE):

   Missing: >HDF5_INCLUDE_DIR< , >HDF5_LIBRARY<,  >HDF5F_LIBRARY< 
   some functionalities will be disabled

) Install mmg:

$ git clone https://github.com/MmgTools/mmg
$ cd mmg && mkdir build
$ cmake-gui .. # check shared libs on
$ make -j5
$ sudo make install

and finally as @ivantaran said, modifiy file ./ElmerGUI/cmake/Modules/FindQwt.cmake, then excute command:

$ cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ELMERGUI:BOOLEAN=TRUE -DWITH_QT5=TRUE -DWITH_ElmerIce:BOOL=TRUE -DWITH_Mumps:BOOL=TRUE 
$ make -j3
$ sudo make install 

But one strange thing is that if I config it using cmake-gui, an error happened:

checking for thread-local storage - found
  Building ElmerGUI
------------------------------------------------
------------------------------------------------
CMake Error at /usr/share/cmake-3.16/Modules/FindQt4.cmake:1314 (message):
  Found unsuitable Qt version "5.12.8" from /usr/bin/qmake, this code
  requires Qt 4.x
Call Stack (most recent call first):
  ElmerGUI/CMakeLists.txt:37 (FIND_PACKAGE)

I don't know how to fix it. If someone have fixed it , please let me know, thank you!

ivantaran commented 4 years ago

@raback here results of static analysis of elmerfem sources may interest you

willchao612 commented 3 years ago

When I built it under Ubuntu 20.04, I additionally installed the following packages: sudo apt install qt5-default qtscript5-dev libqwt-qt5-dev

This works, thanks.

rmccomiskie commented 3 years ago

Yes. It does work! In thread: https://github.com/ElmerCSC/elmerfem/issues/225 eddiechaoinchina commented on Oct 17, 2020 suggesting the following to install QT5: "sudo apt install qt5-default qtscript5-dev libqwt-qt5-dev"

I ran into this while trying to install openEMS in Ubuntu 20.04 LTS. So I replaced "libqt4-dev" with "qt5-default qtscript5-dev libqwt-qt5-dev".

Instead of this out-of-date command: "sudo apt-get install build-essential git cmake libhdf5-dev libvtk5-dev libboost-all-dev libcgal-dev libtinyxml-dev libqt4-dev libvtk5-qt4-dev" which is found in the Linux install instructions for openEMS (https://openems.de/index.php/Compile_from_Source.html).

I used the following command to install openEMS in Ubuntu 20.04 LTS: "sudo apt-get install build-essential git cmake libhdf5-dev libvtk6-dev libboost-all-dev libcgal-dev libtinyxml-dev qt5-default qtscript5-dev libqwt-qt5-dev libvtk6-qt-dev" It compiled without errors 2021.01.31.

Perhaps this will help someone else.

dloeffen commented 3 years ago

For me the following worked:

in file: ./ElmerGUI/cmake/Modules/FindQwt.cmake on the line with:

FIND_LIBRARY(QWT_LIBRARY NAMES qwt qwt6-qt5

add qwt-qt5

and after the line with:

HINTS /usr/local/Cellar/qwt-qt4/6.1.3_1/lib

add a new line with:

HINTS /usr/lib/qwt-qt5

dvlierop commented 2 years ago

I always modify FindQwt.cmake manually by adding merely "qwt-qt5" to the "FIND LIBRARY" on line 33. That's the only thing needed for me to make CMake run succesfully on Ubuntu 20.04.2 LTS (besides actually installing the packages of course).

So that line now looks like this on my system: FIND_LIBRARY(QWT_LIBRARY NAMES qwt qwt6-qt5 qwt-qt5

Could someone changes this in the git repository too, assuming it doesn't break stuff for anyone else?

t7saeki commented 2 years ago

I have issued a pull request for this change including additional HINTS for some other platforms as I also always needed similar type of modification to find Qwt.