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

The build instructions are out of date #114

Open
martin-g opened this issue Oct 26, 2022 · 10 comments
Open

The build instructions are out of date #114

martin-g opened this issue Oct 26, 2022 · 10 comments

Comments

@martin-g
Copy link

Hello,

I am trying to build https://github.com/OpenCMISS/iron.
Its README points to these build instructions - https://github.com/OpenCMISS/manage/raw/v1.0/OpenCMISSBuildEnvironment.docx.pdf
(The below is valid also for http://opencmiss.org/documentation/cmake/docs/build/index.html > Build on Linux)

To build on Linux the steps are:

Building on Linux
Default steps for Users (terminal/command line):
1. Create the OPENCMISS_ROOT folder somewhere and enter it
2. Clone the setup git repo into that folder via
git clone https://github.com/OpenCMISS/manage
or
Fetch and extract the zipped sources there and extract them into the
OPENCMISS_ROOT/manage folder.
3. Enter the OPENCMISS_ROOT/manage/build folder
4. Type “cmake ..”
...

My first confusion is: Why the document explains how to build manage project instead of iron ?! Is manage v2 of iron ?

Second question: The instructions say "Enter manage/build folder" but there is no such folder (https://github.com/OpenCMISS/manage/tree/develop/build -> error 404). Maybe the documentation should say "create manage/build folder and navigate to it" ?!

Anyway, following the steps leads to this error:

.../manage/build$ cmake .. 
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 11.3.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /bin/gfortran - skipped
CMake Error at CMakeLists.txt:104 (message):
  
  '/home/martin/git/install/share/cmake/Modules/OpenCMISS/OCArchitecturePathFunctions.cmake'
  does not exist.  The OpenCMISS CMake modules may not be
  installed/available.


-- Configuring incomplete, errors occurred!
See also "/home/martin/git/iron/manage/build/CMakeFiles/CMakeOutput.log".

And indeed OCArchitecturePathFunctions.cmake is not available at that location. I'd pass -DOPENCMISS_ROOT=... but I cannot find OCArchitecturePathFunctions.cmake neither in manage project, nor in iron, zinc or setup projects.

Any hints what should be the correct build steps ?

Thank you!

@martin-g
Copy link
Author

martin-g commented Nov 8, 2022

Anyone ?

@chrispbradley
Copy link
Member

Dear Martin, apologies for the delay in replying, I've been on holiday for the last few weeks, and it doesn't seem that anybody else picked this up. You are correct, the README does point to the build pdf document, but that document is very out of date. Firstly, to answer some of your questions, the CMake build system builds both iron (the computational engine) and zinc (graphics etc.). Thus manage is not the new iron but the repository that "manages" the build system. The problems you have stem from the fact that the build system has not been created/installed. Your best bet to build OpenCMISS is to use the setup scripts that will setup the build system and then build OpenCMISS. If you look at http://opencmiss.org/documentation/building/ it details how to build from scratch using setup. Please let me know how you get on.

@martin-g
Copy link
Author

Hi @chrispbradley !
Thank you for your help!

Following the steps in Quick Start section at http://opencmiss.org/documentation/building/ I was able to succeed with the build some more than my previous attempts!
But still there are errors:

  1. On my Ubuntu 22.04.1 x86_64 machine it failed with:
[ 25%] Performing configure step for 'OC_SCALAPACK'
-- OC_SCALAPACK configure command succeeded.  See also /home/martin/git/opencmiss/opencmiss/build/dependencies/scalapack/release/extproj/stamp/OC_SCALAPACK-configure-*.log
[ 26%] Performing build step for 'OC_SCALAPACK'
CMake Error at extproj/stamp/OC_SCALAPACK-build-Release.cmake:49 (message):
  Command failed: 2

   '/usr/bin/cmake' '--build' '/home/martin/git/opencmiss/opencmiss/build/dependencies/scalapack/release' '--' '-j8'

  See also

    /home/martin/git/opencmiss/opencmiss/build/dependencies/scalapack/release/extproj/stamp/OC_SCALAPACK-build-*.log

and in the log file it ends with:

     | 
<command-line>: note: this is the location of the previous definition
/home/martin/git/opencmiss/opencmiss/src/dependencies/scalapack/SRC/psstebz.f:778:65:

  775 |             CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', 1, 1, TORECV, 1, 0,
      |                                                         2        
......
  778 |                CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1, IWORK,
      |                                                                 1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
gmake[11]: *** [CMakeFiles/scalapack.dir/build.make:10407: CMakeFiles/scalapack.dir/SRC/psstebz.f.o] Error 1
gmake[11]: *** Waiting for unfinished jobs....
gmake[10]: *** [CMakeFiles/Makefile2:1280: CMakeFiles/scalapack.dir/all] Error 2
gmake[9]: *** [Makefile:146: all] Error 2
$ gfortran --version
GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

Which version of Fortran do I need to use ? http://opencmiss.org/documentation/building/requirements.html does not mention versions.

@martin-g
Copy link
Author

On my Ubuntu 20.04.5 aarch64 machine the build fails with another error:

[ 21%] Performing configure step for 'OC_PARMETIS'
CMake Error at extproj/stamp/OC_PARMETIS-configure-Release.cmake:49 (message):
  Command failed: 1

   '/usr/bin/cmake' '--no-warn-unused-cli' '-DCMAKE_PREFIX_PATH=/home/ubuntu/hpc/opencmiss/opencmiss/install/cmake' '-DCMAKE_MODULE_PATH=/home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/OpenCMISS;/home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/FindModuleWrappers;/home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules' '-DPACKAGE_CONFIG_DIR=cmake' '-DCMAKE_NO_SYSTEM_FROM_IMPORTED=YES' '-DCMAKE_DEBUG_POSTFIX=d' '-DCMAKE_POSITION_INDEPENDENT_CODE=YES' '-DOPENCMISS_INSTRUMENTATION=' '-DWARN_ALL=YES' '-DCHECK_ALL=YES' '-DCMAKE_INSTALL_DEFAULT_COMPONENT_NAME=Development' '-DCMAKE_INSTALL_PREFIX:PATH=/home/ubuntu/hpc/opencmiss/opencmiss/install' '-DCMAKE_BUILD_TYPE=Release' '-DBUILD_SHARED_LIBS=OFF' '-DWITH_OPENMP=NO' '-DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec' '-DMPI_VERSION=' '-DMPI_C_COMPILER=/usr/bin/mpicc' '-DCMAKE_C_COMPILER=/usr/bin/gcc' '-DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG -Ofast' '-DCMAKE_C_FLAGS_DEBUG=-g -O0 -Wall' '-DMPI_CXX_COMPILER=/usr/bin/mpicxx' '-DCMAKE_CXX_COMPILER=/usr/bin/g++' '-DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG -Ofast' '-DCMAKE_CXX_FLAGS_DEBUG=-g -O0 -Wall' '-DMPI_Fortran_COMPILER=/usr/bin/mpif77' '-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran' '-DCMAKE_Fortran_FLAGS_RELEASE=-O3 -DNDEBUG -O3 -Ofast' '-DCMAKE_Fortran_FLAGS_DEBUG=-g -O0 -Wall -fbacktrace -Warray-temporaries -Wextra -Wsurprising -Wrealloc-lhs-all -finit-real=snan -fcheck=all' '-DBUILD_TESTS=ON' '-GUnix Makefiles' '/home/ubuntu/hpc/opencmiss/opencmiss/src/dependencies/parmetis'

  See also

    /home/ubuntu/hpc/opencmiss/opencmiss/build/dependencies/parmetis/release/extproj/stamp/OC_PARMETIS-configure-*.log

and the log file contains:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find MPI (missing: MPI_C_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/FindMPI.cmake:1452 (find_package_handle_standard_args)
  CMakeLists.txt:13 (find_package)

In the CMake command from the first snippet we see -DMPI_C_COMPILER=/usr/bin/mpicc and it is existing:

$  /usr/bin/mpicc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I have OpenMPI installed:

$ mpi[TAB][TAB]
mpic++                                    (Open MPI C++ wrapper compiler)  mpiexec.openmpi  (Execute serial and parallel jobs in Open MPI. oshrun, shmemrun)
mpic++.openmpi                            (Open MPI C++ wrapper compiler)  mpif77                            (Deprecated Open MPI Fortran wrapper compilers)
mpiCC                                     (Open MPI C++ wrapper compiler)  mpif77.openmpi                    (Deprecated Open MPI Fortran wrapper compilers)
mpicc                                       (Open MPI C wrapper compiler)  mpif90                            (Deprecated Open MPI Fortran wrapper compilers)
mpiCC.openmpi                             (Open MPI C++ wrapper compiler)  mpif90.openmpi                    (Deprecated Open MPI Fortran wrapper compilers)
mpicc.openmpi                               (Open MPI C wrapper compiler)  mpifort                                       (Open MPI Fortran wrapper compiler)
mpicxx                                    (Open MPI C++ wrapper compiler)  mpifort.openmpi                               (Open MPI Fortran wrapper compiler)
mpicxx.openmpi                            (Open MPI C++ wrapper compiler)  mpirun           (Execute serial and parallel jobs in Open MPI. oshrun, shmemrun)
mpiexec  (Execute serial and parallel jobs in Open MPI. oshrun, shmemrun)  mpirun.openmpi   (Execute serial and parallel jobs in Open MPI. oshrun, shmemrun)

Any idea why it fails ?
Thank you!

@chrispbradley
Copy link
Member

Hi Martin, once again apologies for the delay in replying. We are in the process of re-writing/upgrading the build system to deal with one of the problems you have identified. Some of the dependencies are old and newer versions of compilers have problems compiling them. Is there any chance you can try an earlier version of the GNU compiler or another compiler (e.g., intel - yes, I know it is not free)? The new build system with the new version of the dependencies is not really ready for use at the moment. As for the error on the Ubuntu system then it seems to be a problem with not finding the mpicc compiler which it should be able to find. I've personally had problems with OpenMPI in the past and tend to use MPICH but I understand OpenMPI is the default on Ubuntu. The two versions of MPI should be interchangeable but it never seems to work out that way. Are you able to completely uninstall OpenMPI and install MPICH? If so, maybe do that, delete the build and install folders and then try building from setup again?

@martin-g
Copy link
Author

Hi @chrispbradley !

When I remove OpenMPI and I install MPICH I get this error:

-- Looking for an MPI ...
CMake Error in /home/ubuntu/hpc/opencmiss/opencmiss/build/manage/release/config/Release/CMakeFiles/CMakeTmp/CMakeLists.txt:
  Imported target "MPI::MPI_C" includes non-existent path

    "/usr/lib/aarch64-linux-gnu/openmpi/include/openmpi"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in /home/ubuntu/hpc/opencmiss/opencmiss/build/manage/release/config/Release/CMakeFiles/CMakeTmp/CMakeLists.txt:
  Imported target "MPI::MPI_C" includes non-existent path

    "/usr/lib/aarch64-linux-gnu/openmpi/include/openmpi"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error at /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/FindMPI.cmake:1002 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/FindMPI.cmake:1044 (_MPI_try_staged_settings)
  /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/FindMPI.cmake:1271 (_MPI_check_lang_works)
  /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/OpenCMISS/OCDetermineMPIFunctions.cmake:202 (find_package)
  /home/ubuntu/hpc/opencmiss/opencmiss/install/share/cmake/Modules/OpenCMISS/OCSelectMPI.cmake:2 (find_mpi_implementation)
  CMakeLists.txt:255 (include)


-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/hpc/opencmiss/opencmiss/build/manage/release/config/Release/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/hpc/opencmiss/opencmiss/build/manage/release/config/Release/CMakeFiles/CMakeError.log".
make[5]: *** [CMakeFiles/manage_config.dir/build.make:79: config/Release/stamp/manage_config-create] Error 1
make[4]: *** [CMakeFiles/Makefile2:396: CMakeFiles/manage_config.dir/all] Error 2
make[3]: *** [Makefile:95: all] Error 2
make[2]: *** [CMakeFiles/setup_manage.dir/build.make:113: setup_manage-prefix/src/setup_manage-stamp/setup_manage-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:106: CMakeFiles/setup_manage.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I have tried with GCC 7 too (it is the oldest I can install from Ubuntu 20.04 repos):

mpicc.mpich --version
gcc (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ubuntu@aarch64 ~/h/o/setup-build> mpicc.openmpi --version
gcc (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I will try to get Intel compiler!

@chrispbradley
Copy link
Member

Hi Martin, can I just confirm that you are using the develop branches of everything? i.e., git checkout -b develop. If not (or you want to check), can you checkout the develop branches in every repository in /home/ubuntu/hpc/opencmiss/opencmiss/src and in the setup directory. Then delete the build and install directories and try running setup again. Also, it may be possible to provide binaries if there are problems building. Would something like a virtual machine image or a container be useful or do you need to build the source?

@martin-g
Copy link
Author

Hi @chrispbradley !

I can confirm that I use develop branches for:

  • /home/ubuntu/hpc/opencmiss/setup
  • /home/ubuntu/hpc/opencmiss/opencmiss/src/cmake_modules
  • /home/ubuntu/hpc/opencmiss/opencmiss/src/iron
  • /home/ubuntu/hpc/opencmiss/opencmiss/src/manage
  • /home/ubuntu/hpc/opencmiss/opencmiss/src/zinc

I need to use OpenCMISS on Linux ARM64. Are there download binaries or Docker image for ARM64 ?

I also found the Intel oneAPI compilers (free!) and I am going to try them to build OpenCMISS on x86_64, but the oneAPI installers also do not work on aarch64 (ARM64)...

@martin-g
Copy link
Author

martin-g commented Jan 15, 2025

I just tried again and this time the build failed with:

...
-- OC_SUPERLU_DIST configure command succeeded.  See also /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/superlu_dist/release/extproj/stamp/OC_SUPERLU_DIST-configure-*.log
[ 40%] Performing build step for 'OC_SUPERLU_DIST'
-- OC_SUPERLU_DIST build command succeeded.  See also /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/superlu_dist/release/extproj/stamp/OC_SUPERLU_DIST-build-*.log
[ 40%] Performing install step for 'OC_SUPERLU_DIST'
-- OC_SUPERLU_DIST install command succeeded.  See also /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/superlu_dist/release/extproj/stamp/OC_SUPERLU_DIST-install-*.log
[ 42%] Completed 'OC_SUPERLU_DIST'
[ 42%] Built target OC_SUPERLU_DIST
[ 42%] Support: Creating SUNDIALS buildlog
[ 42%] Built target SM_SUNDIALS_build_log
[ 43%] Creating directories for 'OC_SUNDIALS'
[ 43%] No download step for 'OC_SUNDIALS'
[ 43%] No update step for 'OC_SUNDIALS'
[ 43%] No patch step for 'OC_SUNDIALS'
[ 43%] Performing configure step for 'OC_SUNDIALS'
-- OC_SUNDIALS configure command succeeded.  See also /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/sundials/release/extproj/stamp/OC_SUNDIALS-configure-*.log
[ 43%] Performing build step for 'OC_SUNDIALS'
CMake Error at extproj/stamp/OC_SUNDIALS-build-Release.cmake:49 (message):
  Command failed: 2

   '/home/mgrigorov/miniconda3/lib/python3.10/site-packages/cmake/data/bin/cmake' '--build' '/home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/sundials/release' '--' '-j8'

  See also

    /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/sundials/release/extproj/stamp/OC_SUNDIALS-build-*.log


gmake[8]: *** [CMakeFiles/OC_SUNDIALS.dir/build.make:86: /home/mgrigorov/git/bioconda/cmiss/opencmiss/build/dependencies/sundials/release/extproj/stamp/OC_SUNDIALS-build] Error 1
gmake[7]: *** [CMakeFiles/Makefile2:3877: CMakeFiles/OC_SUNDIALS.dir/all] Error 2
gmake[6]: *** [Makefile:146: all] Error 2
gmake[5]: *** [CMakeFiles/manage_config.dir/build.make:81: config/Release/stamp/manage_config-build] Error 2
gmake[4]: *** [CMakeFiles/Makefile2:317: CMakeFiles/manage_config.dir/all] Error 2
gmake[3]: *** [Makefile:101: all] Error 2
gmake[2]: *** [CMakeFiles/setup_manage.dir/build.make:86: setup_manage-prefix/src/setup_manage-stamp/setup_manage-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/setup_manage.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@chrispbradley
Copy link
Member

Thank you for the issue. Yes, the build instructions (and much else) are outdated. We are working on a new build system and instructions and hope to update everything shortly. If you have more urgent requirements, I can advise?

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