xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
262 stars 54 forks source link

Error installing XC in cmake build step Ubuntu 20.04 #100

Closed mihdicaballero closed 2 years ago

mihdicaballero commented 2 years ago

Hi! I'm trying to install xc in my windows following the steps described here and got a problem in cmake build. I must say that I'm very ignorant with Ubuntu and I have always worked with Windows, so all this is kinda new.

This is the error

CMake version is greater than 2.8.4
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

-- The C compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

-- The CXX compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

CMake Error at CMakeLists.txt:21 (INCLUDE):
  INCLUDE could not find load file:

    /home/mihdi/.xc_build/lcmd_dirs.cmake

-- lcmd project dir: /..
-- lcmd include dir:
-- lcmd lib dir:
-- xc project dir: /mnt/d/XC/build_xc/xc/
-- xc include dir: /mnt/d/XC/build_xc/xc/src/
-- xc lib dir: /mnt/d/XC/build_xc/xc/lib
CMake Error at /mnt/d/XC/build_xc/xc/CMake/GetGitRevisionDescription.cmake:72 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  /mnt/d/XC/build_xc/xc/CMake/GetGitRevisionDescription.cmake:87 (get_git_head_revision)
  CMakeLists.txt:50 (git_describe)

CMake Error at CMakeLists.txt:59 (configure_file):
  configure_file Problem configuring file

-- The Fortran compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineFortranCompiler.cmake:286 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:63 (enable_language)

-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestFortranCompiler.cmake:89 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:63 (enable_language)

-- ************* find packages begins ****************
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find X11 (missing: X11_X11_LIB)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
  /mnt/d/XC/build_xc/xc/CMake/find_packages.cmake:2 (find_package)
  CMakeLists.txt:64 (INCLUDE)

-- Configuring incomplete, errors occurred!
See also "/mnt/d/XC/build_xc/build-xc/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/XC/build_xc/build-xc/CMakeFiles/CMakeError.log".

I have no idea what is going on. Maybe it has nothing to do with xc. The directory where I have this installed is: D:\XC\build_xc

Desktop:

Thank you very much for your assistance, I'm really looking forward to start using XC :)

lcpt commented 2 years ago

Hi @mihdicaballero Thank you for your interest!

I think the error (at least the first one) is due to some lines I forgot to delete when I move the code from a now deprecated repository called xc_utils. This error corresponds to the lines:


  INCLUDE could not find load file:

    /home/mihdi/.xc_build/lcmd_dirs.cmake```
on your log. I'll push a fixed version of CMakeLists.txt
lcpt commented 2 years ago

There is another message that makes me think that X11 is not installed.

Have you installed all the dependencies for Ubuntu 20.04?

mihdicaballero commented 2 years ago

Thanks, @lcpt, for the quick answer! I had installed X11 with Xming, but maybe I didn't open it. I did install all the dependecies withouth problem, and upgraded all of them to their last version.

Now I could run the command without problems (verified to have xming open) but when I tried to run the next one:

make -j 8

I had many errors in 23% of progress. I double checked that I had 8 cores.

This is the log In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:34, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:70, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:34, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/IllConditioningAnalysis.h:46:3: error: expected class-name before {’ token 46 | { | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/IllConditioningAnalysis.h:51:5: error: ‘Analysis’ does not name a type 51 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/IllConditioningAnalysis.h:58:8: error: ‘Analysis’ does not name a type 58 | inline Analysis *IllConditioningAnalysis::getCopy(void) const | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:36, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:70, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:34, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/ModalAnalysis.h:44:3: error: expected class-name before ‘{’ token 44 | { | ^ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:70, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:34, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/VariableTimeStepDirectIntegrationAnalysis.h:80:3: error: expected class-name before ‘{’ token 80 | { | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/VariableTimeStepDirectIntegrationAnalysis.h:86:5: error: ‘Analysis’ does not name a type 86 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/VariableTimeStepDirectIntegrationAnalysis.h:93:8: error: ‘Analysis’ does not name a type 93 | inline Analysis *VariableTimeStepDirectIntegrationAnalysis::getCopy(void) const | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:34, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:80:3: error: expected class-name before ‘{’ token 80 | { | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:86:5: error: ‘Analysis’ does not name a type 86 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:92:30: error: ‘EigenAlgorithm’ has not been declared 92 | virtual int setAlgorithm(EigenAlgorithm &theAlgo); | ^~~~~~~~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/EigenAnalysis.h:93:31: error: ‘EigenIntegrator’ has not been declared 93 | virtual int setIntegrator(EigenIntegrator &theIntegrator); | ^~~~~~~~~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:40, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:51:5: error: ‘Analysis’ does not name a type 51 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:57:31: error: ‘LinearBucklingIntegrator’ has not been declared 57 | virtual int setIntegrator(LinearBucklingIntegrator &theIntegrator); | ^~~~~~~~~~~~~~~~~~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingEigenAnalysis.h:62:8: error: ‘Analysis’ does not name a type 62 | inline Analysis *LinearBucklingEigenAnalysis::getCopy(void) const | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:33, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:62, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:56:3: error: expected class-name before ‘ ’ token 56 | { | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:65:5: error: ‘Analysis’ does not name a type 65 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/LinearBucklingAnalysis.h:85:8: error: ‘Analysis’ does not name a type 85 | inline Analysis *LinearBucklingAnalysis::getCopy(void) const | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:67, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/TransientAnalysis.h:74:3: error: expected class-name before ‘{’ token 74 | { | ^ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:32, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:68, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:97:5: error: ‘Analysis’ does not name a type 97 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DirectIntegrationAnalysis.h:122:8: error: ‘Analysis’ does not name a type 122 | inline Analysis *DirectIntegrationAnalysis::getCopy(void) const | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:31, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:65, from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:91:51: error: expected class-name before ‘,’ token 91 | class DomainDecompositionAnalysis: public Analysis, public MovableObject | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/DomainDecompositionAnalysis.h:120:5: error: ‘Analysis’ does not name a type 120 | Analysis *getCopy(void) const; | ^~~~~~~~ In file included from /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/Analysis.h:30, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/all_includes.h:364, from /mnt/d/XC/build_xc/xc/src/utility/actor/objectBroker/FEM_ObjectBroker.cpp:64: /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:80:3: error: expected class-name before ‘{’ token 80 | { | ^ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:100:5: error: ‘Analysis’ does not name a type 100 | Analysis *getCopy(void) const; | ^~~~~~~~ /mnt/d/XC/build_xc/xc/src/solution/analysis/analysis/StaticAnalysis.h:127:8: error: ‘Analysis’ does not name a type 127 | inline Analysis *StaticAnalysis::getCopy(void) const | ^~~~~~~~ [ 23%] Building CXX object CMakeFiles/XcBib.dir/utility/database/NEESData.cpp.o [ 24%] Building CXX object CMakeFiles/XcBib.dir/utility/handler/DataOutputDatabaseHandler.cpp.o make[2]: *** [CMakeFiles/XcBib.dir/build.make:479: CMakeFiles/XcBib.dir/utility/actor/objectBroker/FEM_ObjectBroker.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/Makefile2:202: CMakeFiles/XcBib.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

And this is a screenshot from the first error if it helps. image

It seems that mainly the problem is with the word Analysis, EigenIntegrator, EigenAlgorithm. If it helps, when I was cloning from the repository I got a warning that there was a duplicate with commands analysis and Analysis, like it was case sensitive. I don't really know if what I'm saying makes much sense.

Thanks in advance :)

lcpt commented 2 years ago

Ah! You've cloned the repository in the MS-Windows disk. Well, maybe this is related with your problem. As far as I know, Unix file systems are case-sensitive since the beginning. Apparently, for Windows, that's not the default behavior.

The simplest solution is to clone the repository in the Linux file system. I can assist you with that if necessary. Otherwise, it will take some time to detect the conflicting files and to find a solution...

mihdicaballero commented 2 years ago

Hi! I found this link that confirms what you said about MS-Windows not being case-sensitive. The solution might be to have no more case-sensitive conflicts, according to Microsoft. And in this post from stack overflow they say that the only solution might be changing the name of those conflicts.

I installed Ubuntu inside Windows as it was described in the install procedure in a folder in one of my drives without much thought. You say that I should have installed it somewhere else? Like in a specific path.

Any more assistance would be much appreciated :)

Maybe I have to install Ubuntu in a virtual machine for the time being until is Windows compatible, whatever you think is better @lcpt.

lcpt commented 2 years ago

But, you already have an Ubuntu virtual machine. You can clone Ubuntu inside that virtual machine using git:

git clone https://github.com/xcfem/xc.git

This will clone the repository inside Ubuntu.

@ebrahimraeyat you have already installed XC inside a Windows Ubuntu Subsystem, could you confirm that I'm not wrong?

mihdicaballero commented 2 years ago

Just to be sure, this is what I did:

  1. Installed Xming
  2. Installed Ubuntu 20 from Microsoft store
  3. Went to "Windows features" and checked on "Windows Subsystem for Linux"
  4. Launched Ubuntu and accessed the terminal.
  5. Upgraded all current packages.
  6. Installed all dependencies.
  7. Created a directory in one of my drives D:\XC.
  8. Cloned XC with git clone. (here is when I had the warning of case-sensitive issues)
  9. Run cmake ../xc/src.
  10. Run make -j 8 and got stucked.

Maybe I did something wrong.

lcpt commented 2 years ago

Why the step 7?

mihdicaballero commented 2 years ago

Aaaaah, maybe that was it. I thought I had to allocate it somewhere because I didn't know where foo@bar was. Let me try again without that step.

mihdicaballero commented 2 years ago

Well, that was the problem indeed. I installed it now in the current user directory and not in other drive. Now I have encountered an error in 98% of make -j 8.

This is the error

[ 98%] Building CXX object CMakeFiles/XcBib.dir/preprocessor/set_mgmt/MapSet.cc.o
/home/mihdi/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc: In member function ‘void XC::SetEntities::gen_mesh_gmsh(const string&)’:
/home/mihdi/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc:705:24: error: ‘setTransfiniteAutomatic’ is not a member of ‘gmsh::model::mesh’; did you mean ‘setTransfiniteSurface’?
  705 |     gmsh::model::mesh::setTransfiniteAutomatic();
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
      |                        setTransfiniteSurface
/home/mihdi/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc:716:15: warning: unused variable ‘numElements’ [-Wunused-variable]
  716 |     const int numElements= create_elements_from_gmsh(mapNodes);
      |               ^~~~~~~~~~~
[ 98%] Building CXX object CMakeFiles/XcBib.dir/preprocessor/PreprocessorContainer.cc.o
[ 98%] Building CXX object CMakeFiles/XcBib.dir/preprocessor/prep_handlers/PrepHandler.cc.o
make[2]: *** [CMakeFiles/XcBib.dir/build.make:16339: CMakeFiles/XcBib.dir/preprocessor/set_mgmt/SetEntities.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:202: CMakeFiles/XcBib.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Thanks again.

lcpt commented 2 years ago

Hi again.

Well this is a known problem. The GMSH version that comes with the Ubuntu package is too old :( I've modified CMakeLists.txt to make cmake crash when GMSH version is lower than 4.8.

The problem is easy to solve but requires some explanation. I'll update the gmsh_install.md and remove the gmsh package from the packages_install_ubuntu_focal_fossa.sh file to make the process easier.

Sorry for the inconvenience.

mihdicaballero commented 2 years ago

Thanks for your assistance @lcpt! I run the script gmsh_install.md and it fixed the CMake issue, and it completed. Then when I tried to install the python modules it didn't work, and I had to change in line 28 from python to python 3 in order to work. Now it says: sudo python3 setup.py install --prefix=/usr/local --record installed_files.txt Nonetheless, I kept going and got this:

sudo sh local_install.sh
path to libs: /usr/local/lib/python3.8/dist-packages
running install
running build
running build_py
running install_lib
running install_data
error: can't copy 'extensions/xc.so': doesn't exist or not a regular file
Updating installed files history.
cat: installed_files.txt: No such file or directory
rm: cannot remove 'installed_files.txt': No such file or directory

Then I tried to run the verification tests and had the same python problem and edited run_verif.sh and replaced python to python3. Then I started doing the tests and did not pass from Action tests till the end, being the error: ModuleNotFoundError: No module named 'xc'

I am getting close, but surely there is something that I did wrong here :(

lcpt commented 2 years ago

I think you've Python 2 as the default Python in your system.

To set Python 3 as the default, you can simply install the python-is-python3 package as follows:

sudo dpkg -i python-is-python3

And the problem will be solved.

lcpt commented 2 years ago

I'll add a remark about this to the installation instructions.

ebrahimraeyat commented 2 years ago

I think you've Python 2 as the default Python in your system.

To set Python 3 as the default, you can simply install the python-is-python3 package as follows:

sudo dpkg -i python-is-python3

And the problem will be solved.

As an alternative method, you can execute this command:

sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3 40
ebrahimraeyat commented 2 years ago

But, you already have an Ubuntu virtual machine. You can clone Ubuntu inside that virtual machine using git:

git clone https://github.com/xcfem/xc.git

This will clone the repository inside Ubuntu.

@ebrahimraeyat you have already installed XC inside a Windows Ubuntu Subsystem, could you confirm that I'm not wrong?

excuse me for delay response. Yes, The ubuntu installed with wsl behave like real Ubuntu, except for Gui. with windows 11, it seems it is not needed to install x11 server like xming, only a driver for your graphic card need to be installed

https://docs.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

lcpt commented 2 years ago

Could you finish the installation?

mihdicaballero commented 2 years ago

Hi! Thanks both for your help. I tried both suggestions and the second one worked: image

Then I run again the python modules script and got the same message: image

And then I run again the verification examples and got the same error of cannot finding xc: image

ebrahimraeyat commented 2 years ago

Hello @mihdicaballero. This are steps that I done for installing:

1- remove gmsh that installed in ubuntu:

sudo apt remove gmsh

2- search for gmsh.h, maybe you must install locate

locate gmsh.h

and then remove those. for mine:

 sudo rm /usr/local/include/gmsh.h*
sudo rm /usr/lib/x86_64-linux-gnu/libgmsh.so

3- install gmsh with pip:

pip install gmsh

4- link some gmsh with installed gmsh in my home path:

 sudo ln -s /home/ebrahim/.local/lib/python3.8/site-packages/gmsh-4.8.4-Linux64-sdk/lib/libgmsh.so  /usr/lib/x86_64-linux-gnu/libgmsh.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libgmsh.so /usr/lib/x86_64-linux-gnu/libgmsh.so.4.8
sudo ln -s /home/ebrahim/.local/lib/python3.8/site-packages/gmsh-4.8.4-Linux64-sdk/include/gmsh.h /usr/include/gmsh.h

5- finally install xc:

bash xc_code_install.sh

hope this can help.

mihdicaballero commented 2 years ago

I tried that, but the same happened. Maybe should I erase everything and start from scratch? image And then again that it can't find xc module :( Maybe I need more Ubuntu skill to understand the installation process.

lcpt commented 2 years ago

Hi! Thanks both for your help. I tried both suggestions and the second one worked: image

Then I run again the python modules script and got the same message: image

And then I run again the verification examples and got the same error of cannot finding xc: image

Sorry my mistake. The command is:

sudo apt install python-is-python3

lcpt commented 2 years ago

Hi.

I've added some checking to the local_install.sh script. Could you pull the repository again and then run `sudo sh local_install.sh'?

We are enhancing a bit the whole process, I think :)

mihdicaballero commented 2 years ago

Yes, no problem. I reset Ubuntu and started again the whole process to make sure I'm going well. So far, what I've done is:

  1. Install Ubuntu 20 from Microsoft store
  2. Install Xming and open it.
  3. Go to "Windows features" and check on "Windows Subsystem for Linux"
  4. Launch Ubuntu and accessed the terminal.
  5. Update all packages with sudo apt update
  6. Upgrade all packages with sudo apt upgrade -y
  7. Run cat /etc/lsb-release to check if Ubuntu is Debian or Focal.
  8. Install all dependencies with sudo bash packages_install_ubuntu_focal_fossa.sh.

I had an error in step 8. There was missing "" in line 16 of packages_install_ubuntu_focal_fossa.sh I think it should look like these, with "$1": if [ "$1" != "DoNotAsk" ]; then I modified that and could start downloading without issues in any dependencies.

Once I finish with the dependencies, I'll keep going.

lcpt commented 2 years ago

You're right, I've fixed this: if [ "$1" != "DoNotAsk" ]; then. Thanks!

mihdicaballero commented 2 years ago

Great news! I could install XC I believe, This was my procedure:

  1. Install Ubuntu 20 from Microsoft store
  2. Install Xming and open it.
  3. Go to "Windows features" and check on "Windows Subsystem for Linux"
  4. Launch Ubuntu and accessed the terminal.
  5. Update all packages with sudo apt update
  6. Upgrade all packages with sudo apt upgrade -y
  7. Run cat /etc/lsb-release to check if Ubuntu is Debian or Focal.
  8. Install all dependencies with sudo bash packages_install_ubuntu_focal_fossa.sh.
  9. Make sure Python 3 is the default Python interpreter for your system. If you are using a Debian like distribution, you can set Python 3 as the default interpreter as follows: sudo apt install python-is-python3.
  10. Run gmsh_code_install from ../build_xc\xc\install with bash gmsh_code_install.sh
  11. Cloned XC with git clone. git clone https://github.com/xcfem/xc/ xc
  12. Run cmake ../xc/src.
  13. Run make -j 8
  14. Run sudo make install
  15. Run sudo sh local_install.sh
  16. Run sh run_verif.sh

I tried running first the full script to install, but it failed because of that gmsh version problem, that I had to fix with that particular script that you made. Maybe that could be inside the complete install script?

Regarding the tests, almost all tests passed. I'll paste the tests that did not, maybe I did not get something correctly installed, since the error is always "connection refused". Since it is kinda long, I'll attach a txt with the log. Results test XC.txt

Thanks a lot.

ebrahimraeyat commented 2 years ago

Great news! I could install XC I believe, This was my procedure:

1. Install Ubuntu 20 from Microsoft store

Regarding the tests, almost all tests passed. I'll paste the tests that did not, maybe I did not get something correctly installed, since the error is always "connection refused". Since it is kinda long, I'll attach a txt with the log. Results test XC.txt

Thanks a lot.

Excellent, I also get those errors after installation. I think it is related to Gui part.

lcpt commented 2 years ago

Thanks to you.

Apparently this issue is related to the use of Matplotlib when the XServer is not running, if you don't mind, I'll close this issue and open a new one using your test results.

lcpt commented 2 years ago

I've opened the new issue.